Whenever I design a database, I usually question if there's a easiest way of naming a product during my database. Quite frequently I request myself the next questions:

  1. Should table names be plural?
  2. Should column names be singular?
  3. Must I prefix tables or posts?
  4. Must I use any situation in naming products?

What are the suggested recommendations available for naming products inside a database?

I suggest looking at Microsoft's SQL Server sample databases: http://codeplex.com/SqlServerSamples

The AdventureWorks sample utilizes a very obvious and consistent naming convention that utilizes schema names for that organization of database objects.

  1. Singular names for tables
  2. Singular names for posts
  3. Schema reputation for tables prefix (E.g.: SchemeName.TableName)
  4. Pascal casing

Ok, since we are hitting the scales with opinion:

In my opinion that table names ought to be plural. Tables really are a collection (a table) of organizations. Each row signifies just one entity, and also the table signifies the gathering. And So I would call a table of human organizations People (or Persons, whatever you admire).

For individuals who want to see singular "entity names" in queries, that is what I'd use table aliases for:

Choose person.Title

FROM People person

A little like LINQ's "from part of people choose person.Title".

For 2, 3 and 4, To be sure with @Lars.

  1. No. A table ought to be named following the entity it signifies. Person, not persons is when you'd make reference to whomever among the records signifies.
  2. Again, same factor. The column FirstName must not be known as FirstNames. Everything is dependent on what you would like to represent using the column.
  3. NO.
  4. Yes. Situation it for clearness. If you want to have posts like "FirstName", casing can make it simpler to see.

    Ok. Thats my $.02

Sometimes inside a database support team with three DBAs and our considered choices are:

  1. Any naming standard is preferable to no standard.
  2. There's no "one true" standard, everybody has their preferences
  3. If there's standard already in position, utilize it. Don't create another standard or muddy the present standards.

We use singular names for tables. Tables are usually prefixed using the title from the system (or its acronym). This really is helpful when the system complex as possible alter the prefix to group the tables together realistically (ie. reg_customer, reg_booking and regadmin_limits).

For fields we'd expect area names to become range from the prefix/acryonm on the table (i.e. cust_address1) and that we also prefer using a standard group of suffixes ( _id for that PK, _compact disc for "code", _nm for "title", _nb for "number", _dt for "Date").

The title from the Foriegn key area ought to be the just like the main key area.


Choose cust_nm, cust_add1, booking_dt

FROM reg_customer

INNER JOIN reg_booking

ON reg_customer.cust_id = reg_booking.cust_id

When creating a new project, I'd recommend you create all of the preferred entity names, prefixes and acronyms and provide this document for your designers. Then, once they decide to produce a new table, they are able to make reference to the document instead of "guess" exactly what the table and fields ought to be known as.

I am also towards a ISO/IEC 11179 style naming convention, observing they're recommendations instead of being prescriptive.

See Data element title on Wikipedia:

"Tables are Collections of Organizations, and follow Collection naming recommendations. Ideally, a collective title can be used: eg., Personnel. Plural can also be correct: Employees. Incorrect names include: Worker, tblEmployee, and EmployeeTable."

Of course, you will find exceptions to rules e.g. a table which has exactly one row might be better having a singular title e.g. a config table. And consistency is very important: check whether you shop includes a convention and, if that's the case, abide by it if you do not enjoy it then perform a business situation to be transformed instead of being the lone ranger.