O'Reilly logo

Joe Celko's Thinking in Sets: Auxiliary, Temporal, and Virtual Tables in SQL by Joe Celko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.1. Data Element Names

This is a short list of postfixes that can be used as the name of the key column in auxiliary tables. There is a more complete list of postfixes in my book SQL Programming Style(ISBN: 0-12088-797-5). The most important point is that the primary key of an auxiliary table cannot be an identifier (“_id”) because an identifier uniquely references an entity. Auxiliary tables do not hold entities; they deal with attribute values and computations.

“_nbr” or “_num” = tag number; this is a string of digits that names something. Do not use “_no” since it looks like the Boolean yes/no value. I prefer “_nbr” to “_num” since it is used as a common abbreviation in several European languages.

“_code” or “_cd” = a code, which is a standard ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required