DDL, DQL, DML, DCL and TCL Commands in MYSQL

SQL is used to perform various amount of operation in a database, from creating a table to including details in that table, from inserting columns to deleting the tables and many more. These commands in the SQL has been categorized mainly in four categories - DDL, DQL, DML, DCL.


DDL

DDL stands for Data Definition Language. This command is used to define the infrastructure of the database or say database schema. With the help of these commands we can create and modify the infrastructure of the database. 

Commands in DDL - 

  • CREATE - Is used to create the database, tables, views, index, function, store procedure and triggers
  • DROP - Is used to delete both the infrastructure and data
  • ALTER - Is used to alter the structure of the database
  • TRUNCATE - Is used to remove all the records from a table, including all spaces allocated for the records are removed.
  • COMMENT - Is used to add comments in the data dictionary
  • RENAME - Is used to rename the objects(tables, views, index, function, store procedure and trigger) existing in the database

DQL
DQL stands for Data Query Language. This command is used to take the query entered and find the information accordingly and return the query with appropriate result as in table form (2-D array).

Commands in DQL -
  • SELECT - Is used to retrieve the data from the database

DML
DML stands for Data Manipulation Language. This command is used to manipulate or change the data inside a table by inserting or updating or deleting the data inside the database.

Commands in DML -
  • INSERT - Is used to insert the data in the table
  • UPDATE - Is used to update the pre-existing data in the table
  • DELETE - Is used to delete the data from in the table

DCL
DCL stands for Data Control Language. This command is used to control the permissions and rights of a database system.

Commands in DCL -
  • GRANT - Is used to give privileges to the users in the database
  • REVOKE - Is used to take back the privileges from the user given by the GRANT command in the database

TCL
TCL stands for Transaction Control Language. This is also one type of Structured Query Language. This command is used to deal with the transaction within the database. 

Commands in TCL -
  • COMMIT - Is used to commit a transaction
  • ROLLBACK - Is used to rollback the transaction if any error happens
  • SAVEPOINT - Is used to create a savepoint, so that if anything happens our data till the savepoint will be saved
  • SET TRANSACTION - Is used to specify the characteristics of the transaction


For giving some suggestion please comment us or check our "Contact us" page. Also more update related to coding will be added in this Blog later on, so please get attached with this Blog by clicking the follow button. Thank you for your support and time...

Post a Comment

1 Comments