Singular or plural database table names?

Exact duplicate

Table Name Dilemma: Singular or Multiple Names

Is it better to use unique or plural database table names? Is there an accepted standard?

I heard the pros and cons, what do you guys think?

+53
sql mysql sql-server
Apr 30 '09 at 20:50
source share
13 answers

IMHO, table names must be multiple as clients.

Class names must be unique, such as Customer, if they are mapped to a table in the Customers table.

+73
Apr 30 '09 at 20:52
source share

Singular, so you can:

  • Client
  • CustomerAddress
  • CustomerAddressAuditTrail

and etc.

+98
Apr 30 '09 at 20:53
source share

I like singular names, but seem to be in the minority.

+25
Apr 30 '09 at 20:54
source share

My personal philosophy is that using the plural name of a database table is redundant unless you plan on having the table contain one row.

+16
Apr 30 '09 at 20:52
source share

I like to use unique names like Agent, which have PK names like AgentID.

But it's just me: o)

+11
Apr 30 '09 at 20:52
source share

I like to use multiple forms, simply because one table contains several objects, so for me it seems more natural.

Linq to SQL converts plural table names to one when creating data objects. I assume that Microsoft would not have performed this function if they had considered multiple forms for the wrong practice of table names.

+10
Apr 30 '09 at 20:53
source share

In my current company, we use Plural for table names. The reason for this is the following: if we have a Customers table, we look at each row of the Customer, so the table itself is a collection of customers.

+9
Apr 30 '09 at 20:55
source share

Well, it is obvious that your database table names have an absolutely derived one , which should be named in the standard style, which I still arbitrarily define.

First, all table names must have the prefix "t_". After that, the only entity name in StudlyCaps, for example. "Client". Immediately after this, it should contain the number of columns created in the first version of the schema, for historical purposes, followed by the underscore and the exact normal form of the data; either "1", "2", "3" or "B" for BCNF. Any higher normal forms are indicated by the letter "P".

Some examples of valid names:

t_Customer_6_3 t_Order_5_B t_OrderLine_4_2 

I think my question is that it really doesn't matter if the name is conditional enough and the naming is consistent.

+8
Apr 30 '09 at 20:56
source share

The most important thing is to be consistent in your use. It is annoying to remember which tables are multiple and which are not. Same thing with the names of your fields, select one stadard and use it. Do not force poor developers to determine if this table uses person_id or personid or peopleid or person $ id, etc. It's amazing how much time you can spend when you don’t have standards trying to just remember which table uses what.

+5
Apr 30 '09 at 20:55
source share

No, there should or should be one way or another the correct answer to this question. It is up to the designer of the database and software.

As for me, I usually use unique names, because when I make an ER diagram, I have a Customer client, not clients, so I keep it the same so as not to get confused.

Of course, some frameworks do contribute to a particular style, so you should be better off following these methods when you notice them.

+4
Apr 30 '09 at 20:56
source share

There are many arguments for each, but it all comes down to what you are comfortable with. Wrong.

What really matters is that you are consistent. Choose one standard and stick to it that you choose is less important.

+2
Apr 30 '09 at 20:57
source share

IMHO, it does not really matter, just do whatever is convenient for you and the people who use the database.

I think it is subconscious to enumerate the main data tables with s and a "pick list" or tables of foreign keys and singular numbers.

0
Apr 30 '09 at 20:54
source share

As with many of these types of questions, the best answer is often "consistent." You can argue that a table is a single entity and as such deserves a single name or that it contains multiple instances of an object, so it must be multiple. My advice is to flip a coin and go with it for the entire database (or stick to the convention that already has the majority).

0
Apr 30 '09 at 20:56
source share



All Articles