Guidelines for table names

Most organizations have naming conventions to ensure that objects are named in a consistent manner. Consider these basic requirements for table names.

The table name is an SQL identifier of up to 128 characters. For more information, see Identifiers in SQL.

When you define a table that is based directly on an entity, these factors also apply to the table names.

Also, the following naming conventions apply to table-name values in SQL statements.

table-name
A qualified or unqualified name that designates a table.

A fully qualified table name is a three-part name. The first part is a location name that designates the DBMS at which the table is stored. The second part is a schema name. The third part is an SQL identifier. A period must separate each of the parts.

A two-part table name is implicitly qualified by the location name of the current server. The first part is a schema name. The second part is an SQL identifier. A period must separate the two parts.

A one-part or unqualified table name is an SQL identifier with two implicit qualifiers. The first implicit qualifier is the location name of the current server. The second is a schema name, which is determined by the rules set forth in Unqualified object name resolution. For a declared temporary table, the qualifier (the second part in a three-part name and the first part in a two-part name) must be SESSION. For complete details on specifying a name when a declared temporary table is defined and then later referring to that declared temporary table in other SQL statements, see DECLARE GLOBAL TEMPORARY TABLE statement.