(pronounced "nool-ian") Naming Convention refers to a method for naming fields in a database
The convention is based around using a 3 letter prefix on each field name
. The prefix
is a reference to the name of the table
containing the field. For example, a table called "UserProfiles" might contain the following fields:
The first field in the table is the primary key
for the table. Notice that the field name (less the prefix) is the same as the prefix, with "ID" suffixed. This makes it easy to identify foreign key
links between tables. For example, a table called "Cubicles" could reference "UserProfiles" to indicate what user is sitting in the cubicle, and might contain these fields:
It's easy to identify the CUB_USRID field as a foreign key, and developers
that are even mildly familiar with the database will be able to quickly ascertain that the foreign key is linked to the "UserProfile" table.
Another advantage of the Nyulian Naming Convention
is realized when coding SQL
statements, particularly for JOIN
s. Since each table has a unique 3 letter suffix applied to each field, each field throughout the database is unique. Therefore, it is no longer necessary to alias
table names or append table names to field names when JOINing tables. For example:
SELECT * from Cubicles INNER JOIN UserProfiles ON CUB_USRID = USR_USRID
The naming convention is useful for small to medium sized databases
, however, it can be difficult to maintain and it's usefulness declines when used for large databases. The greater the number of tables in the database, the more difficult it becomes to create obvious and meaningful
3 letter combinations.
The naming convention is named after Frank Nyul
who developed it in 1998 while working for (the now defunct) Daedalian Systems Group
Note: I am not Frank Nyul. And I have used this naming convention on a number of projects.