Tuesday, June 16, 2015

SQL Server - DDL, DML, DQL, DCL and TCL

Today we are going to learn different categories of languages available in SQL:

We have four categories of languages in SQL:

DDL – Data Definition Language:
It is used to modify the structure of the table
      CREATE, ALTER, DROP, TRUNCATE

There are too many posts where we are seeing whether TRUNCATE is DDL/DML command.
Its DDL command because
a. It internally performs DROP and CREATE of the table
b. If you want to TRUNCATE the table you require ALTER permissions not only Write permissions
c. As it is DDL command, it will reset IDENTITY property of the table

DML – Data Manipulation Language:
It is used to manipulate the data available in table
      INSERT, UPDATE, DELETE

DQL – Data Query Language:
It is used to fetch the data from table
     SELECT

DCL – Data Control Language:
It is used to create roles, permissions, and referential integrity and also to control access to database by securing it
     GRANT, REVOKE

TCL – Transaction Control Language:
It is used to control/manage different transactions performed on a table
     COMMIT, ROLLBACK

Labels: , , , , , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home