Research IT Application Development

Database Table Naming

A medium sized database design can easily go over 100 tables. By the time one has named 100 tables or so, you can appreciate the value in consistency in table naming. A design benefits by making early decisions on standards.

One decision is whether to name tables in the singular or the plural, for example naming a table "classroom" or "classrooms". Consistency would argue towards not having a mixture of some tables with singluar names, and some with plural names.

We adhere to the convention of naming tables in the singular form rather than the plural. One can think of this as naming the table for an instance in the table rather than for the collection as a whole.

 Although this convention may at first seem counter-intuitive, following it facilitates the naming of tables which represent a many-to-many relationship. For example, in a database used to schedule courses into classrooms, there is a many-to-many relationships between "course" and "classroom". Naming the table representing this relationship as "course_classroom" rather than "courses_classrooms" is less awkward and is inherently consistent.

 This example relies on another convention of naming many-to-many relationship tables as a concatenation of names of the parent tables.

Return to previous page