Types of SQL Statements

By | July 2, 2015

SQL is a special purpose programming language designed for managing data held in a Relational Database Management System (RDBMS). SQL statement includes data insert, query, update and delete, schema creation and modification and data access control. Based upon that SQL statements are divided into different categories as described below:

SQL Statements

Data Manipulation Language (DML)
SELECT Retrieve certain record from one or more tables or views.
INSERT Create new record into the table.
UPDATE Modify existing record(s).
DELETE Delete existing record(s).
MERGE Conditionally insert or update data depending on its presence, also known as “UPSERT”.
 Data Definition Language (DDL)
CREATE Create New Objects in Database like Table, View Index, Sequence etc.
ALTER Modify the existing object.
DROP Destroying an existing object.
RENAME Change the name of existing object.
TRUNCATE Deleting an existing object. ( Drop and Re-Create)
COMMENT Provides Single line or multi-line comment(s).
 Data Control Language (DCL)
GRANT Gives different Privileges to the user.
REVOKE Tack back privileges which is previously granted from user.
 Transaction Control Language (TCL)
COMMITE Make permanent all changes performed in the transaction.
ROLLBACK Undo all uncommitted works done by the transaction(s).
SAVEPOINT Identify a point in a transaction to which you can later roll back.

Leave a Reply

Your email address will not be published. Required fields are marked *