Sql Excel : Tips on Naming Things

The datasets provided with this book have various original sources, so they have
different naming conventions. In general, there are some things that should
always be avoided and some things that are good practice:
Always use only alphanumeric characters and underscores for table and
column names. Other characters, such as spaces, require that the name be
escaped when referenced. The escape characters, typically double quotes or
square braces, make it hard to write and read queries.
Never use SQL reserved words. Databases have their own special words, but
words like Order, Group, and Values are keywords in the language and should be
Additional good practices include the following:
Table names are usually in plural (this helps avoid the problem with reserved
words) and reinforces the idea that tables contain multiple instances of the
The primary key is the singular of the table name followed by “Id.” Hence,
OrderId and SubscriberId. When a column references another table such as the
OrderId column in OrderLines (a foreign key relationship) use the exact same
name, making it easy to see relationships between tables.
“CamelBack” case is used (upper case for each new word, lowercase for the
rest). Hence, OrderId instead of Order_Id. In general, table names and column
names are not case sensitive. The CamelBack method is to make it easier to
read the name, while at the same time keeping the name shorter (than if using
The underscore is used for grouping common columns together. For instance,
in the Calendar table, the indicators for holidays for specific religions start with
Of course, the most important practice is to make the column and table names
understandable and consistent, so you (and others) recognize what they mean.