Exact Duplicate
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 ?
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 ?
I like to use singular names like Agent that have PK names like AgentID.
But that's just me :o)
IMHO, Table names should be plular like Customers.
Class names should be singular like Customer if it maps to a row in Customers table.
My personal philosophy is that using a plural database table name is redundant, unless you're only planning for the table to contain one row.
I like to use plural forms, simply because one table contains several entities, so it seems more natural to me.
Linq to SQL converts plural form table names to singular when creating data entities. I assume that Microsoft would not have implemented this functionality if they considered plural forms for table names bad practice.
Singular, so you can have:
etc.
IMHO it doesn't really matter, just do whatever is comfortable with you and the people that are using the database.
I think I subconsciously list main data tables with an s and "pick list" or foreign key tables and singular.
At my current company we use Plural for table names. The reasoning is this: If we have a Customers table we consider each row a Customer, so the table itself is a collection of customers.
The most important thing is to be consistent in your usage. It is annoying to have to remember which tables are plurals and which are not. Same thing with your field names, pick one stadard and use it. Don't make the poor developers have to determine if this table uses person_id or personid or peopleid or person$id, etc. It is amazing the amount of time you can waste when you don't have standards trying just to remember which table uses what.
There is no should or must be this way or that way correct answer to this question. It's up to the designer of the database and software.
As for me, I usually use singular names becouse when I do the E-R diagram I have an entity Customer , not Customers, so I keep it same as to not get confused.
Ofcourse some frameworks do favor one style or another, so you should be best of to follow those practices when you notice them.
As with lots of these types of questions the best answer is often "consistent". You can argue the table represents a single entity and as such deserves a singular name, or that it contains multiple entities so it should be plural. My advice is flip a coin and go with it for the entire database.
Well, obviously your database table names have absolutely got to be named in a "standard" fashion which I will hitherto arbitrarily define.
First, all tables names shall be prefixed with "t_". Following this, the singular entity name in StudlyCaps, e.g. "Customer". Immediately afterwards, this shall contain the number of columns created in the first version of the schema, for historical purposes, followed by an underscore, and the precise normal form of the data; either "1", "2", "3" or "B" for BCNF. Any higher normal forms shall be denoted by a "P".
Some examples of acceptable names are:
t_Customer_6_3
t_Order_5_B
t_OrderLine_4_2
I think my point is, it really doesn't matter, as long as the name is reasonably descriptive and naming is consistent.
There are many arguments for each, but it all boils down to what you feel comfortable with. Neither is wrong.
What's really important is that you are consistent. Choose one standard and stick to it, which one you choose is of less importance.