Mysql Database

1. What are the differences between DDL, DML, DCL and TCL in Mysql ?

DDL(Data Definition Language) : 
DDL statements are used to create and modify the structure of tables
  • CREATE : To create new table into database.
  • ALTER :   ALTER TABLE is used to add, delete/drop or modify columns in the existing table.
  • DROP :    This command removes a table from the database
  • TRUNCATE : This will drop and recreate table and reset AUTO_INCREMENT
  • COMMENT :  Add comments to the data dictionary
  • RENAME : RENAME TABLE command will rename the table atomically, which means your table will be locked during the command.
DML(Data Manipulation Language) : 
Used to retrieve and manipulate data in a relational database.

DCL(Data Control Language) : 
DCL is about security. Used to controls of the database system. like rights, permissions. 
DCL statement allow you to control who has access to specific object in your database
  • GRANT : It provides the  user's access privileges to the database.
  • REVOKE : This command removes user access rights or privileges to the database objects
TCL(transaction Control Language) :
This is used for transaction within the database.
Note:- DELETE operations can be rolled back (undone), but DROP and TRUNCATE operations cannot be rolled back.

2. How to backup a MySQL database ?

Related Tutorials

No comments:

Post a Comment