Information Modeling and Relational Databases: From Conceptual Analysis to Logical Design

11.4 SQL: Identifiers and Data Types

For a given schema, some database objects such as base tables, views, domains, and constraints are identified by name. A column is identified by appending its (local) name to the name of its table, using a dot notation . This distinguishes columns with the same local name in different tables. For example, the second columns of the tables Subject ( subjectCode , title, credit) and Book ( isbn , title) are identified as "Subject.title" and "Book.title", respectively. In SQL, all names (including local names) are called identifiers, even though local names provide identification only within a limited context.

In SQL-89, identifiers were restricted to at most 18 characters, and all letters had to be in upper case. In SQL-92 and SQL:1999, an identifier is either regular or delimited. A regular identifier is a string of at most 128 characters, the first of which must be a letter ( \a .. z , A .. Z ). Each later character must be a letter, digit ( 0 .. 9 ), or underscore ( _ ). Moreover, no reserved word may be used as a regular identifier. You may, however, use a reserved word as part of an identifier. For example, note is fine as an identifier even though it includes the reserved word not".

Commercial SQLs may require shorter identifiers or allow some other characters. In Oracle, the length of identifiers is restricted to 30 characters. Microsoft SQL Server allows identifiers of up to 128 characters, but also allows the first character to be...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Optical Character Recognition Software (OCR)
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.