SQL - Identifiers, Think SQL
As with any programming language, there are a few terms unique to that language.
An Identifier is essentially a name of a database, table, or table column. As the creator of the database you are free to identify these objects as you please, we merely suggest you keep these guidelines in mind when doing so.
- Develop your own unique naming scheme. -- Use terms that relate to one another and will be easy to recognize apart from your code.
- Be conscious of how long your names become. -- Especially be aware when the time comes to name your columns.
- Avoid names without meaning. -- Develop a working scheme that also has meaning behind the names.
- Be consistent. -- If you capitalize one table name, capitalize each table name, if you choose to use abbreviations make sure they do not have double meanings or ambiguous meaning.
Develop a clear, concise schema and stick to it as your database develops.
SQL - Literals
Literal is a term for data types such as strings, numbers, or boolean values in SQL. These values are not named by you the programmer they just exist. Strings, numbers, and boolean values are literals.
Literal Breakdown:
string literals
'This is a string value'
'5893 Moon River Dr.'
number literals
823
-4.5
3.387920
boolean literals
TRUE
FALSE
1
0
SQL - Keywords and Reserved Terms
A reserved term is a word used in the actual processing of data. A few lessons down the road you will be introduced to terms called clauses. These clauses are commands issued to the SQL program and usually involve some sort of data manipulation. For instance the clause "CREATE" is used to create tables and databases therefore CREATE is a reserved term. Functions are also reserved terms. A simple function is the SUM() function. This function will simply sum up all the numbers of one of your table columns and return the result. Since SUM is used as a function by SQL it is a reserved term. Reserved terms should not be used as identifiers.
Tips
- Identifiers are not to be confused with Identity Columns. These are unique columns that should be named according to your personal schema, however they are two separate entities.
|