Types of SQL Statements - Karan Rajpoot

                                                          Types of SQL Statements

The SQL statement can be categorized into the following four ways: -

1)  DDL ( Data Definition Language)

2) DML ( Data Manipulation language)

3) DCL ( Data Control Language)

4) TCL ( Transaction Control Language) 

Now we will understand each of the above statements with examples: -


1) DDL ( Data Definition Language): - 

The DDL statement provides commands for defining relation schemas, that is for creating tables, indexes, sequences and so on and also commands for dropping, altering renaming objects.

a) CREATE: - It is used to create objects in the database.

Example: -


Object Creation
Object Creation
b) ALTER: - It is used to alter the structure of the database.

Example: -


alter the structure of database
Alter the structure of the database
c) RENAME: - To rename an object.

Example: -


Rename object of the database
Rename of a tablespace


d) DROP: - This command is used to delete the objects from the database.

Example: -


drop object from the database
Drop object from the database

2) DML (Data Manipulation Language): -

The DML statements are used to alter or modification of the database. The databases are managed with the help of below statements. 

a) SELECT: - It is used to retrieve the data from the database.

Example: -


Retrieve the data from the database
Retrieve the data from the database
b) INSERT: - This command is used to insert the data into a table.

Example: -


Insert data into a table
Insert data into a table
c) UPDATE: - This command is used to update the existing records within the table.

Example: -


Update the existing record
Updated the existing record

3) DCL (Data Control language): -

The DCL statements are used to Grant the permission from the user or to revoke the already given permission from the user.

a) GRANT: - This command is used to give the permission of the user.

Example: -

Grant Permission
Grant Permission
b) Revoke: - This command is used to revoke the already given permission from the user.

Example: -

Revoke Permission
Revoke Permission

4) TCL (Transaction Control Language): -

The TCL statement is used to commit the transaction after work done and restore the database to its original stage since the last commit.


a) COMMIT: - 



Commit the transaction
Commit the transaction
b) ROLLBACK: -


Rollback the transaction
Rollback the transaction
Thank You!!


Popular posts from this blog

How to resolve "No protocol specified" error

How to resolve "TNS-12541 : TNS : no listener" error

Oracle "Redo log Groups addition/deletion" | Karan Rajpoot