What are the different types of SQL commands ?

  • DDL (Data Definition Language)
  • DML (Data Manipulation Language)
  • DCL (Data Control Language)
  • TCL (Transaction Control Language)

DDL(Data Definition Language)

  • DDL is a syntax that is used for creating SQL commands. It is called as DDL becuase it defines the syntax for creating a data base.
  • DDL is part of SQL which defines the data structure of the database at the initial stage when creating a database  and is also used for creating and modification of the structure of the database.

Commands in DDL are

  • Create table: This command is used to create a table in a database or its objects (like table, index, function, views, store procedure, and triggers).
  • Alter table: This is used to alter the structure of the database.
  • Drop table: This command is used to delete objects from the database.

Data Manipulation Language

  • DML uses the existing data base for manipulation of data.
  • It helps users to retreive the data and perform manipulation on the data like inserting data, updating data, and deleting data using the following data manipulation commands like insert, update and delete.

Data Control Language

  • As the name suggests data control language provides control for accessing the data in the database.
  • These commands are usually used for providing previlages and controls to users who likes to access the database.
  • Commands used in DCL for control and user previlages are Grant and Revoke.

Transaction Control Language

  • TCL command statements are used to control changes made by the DML commands.
  • It also authorizes the statements to assemble in conjunction into logical transactions.
  • The commands that are used in TCL are Commit, Rollback, Savepoint, Begin, and Transaction.

Leave a Reply

Your email address will not be published.

You May Also Like