Test your skills
Hi experts, can anyone please explain what do DDL DML DCL and TCL mean in SQL technology?
Hi Christ Hilyard. Those acronyms are basically classifications of the different commands used in SQL. Here are the meanings of the acronyms that you asked for, together with a short description of each one:
DDL (Data Definition Language) – These are statements used if you want to create the structure of a database using SQL commands. Some of the commands in the DDL are the CREATE command and the TRUNCATE command.
DML (Data Manipulation Language) – This classification contains the most common commands in SQL used if you want to manipulate data inside your database. The most famous SELECT statement and INSERT statement belongs to this classification.
DCL (Data Control Language) – This classification only contains two SQL commands, the GRANT and REVOKE commands. Basically it is just a section where the commands for proper control of access privileges for your databases are classified.
TCL (Transaction Control Language) – These kinds of statements are somewhat dependent of DML statements, in a sense that the statements belonging in TCL are used if certain DML commands are used before them. The COMMIT command for example, is a TCL command because it needs some DML commands to be present and written first before it is activated.
Hope this helps!
SQL statements have divided into four parts. Those are,
DML stands for Data Manipulation Language which is used to insert, delete, modify, update, store and retrieve the data in database.
i.e. - insert into <table name> values <data according to the attribute order>;
DDL stands for Data Definition Language which is used to,
Create a database table
Add new columns and constrains to a created table
Modify existing columns and constrains in a table
Delete columns and constrains in a table
I.e. – create table <table name>(,
<1st attribute name> <data type>,
<2nd attribute name> <data type>,
<3rd attribute name> <data type>);
DCL stands for Data Control Language which is used to
Grant permissions in database
Revoke privileges in database
Manage security in database
i.e. – create user <user name> identified by <password>;
TCL stands for Transaction Control Language which is used to manage the transactions in a database to keep the database in a consistent manner.
i.e. – Commit;