SQL Format, Part 1 of 4
Here is a statement used to explain the SQL syntax:
Comment: A comment is optional and is for human interpretation only. The software totally ignores any comments. Most PC and server vendors use the “–” for comments, whereas mainframe engines such as IBM’s DB2 use “/*” and “*/” to bracket their comments.
SQL Statement: An SQL statement is a legitimate combination of clauses (in a specific order) consisting of appropriate keywords, identifiers, symbols, and operators, and is terminated with a semicolon.
Clauses: A clause is part of an SQL statement and can be required or optional in different contexts. Each clause starts with a keyword (i.e. SELECT, FROM, WHERE, ORDER BY, etc.) and these clauses must be written in a particular order. Following the keyword are the appropriate identifiers and operators.
Keywords: These are reserved words that have specific meaning to the RDBMS interpreter. Since these are reserved words, they can not be used for any other purpose (such as table names).
Identifiers: These are the names of database objects that have been created by you or your database administrator to identify tables, views, columns, indices, aliases, etc. They can be any name except a keyword.
Terminating semicolon: All SQL statements must contain a semicolon “;” that defines the end of the SQL statement.
