You are on page 1of 2

STRUCTURED QUERY LANGUAGE

SQL is a standard that every database should follow. That means all the SQL
commands should work in all databases. Based on the type of operations we are performing
on the database, SQL is divided into the following types:

 Data Definition Language (DDL)


 Data Manipulation Language (DML)
 Transaction Control Language (TCL)
 Data Control Language (DCL)

Data Definition Language:


It is used to create an object (e.g. table), alter the structure of an object and also to
delete the object from the server. All these commands will effect only the structure of the
database object. The commands contained by this language are:
 CREATE - used to create an object
 ALTER - used to modify an existing object
 DROP - used to delete the object
 TRUNCATE - used to delete only the data of an object

Note: DDL commands are AUTO COMMIT. i.e., with the execution of these commands, the
results will be stored directly into the database.

Data Manipulation Language:


The DML commands are most frequently used SQL commands. They are used to
query and manipulate existing objects like tables. They should affect only the data of an
existing structure. The commands existing in this language are:
 SELECT - used to query the object data
 INSERT - used to enter the data into the object
 UPDATE - used to modify existing objects data
 DELETE - used to delete the data of an object.

Transaction Control Language:

A transaction is a logical unit of work. All changes made to the database can be
referred to as a transaction.
Whenever, we perform a DML operation, results will be stored in the buffer not in the
database. The user can control Transaction changes with the use of this language
commands. They are:
 COMMIT - used to make the changes permanent
 ROLLBACK - used to undo the changes

Database Buffer

Commit
Commit

Query Editor

DDL

DML
L

Data Control Language:


In general to access an object which was created by another user, at first, we must
get the permission from the owner of the object. To provide the permission or remove the
permission, we use this language commands. They are:
 GRANT - Used to provide Permission
 REVOKE - Used to remove the Permission

You might also like