Download SQL Standard

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Operational transformation wikipedia , lookup

Business intelligence wikipedia , lookup

Data vault modeling wikipedia , lookup

Concurrency control wikipedia , lookup

Versant Object Database wikipedia , lookup

Relational algebra wikipedia , lookup

SAP IQ wikipedia , lookup

Oracle Database wikipedia , lookup

Microsoft Access wikipedia , lookup

Tandem Computers wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Database wikipedia , lookup

Clusterpoint wikipedia , lookup

Database model wikipedia , lookup

Relational model wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Open Database Connectivity wikipedia , lookup

SQL wikipedia , lookup

PL/SQL wikipedia , lookup

Transcript
Overview of Standard Query Language
(SQL)
Saeideh Joodaki
Instructor: Dr.Yingshu Li
Outline

Standardization.

Brief review of SQL 86, SQL 89, SQL 92.

Evolution to SQL: 1999.

Latest version; SQL: 2003.
Database Standard Organization

ISO (International Standard Organization)

JTC1 (Joint Technical Committee 1)

Subcommittee SC32
WG3 (Database Languages)
WG4 (SQL/MM)

ANSI (American National Standards Institute)

NCITS (National Committee for Information Technology
Standardization)

H2 (X3H2)
The SQL standard has gone through
a number of revisions
Year
Name
Alias
Comments
1986
SQL-86
SQL-87
First published by
ANSI. Ratified by
ISO in 1987.
1989
SQL-89
1992
SQL-92
SQL2
Major revision.
1999
SQL:1999
SQL3
Added objectoriented features,
introduced
OLAP,…
2003
SQL:2003
Minor revision.
Introduced XMLrelated features,…
SQL-86

The first generation of SQL.

Implemented by IBM.

Defined 3 ways to process DML.
Direct processing, Module language, Embedded SQL

Bindings to Cobol, Fortan, Pascal, PL/1.

Criticized for the lack of common features
and orthogonality (independence).
SQL-89



Superset of SQL-86.
Bindings to two more languages, C and ADA.
Defined DDL in the separate “schema
definition language”.
(CREATE TABLE, CREATE VIEW, and GRANT PRIVILEGES, with No
drop, Alter, or revoke).


Introduced default, Unique, and Not Null
values.
Defined Primary keys, check constraint, and
Referential integrity.
SQL-92

Superset of SQL-89.

Designed to be a standard for relational database
management systems (RDBMSs).

Added significant new features and capabilities to
the specifications, such as:



Support for additional data types (DATE, TIME, TIMESTAMP,
INTERVAL, BIT string, variable-length character and bit
strings, and NATIONAL CHARACTER strings),
Additional set operators (for example, union join, natural join,
set difference, and set intersection),
Capability for domain definitions in the schema.
SQL:1999



Intended as a major enhancement.
Characterized as "object-oriented SQL“.
In addition to the object oriented extensions, there
are some other new features like;
Triggers, Stored procedures and user-defined functions,
Recursive queries, OLAP, SQL procedural constructs,
Expressions in ORDER BY Savepoints, Update through
unions and joins.

The new features are divided into five category: new
data types, new predicates, enhanced semantics,
additional security, and active database.
(SQL: 1999) New Data Types

SQL:1999 has four new data types:
1.
Large Object (LOB) type


CHARACTER LARGE OBJECT (CLOB)
BINARY LARGE OBJECT (BLOB)
2.
Boolean type
3.
Two new composite types: ARRAY (storing collections
of values in a column) and ROW (storing structured
values in single columns of the database)
4.
Distinct types
(SQL: 1999) New Predicates

Using “SIMILAR” besides “LIKE”: gives programs
UNIX-like regular expressions.
WHERE NAME SIMILAR TO '(SQL-(86|89|92|99)) I
(SQL(I|2|3))‘
(which would match the various names given to the SQL
standard over the years.)

DISTINCT predicate.
(SQL: 1999) Enhanced Security

Adding role facility.

Granting privileges to the roles.

Simplifying the difficult job of managing security in
a Database environment.
(SQL: 1999) Active Database

This facility is provided through a feature
known as triggers.
(SQL: 1999) Object Orientation

The structured user-defined types.

They may be defined to have one or more
attributes.

All aspects of their behaviors are provided
through methods, functions, and procedures.

Their attributes are encapsulated through the use
of system-generated observer.

They may participate in type hierarchies.
SQL: 2003

Makes revisions to all parts of SQL: 1999.

Adds a brand new part: SQL/XML (XML-Related
Specifications).

New features are categorized as:






New data types,
Enhancements to SQL-invoked routines,
Extensions to CREATE TABLE statement,
A new MERGE statement,
A new schema object - the sequence generator,
Two new sorts of columns – identity columns and
generated columns.
(SQL: 2003) New Data Types

Retains all data types that existed in SQL:
1999 with the exception of the BIT and BIT
VARYING data types.

Introduces three new data types:
1.
2.
3.
BIGINT
MULTISET
XML
(SQL: 2003) Table Functions

New in SQL: 2003.

SQL-invoked function that returns a “table”.

Table functions give increased functionality by
allowing sets of tuples from any external data
sources to be invoked (as if they were a table).

Table function execution can be parallelized
giving improved speed and scalability.
(SQL: 2003) MERGE statement

In addition to the three statements for updating the
database, (INSERT, UPDATE, and DELETE) SQL:
2003 adds MERGE.

Combining INSERT and UPDATE into MERGE.

Transferring a set of rows from a “transaction table”
to a “master table” maintained by the database.
(SQL: 2003) Sequence Generators



New kind of database object with an associated
time-varying exact numeric value.
Mechanism for generating unique values
automatically.
User can define minimum value, a maximum value,
a start value, an increment, and a cycle option for
the sequence generator they are creating.
CREATE SEQUENCE PARTSEQ AS INTEGER
START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 10000
NO CYCLE
Conclusion

Reviewed some important developments of SQL.

Specifically, described only some important features of SQL:
1999 and SQL: 2003.

Observed that SQL: 1999 has been a major development
compare to previous versions.

SQL: 2003 is modified-enhanced version of SQL: 1999 and it is
popularly believed to be largely a “bug-fix release” of the SQL
standard.
References





Andrew Eisenberg, Jim Melton, SQL/XML is Making Good Progress,
ACM SIGMOD REC., Volume 31, Issue 2, No. 8, June 2002,
Publisher: ACM Press.
Jim Melton, Andrew Eisenberg, SQL Multimedia and Application
Packages (SQL/MM), ACM SIGMOD Record, Volume 30, Issue 4, No.
6, December 2001, Publisher: ACM Press.
Andrew Eisenberg, Jim Melton, Krishna Kulkarni, Jan-Eike Michels,
Fred Zemke, SQL:2003 Has Been Published, ACM SIGMOD Record,
Volume 33, Issue 1, No.8, March 2004 , Publisher: ACM Press.
Andrew Eisenberg, Jim Melton, Advancements in SQL/XML, ACM
SIGMOD Record, September 2004, Volume 33, Issue 3, No. 8,
Publisher: ACM Press.
Andrew Eisenberg, Jim Melton, SQL: 1999, formerly known as SQL3,
ACM SIGMOD record, March 1999, Volume 28 , Issue 1, No. 8,
Publisher: ACM Press.
Q&A