Page 45 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 45
Database Management Systems/Managing Database
Notes Introduction
SQL stands for Structured Query Language (SQL). It is the most widely used commercial relational
database language. SQL has clearly established itself as the standard relational-database
languages. There are numerous versions of SQL. The original SQL. Version was developed at
IBM’s San Jose Research Laboratory (now the Almaden Research Centre). This language, was
originally called as Sequel, was used as part of System R Project in early 1970s. The Sequel
language has evolved since then, and its name has changed to SQL (Structured Query Language).
SQL uses a combination of relational algebra and relational calculus. Although SQL language is
referred as ‘Query language’, it contains many other capabilities besides querying a data-base.
Within the DBMS, SQL will be used to create the tables, translate user requests, maintain the data
dictionary, maintain the system catalog, update and maintain the tables, establish security, and
carry out backup and recovery procedures.
3.1 Structured Query Language (SQL)
SQL (pronounced “ess-que-el”) stands for Structured Query Language. SQL is used to
communicate with a database. According to ANSI (American National Standards Institute), it is
the standard language for relational database management systems. SQL statements are used to
perform tasks such as update data on a database, or retrieve data from a database. Some common
relational database management systems that use SQL are: Oracle, Sybase, Microsoft SQL Server,
Access, Ingres, etc. Although most database systems use SQL, most of them also have their own
additional proprietary extensions that are usually only used on their system. However, the
standard SQL commands such as “Select”, “Insert”, “Update”, “Delete”, “Create”, and “Drop”
can be used to accomplish almost everything that one needs to do with a database.
The SQL language has several parts:
1. Data-definition language (DDL): The SQL DDL provides commands for defining relation
schemas, deleting relations, and modifying relation schemas.
2. Interactive data-manipulation language (DML): The SQL DML includes a query language
based on both the relational algebra and the tuple relational calculus. It includes also
commands to insert tuples into, delete tuples from, and modify tuples in the database.
3. View definition: The SQL DOL includes commands for defining views.
4. Transaction control: SQL includes commands for specifying the beginning and ending of
transactions.
5. Embedded SQL and dynamic SQL: Embedded and dynamic SQL define how SQL statements
can be embedded within general-purpose programming languages, such as C, C++, Java,
PUr, Cobol, Pascal, and Fortran.
6. Integrity: The SQL DDL includes commands for specifying integrity constraints that the
data stored in the database must satisfy. Updates that violate integrity constraints are
disallowed.
7. Authorization: The SQL DDL includes commands for specifying access rights to relations
and views.
3.2 Data Definition
Data definition in SQL is via the create statement. The statement can be used to create a table,
index, or view (i.e., a virtual table based on existing tables). To create a table, the create statement
38 LOVELY PROFESSIONAL UNIVERSITY