Alex Rivera | Logout

Database, Table and Column Naming Conventions?

Asked 2008-08-11T10:27:22.780
941

Whenever I design a database,

  1. Should table names be plural?
  2. Should column names be singular?
  3. Should I prefix tables or columns?
  4. Should I use any case in naming items?

What are recommended guidelines for naming items in a database?

Edit
Report

2 Answers

14

In my opinion:

  1. Table names should be plural.
  2. Column names should be singular.
  3. No.
  4. Either CamelCase (my preferred) or underscore_separated for both table names and column names.

However, like it has been mentioned, any convention is better than no convention. No matter how you choose to do it, document it so that future modifications follow the same conventions.

answered 2008-08-11T15:23:32.027
11

The best answer to each of those questions would be given by you and your team. It's far more important to have a naming convention then how exactly the naming convention is.

As there's no right answer to that, you should take some time (but not too much) and choose your own conventions and - here's the important part - stick to it.

Of course it's good to seek some information about standards on that, which is what you're asking, but don't get anxious or worried about the number of different answers you might get: choose the one that seems better for you.

Re the question bullets:

  1. Yes. A table is a group of records, teachers or actors, so... plural.
  2. Yes.
  3. I don't use them.
  4. The database I use more often - Firebird - keeps everything in upper case, so it doesn't matter. Anyway, when I'm programming I write the names in a way that it's easier to read, like releaseYear.
answered 2008-08-11T11:14:11.937

Your Answer