Datasheet
Part I SQL Basic Concepts and Principles
the American National Standards Institute (ANSI) and the International Organization for Stan-
dardization (ISO). All three are able to run on the Windows operating system. Oracle also is
available on virtually any UNIX flavor, Linux, Apple Mac OS X Server, IBM z/OS. OpenVMS;
DB2 for Linux, UNIX, and Windows runs on AIX, HP-UX, Solaris, Linux, and Microsoft
Windows.
ANSI is a private, nonprofit organization that administers and coordinates the U.S.
voluntary standardization and conformity assessment system. ANSI’s mission
is to enhance both the global competitiveness of U.S. business and the U.S. quality of life by
promoting and facilitating voluntary consensus standards and conformity assessment systems, and
safeguarding their integrity. ANSI (
www.ansi.org) was founded October 18, 1918, and is the offi-
cial U.S. representative to ISO (
www.iso.org) and some other international institutions.
The problem is that none of the databases mentioned earlier is 100-percent ANSI SQL-compliant.
Each of these databases shares the basic SQL syntax (although some diversity exists even there),
but the language operators, naming restrictions, internal functions, data types (especially date-
and time-related), and procedural language extensions are implemented differently.
See Chapter 14, ‘‘Stored Procedures, Triggers, and User-Defined Functions,’’ for more
information on the SQL procedural extensions.
Table 1-1 compares some data on maximum name lengths supported by different database
implementations.
In an ideal world, the standards would rule supreme, and SQL would be freely shared among
different implementations for the benefit of humanity. Unfortunately, the reality looks somewhat
different. While it is possible to distill a standard SQL understood by all database vendors’ prod-
ucts, anything other than some very trivial tasks would be more quickly and efficiently accom-
plished with implementation-specific features.
TABLE 1-1
Maximum Name-Length Restrictions for Some Database Objects
IBM DB2 9.5 Microsoft SQL Server 2008 Oracle 11G
Table name length (characters) 128 128 30
Column name length (characters) 128 128 30
Constraint name length (characters) 128 128 30
Index name length (characters) 128 128 30
Number of table columns 1012 1024 1000
8