4 ms·
The conflict arises because the table name serves both to name a collection and to name a type. For types, the general convention is for the name to correspond
by layer8 4y ago
The conflict arises because the table name serves both to name a collection and to name a type. For types, the general convention is for the name to correspond to what a single instance of the type represents, so usually singular.
In an alternative universe, databases would maybe distinguish between the two like programming languages do. But you rarely have two tables with the same “type”, so there’s a reason why they don’t.
Arguably, table names occur more often in their “type” capacity than in their “collection” capacity. The most convincing argument for me, besides ORM name mappings becoming trivial, is the “<table>.<column>” syntax, where you want to have “employee.salary” rather than “employees.salary”.
Not that long ago, length limits on table names were an additional argument for sticking with the shorter convention.
This topic also reminds me of the convention for Git commit messages to use the imperative mood instead of past tense, which at first feels odd, but then you get used to it rather quickly.