SQL Server Languages: DML, DDL, DCL & TCL

Microsoft SQL Server is a relational database management system (RDBMS) developed by Microsoft.

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.

dml
     SQL Server Languages – DML, DDL, DCL & TCL

Examples: SELECT, UPDATE, INSERT and 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 creating 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 delete 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.

SQL Server Languages – DML, DDL, DCL & TCL

sql
                           SQL Server Languages DML, DDL, DCL and TCL

A heartily welcome to the blog! This is my first post in SQL Server category. Hope you will enjoy reading.
 
Here we conclude our topic. Hope it helped you in knowing different type of language commands in SQL Server.

Up Next
    Ebook Download
    View all
    SQL Jobs
    Read by 0 people
    Download Now!
    Learn
    View all