0% found this document useful (0 votes)
5 views

SQL Components

Uploaded by

sanikabhandare23
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

SQL Components

Uploaded by

sanikabhandare23
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

FirstBit Solutions

SQL Components
Topics Covered
• What is SQL?
• Components of SQL
• Data Definition Language
• Data Manipulation Language
• Data Control Language
• Transaction Control Language
• Data Query Language
What is SQL?
• SQL stands for Structured Query Language

• SQL lets you access and manipulate databases

• SQL became a standard of the American National Standards


Institute (ANSI) in 1986, and of the International Organization for
Standardization (ISO) in 1987
What Can SQL do?
• SQL can execute queries against a database,SQL can retrieve
data from a database
• SQL can insert records in a database, SQL can update records in
a database
• SQL can delete records from a database, SQL can create new
databases
• SQL can create new tables in a database
• SQL can create stored procedures in a database
• SQL can create views in a database
• SQL can set permissions on tables, procedures, and views
SQL is a Standard - BUT....
• Although SQL is an ANSI/ISO standard, there are different
versions of the SQL language.
• However, to be compliant with the ANSI standard, they all support
at least the major commands (such as SELECT, UPDATE,
DELETE, INSERT, WHERE) in a similar manner.
Components of SQL
• SQL commands are divided into five categories:
Data Definition Language
• The Data Definition Language (DDL) consist of SQL statements
used to define the database structure or schema. It simply deals
with descriptions of the database schema and is used to create
and modify the structure of database objects in databases.
• The DDL provides a set of definitions to specify the storage
structure and access methods used by the database system.
Data Definition Language
• A DDL performs the following functions :
– It should identify the type of data division such as data item, segment,
record and database file.
– It gives a unique name to each data item type, record type, file type and
data.
– It should specify the proper data type.
– It should define the size of the data item.
– It may define the range of values that a data item may use.
– It may specify privacy locks for preventing unauthorized data entry.
Data Definition Language
• SQL commands which comes under Data Definition Language
are:
Data Manipulation Language
• A Data Manipulation Language (DML) is a computer programming
language used for adding (inserting), removing (deleting), and
modifying (updating) data in a database. In SQL, the data
manipulation language comprises the SQL-data change
statements, which modify stored data but not the schema of the
database table.
• After the database schema has been specified and the database
has been created, the data can be manipulated using a set of
procedures which are expressed by DML.
Data Manipulation Language
• Insertion of new information into the database
• Retrieval of information stored in a database.
• Deletion of information from the database.
• Modification of data stored in the database
Data Control Language
• A Data Control Language (DCL) is a programming language used
to control the access of data stored in a database.
• It is used for controlling privileges in the database (Authorization).
• The privileges are required for performing all the database
operations such as creating sequences, views of tables etc.
• SQL commands which come under Data Control Language are:
– Grant : Grants permission to one or more users to perform specific tasks.
– Revoke : Withdraws the access permission given by the GRANT
statement
Transaction Control Language
• Transactional control language (TCL) commands are used to
manage transactions in the database. These are used to manage
the changes made to the data in a table by DML statements.
• SQL command which come under Transfer Control Language are:
– Commit : Saves any transaction into the database permanently.
– Roll back : Restores the database to last commit state.
– Save point : Temporarily save a transaction so that you can rollback.
Data Query Language
• The Data Query Language consist of commands used to query or
retrieve data from a database. One such SQL command in Data
Query Language is
– Select : It displays the records from the table.
Summery
• DDL is used to create and modify the structure of database
components
• DML is used to add, edit or remove data from database.
• DCL is used to control access to database.
• Transaction control language is used to manage the transaction in
database.
• DQL is fetch data from database.

You might also like