Lesson-10: What Is SQL?

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Database Management Systems

After going through this unit, you should be able to:

 Create, modify and delete database schema objects;


 Update database using SQL commands;
 Retrieve data from the database through queries and sub-queries;
 Handle join operations;
 Control database access;
 Deal with database objects like Tables, Views, Indexes, Sequences, and Synonyms
using SQL.

Lesson-10
WHAT IS SQL?

Structured Query Language (SQL) is a standard fourth generation query language. It is


commonly used with all relational databases for data definition, manipulation and control
purposes. All the relational systems support SQL, thus allowing migration of database
from one DBMS to another. In fact, this is one of the reasons of the major success of
Relational DBMS. A user may be able to write a program using SQL for an application
that involves data being stored in more than one DBMSs, provided these DBMSs support
standard SQL. This feature is commonly referred to as portability. However, not all the
features of SQL implemented in one RDBMS are available in others because of
customization of SQL.

SQL provides an interface where the user can specify “What” are the expected results.
The query execution plan and optimization is performed by the DBMS. The query plan
and optimization determines how a query needs to be executed.

SQL is called a non-procedural language as it just specifies what is to be done rather


than how it is to be done. Also, since SQL is a higher-level query language, it is closer to
a language like English. Therefore, it is very user friendly. The American National

Dr. Tariq Ahmad Page 3


Database Management Systems

Standard Institute (ANSI) has designed standard versions of SQL. The first standard in
this series was created in 1986. It was called SQL-86 or SQL1. This standard was revised
and enhanced later and SQL-92 or SQL-2 was released. A newer standard of SQL is
SQL3 which is also called SQL- 99. In this unit we will try to cover features from latest
standards. However, some features may be found to be very specific to certain DBMSs.

Following are some of the important features of SQL:

 It is a non procedural language.


 It is an English-like language (High Level/ 4th Generation).
 It can process a single record as well as sets of records at a time.
 It is different from a third generation language (C & C++). All SQL statements
define what is to be done rather than how it is to be done.
 SQL is a data sub-language consisting of three built-in languages: Data definition
language (DDL), Data manipulation language (DML) and Data control language
(DCL).
 It insulates the user from the underlying structure and algorithm.
 SQL has facilities for defining database views, security, integrity constraints,
transaction controls, etc.

There are many variants of SQL, but the standard SQL is the same for any DBMS
environment. The following table shows the differences between SQL and one of its
superset SQL*Plus which is used in Oracle. This will give you an idea of how various
vendors have enhanced SQL to an environment. The non-standard features of SQL are
not portable across databases, therefore, should not be used preferably while writing SQL
queries.

DATA DEFINITION LANGUAGE (DDL)

Dr. Tariq Ahmad Page 4

You might also like