Java Reference
In-Depth Information
 
Data-security constraints
The standard implementation of these rules is the Structured Query Language (SQL).
Structured Query Language
The Structured Query Language (SQL) was first developed by IB M in the 1970s and
was later the subject of several ANSI standards. As a result of the way that the
requirements for a high-level database language are defined, SQL is usually
considered to be composed of a number of sublanguages. These sublanguages are
as follows:
 
Data Definition Language (DDL) is used to create, alter, and drop tables and indexes.
 
Data Manipulation Language (DML) is used to insert, update, and delete data.
 
Data Query Language (DQL) is used to query the database using the SELECT command.
 
Transaction Control Commands are used to start, commit, or rollback transactions.
 
Data Control Language (DCL) is used to grant and revoke user privileges and to change
passwords.
Despite the conventional division of SQL into a number of sublanguages, statements
from any of these constituent sublanguages can be used together. The convention is
really just a reflection of the way Codd's rules define the requirement for a high level
language, with sublanguages for different functions.
The next three sections provide a brief outline of the sublanguages used to perform
the basic database functions of creating databases and tables, populating the tables
with data, and retrieving the data. These functions are performed by the DDL, the
DML, and the DQL sublanguages.
Data Definition Language
Data definition operations are handled by SQL's Data Definition Language, which is
used to create and modify a database. The SQL2 standard refers to DDL statements
as "SQL Schema Statements." The SQL standard defines a Schema as a high level
abstraction of a container object which contains other database objects.
A good example of the use of the DDL is the creation of a table. When a table is
created, various parameters are set for each column. These include the following:
 
Data types. These include CHARACTER,INTEGER, FLOAT, and so on.
 
Data constraints . These include such restrictions as whether NULLS are permitted.
 
Default values. Default values can be assigned for each column.
The basic form of the CREATE TABLE command is:
Search WWH ::




Custom Search