There are mainly 4
types of language statements or commands in SQL Server.
DML
DML is abbreviation of Data
Manipulation Language. It is used to retrieve, modify, add, and delete data
in database.
Examples: SELECT,
UPDATE, INSERT, DELETE statements
1.
SELECT – used for retrieving data from the
database.
2.
UPDATE – used for modifying the data in the
database.
3.
INSERT – used for adding or inserting new data
into database.
4.
DELETE – used for deleting the already existing
data from database.
DDL
DDL is abbreviation of Data
Definition Language. It is used to create, modify and destroy the structure
of database objects in database.
Examples: CREATE,
ALTER, DROP, TRUNCATE statements
1.
CREATE – used for create database objects like
tables, stored procedures, functions etc.
2.
ALTER – used for modifying the existing
database objects like tables, stored procedures, functions etc.
3.
DROP – used to drop or deleted the existing
database objects.
4.
TRUNCATE – used to delete all the
records from table and to reset identity of column to
initial value.
DCL
DCL is abbreviation of Data
Control Language. It is used to create roles, permissions, and referential
integrity as well it is used to control access to database by securing it.
Examples: GRANT,
REVOKE statements
1.
GRANT – used for creating access
permissions for users to database.
2.
REVOKE – used for revoking the already assigned
permissions.
TCL
TCL is abbreviation of Transactional
Control Language. It is used to manage different transactions occurring
within a database.
Examples: COMMIT,
ROLLBACK, SAVE TRANSACTION statements
1.
COMMIT – used for saving the work done in a
particular transaction. For example: “Ctrl + S” in word file.
2.
ROLLBACK – used for reverting the transaction to
the original state before commit. For example: “Ctrl + Z” in word file.
3.
SAVE
TRANSACTION – used
for setting save point in transactions.