Table Naming Dilemma: Singular vs. Plural Names
Is it better to use singular or plural database table names ? Is there an accepted standard ?
I've heard arguments for and against it, what do you guys think ?
Once instantiated, the name reflects its instance. So with databases, the entity when made into a table (a collection of entities or records) is plural.
The plural form of database is databases.
In laravel the table names are plural by default and "id" is the default primary key. The pivot table is "derived from the alphabetical order of the related model names". So in your example it would be role_user, not user_role. Last updated 3 months ago.
Definitely singular. You don't create an object of People , you create a collection of Person objects. The only time I would use plurals would be for static classes, i.e. SupportServices , StringUtils , etc. However in this case, the class acts more as a namespace than anything else.
Singular, so you can have:
etc.
IMHO, Table names should be plural like Customers.
Class names should be singular like Customer if it maps to a row in Customers table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With