Class 12 |MySQL 17

DDL commands

DDL commands help to create the structure, modify the structure of an existing table, or permanently delete the structure of the table from the database.
DDL commands are all auto commit commands.

• Create table
• Alter table
• Drop table
• Truncate table.

Truncate table:
This command helps us to delete all the records permanently from the specified table. The structure of the table remains intact. Cannot be rolled back.

Syntax:
Truncate table tablename;

Example:

Truncate table std;

[ or
Delete from std;
Commit; ]

DML commands (Data Manupulation Langauge)

DML commands help us to query the table, insert new data , modify the existing data and if required delete the existing data from the table.

Commands

* Insert into
* Delete
* Update

DQL command: (Data Query Language)
helps us to query the table.

Command
Select

TCL: (Transaction Control Language)
helps us to make the changes permanent or undo the changes.

Commands

* Commit
* Rollback

DCL: (data Control Language)
Helps us to give permissions of an object to other users.

Commands

* Grant
* Revoke