SQL SERVER – What is – DML, DDL, DCL and TCL – Introduction and Examples

DML

DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in database.

Examples: SELECT, UPDATE, INSERT statements

DDL

DDL is abbreviation of Data Definition Language. It is used to create and modify the structure of database objects in database.

Examples: CREATE, ALTER, DROP statements

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

TCL

TCL is abbreviation of Transactional Control Language. It is used to manage different transactions occurring within a database.

Examples: COMMIT, ROLLBACK statements

Reference : Pinal Dave (https://blog.sqlauthority.com)

Database
Previous Post
SQL SERVER – Time Out Due to Executing DELETE on Large RecordSet
Next Post
SQLAuthroity News – Microsoft SQL Server 2000 Assessment Configuration Pack

Related Posts

170 Comments. Leave new

  • @rizal

    Those are clauses, they, by themselves, are not any of the types.

    For example, WHERE is used in SELECT (DML) and CREATE (DDL).

    Reply
  • hiiii,sir
    you have a such a nise knowledge

    Reply
    • DML:- DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in database. Examples: SELECT, UPDATE, INSERT, DELETE, MERGE, CALL, EXPLAIN PLAN, LOCK TABLE statements
      DDL:- DDL is abbreviation of Data Definition Language. It is used to create and modify the structure of database objects in database. Examples: CREATE, ALTER, DROP, TRUNCATE, COMMENT, RENAME statements
      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
      TCL :- TCL is abbreviation of Transactional Control Language. It is used to manage different transactions occurring within a database. Examples: COMMIT, ROLLBACK, SAVEPOINT, SET TRANSACTION statements

      Reply
  • This is very good define for DML,DCL,DDL and TCL

    Reply
  • DDL(Data Defination Language):
    DDL is used to create the structure of the table. DDL commands are CREATE —Used to create any objects(Table,View,Trigger,Stored procedure) in the database. ALTER – Used to modify the objects in the database.DROP –this command used to drop the objects with the structure.TRUNCATE–This command also used to delete the objects. RENAME–used to modify the object name in the data base.

    DML(Data Manipulation Language):
    DDL commands used to create the objects, DML commands used to manipulate the objects. DML commands are INSERT–This command is used to insert the records into table, UPDATE–This command is used to update the record which is already exisiting in the table, DELETE– This command is used to delete the record which is already existing the table. It is deletes only records not the structure.

    DRL(Data Retrivel Language):
    DRL Command used to retrive the datafrom the database.
    SELECT command used to retrive the data.

    DCL(Data contole Language):
    DCL commands used to security purpose.
    GRANT–this command used to give the pemissons to the paricular Data.
    REVOKE–This command used to release the permissions, which already given to any user.

    Reply
  • can we perform dml operation (update,delete,—-) in views?

    Reply
  • Hi Bhanu,

    View is just presentation of data stored in Tables.

    You can only use SELECT in view.

    Thanks,

    Tejas
    SQLYoga.com

    Reply
  • hi ,
    am a learner want to ask is there chance to update the number of rows by using update statement in single attempt ? pls give a solution for this question,…..

    Reply
    • Can you give us more informations on what you want to update?

      Try

      update table
      set
      col=some_values,
      .
      .
      where some_condition

      Reply
  • hi,
    i mean if we want to update column1 and column2,column3 data,all this three columns we want to update in diffirent data variations how can we get this in a single attempt with using update statement it is possible? waiting for ans

    Reply
  • I am not satisfied for this answer. Please briefly describe about this.

    Reply
  • Larry Leonard
    April 22, 2010 1:06 am

    I’m being told that “SELECT INTO” is DDL, not DML. Is this true? If so, why – because it creates a table? Thanks.

    Reply
    • Deepak kumar Dubey
      February 9, 2014 1:12 pm

      U can use subquery here.

      Deepak Dube

      It is true because for insert we use this and insert may contain in DML.

      Reply
  • hello frnd,s
    i want to ask how i can use ddl & dml commands in dbase 6.0.

    Reply
  • John MacIntyre
    May 1, 2010 2:06 am

    Thanks for the no-fluff answer to my “What the heck is DCL?” question.

    Reply
  • I need example these are commands.can you give me some example

    Reply
  • what is the meaning of MSC DCL in bank statement?

    Reply
  • select is a DDL or DRL??????????????

    Reply
  • Hi Dave,

    I am new to MSSQL SERVER.
    I worked with Oracle Server previously.
    I appreciate u for ur kind help in advanced…

    Reply
  • DR : Select.
    DML : Insert, Update, Delete, Merge.
    DDL : Create, Alter, Drop, Rename, Truncate.
    TC : Commit, Rollback, Savepoint.
    DCL : Grant, Revoke.

    Reply
  • why we say SELECT as ddl statement?

    Reply
  • hi
    i want some practicakl exmaple of sql server’s commands..
    i hope u’ll show me this..
    thanks

    prishu

    Reply
  • what about dropping a stored procedure.
    Is it a DDL or DML Script??

    Reply

Leave a Reply