What is DDL , DML , DCL & TCL

DDL , DML , DCL & TCL are categories of SQL statements also called SQL Languages . They define different areas of SQL which are involved in maintaining database management systems.  Welcome to the SQL Beginners Guide series’ latest article.  We will discuss what is DDL , DML , DCL & TCL and other types and what they do . However , before we move forward. In case you need to check other articles.
Following are the most recent articles

  1. SQL Beginner Guide
  2. MS SQL Installation Step By Step
  3. SQL Select Query
  4. Basic SQL Queries & Commands
DDL , DML , DCL & TCL

Reason for referring you to the previous articles is very simple. This is a series and they are being composed in order . Therefore , this order will help you in developing a better understanding for SQL query development .
SQL commands have following categories
 

Types of SQL Statements/SQL Commands

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

Let’s do it people , time to discuss them .

DML  ( Data Manipulation Language )

Remember , CRUD Operations ? The basic SQL queries we use to work with the data in table . It can be as simple as retrieving information from table  , inserting , deleting or update.
SELECT – Retrieves data from tables
INSERT – Inserts data into tables
UPDATE– Update data in tables.
DELETE – Delete data or objects
Previous article , has these SQL queries for practice. In case , you’re interested.

DDL ( Data Definition Language )

Statements that are used to change the state of database objects such as table , schema etc.
CREATE – Create the database objects
ALTER – Can you guess? Yes , Alter the already defined values. Can be datatypes of columns or names of the objects
DROP -Delete existing object from database
TRUNCATE – Also delete the existing from database but to the point that it cannot be restored because no log maintenance for this operation unlike others.

DCL  ( Data Control Language )

Statements that are use to manage and control the access of users on database objects
GRANT – allow user access to read/write on certain database objects
REVOKE – removes user access from read/write permission on database objects.

TCL ( Transaction Control Language )

SQL Statements that allows you to control and manage transactions to maintain the integrity of data within SQL statements.
BEGIN Transaction – opens a transaction
COMMIT Transaction – commits a transaction
ROLLBACK Transaction – ROLLBACK a transaction in case of any error.


In future , we are planning to write on Concurrency Control where you will see a good use of the TCL Statements. Therefore , my recommendation is to subscribe us and follow us for the latest articles.
if you have any questions , suggestion or feedback please post in the comments. Share us with your friends and fellows. This is what will keep BI Talks BI moving!
Happy Learning!
Cheers!

Leave a Reply