Checking your session…
Module 05: SQL Command Classifications

5.1 Overview of SQL Command Types

Level: 5 | Version: v1.1 | Author: Meptrasoft

Overview

SQL commands are used to work with databases in different ways. For easier learning, they are commonly grouped into five categories:

Category Full Form Purpose Main Commands
DDL Data Definition Language Manage database structure CREATE, ALTER, DROP, TRUNCATE
DML Data Manipulation Language Change data INSERT, UPDATE, DELETE
DQL Data Query Language Retrieve data SELECT
DCL Data Control Language Manage permissions GRANT, REVOKE
TCL Transaction Control Language Manage transactions COMMIT, ROLLBACK, SAVEPOINT

Think of it as:
DDL → Structure
DML → Data
DQL → Retrieve
DCL → Access
TCL → Transactions

SQL Command Types: DDL (Structure), DML (Data), DQL (Retrieve), DCL (Access), TCL (Transactions)
Figure 1: SQL commands are commonly grouped into five categories based on their purpose.

Quick Comparison

TEXT
DDL → Defines database structure
DML → Changes stored data
DQL → Retrieves data
DCL → Controls access
TCL → Controls transactions

The next topics explain each category separately in detail.


Placement Quick Points

  • DDL → Structure
  • DML → Data
  • DQL → Retrieval
  • DCL → Permissions
  • TCL → Transactions

Interview Questions

What are the commonly taught SQL command categories?

DDL, DML, DQL, DCL, and TCL.

What is DDL used for?

Managing database structure.

What is DML used for?

Changing data stored in tables.

What is DQL used for?

Retrieving data, mainly using SELECT.

What is DCL used for?

Managing database permissions and access.

What is TCL used for?

Managing transactions.


Practice & Hands-On Exercises

Classify the following commands into DDL / DML / DQL / DCL / TCL:

  1. CREATE
  2. INSERT
  3. SELECT
  4. UPDATE
  5. GRANT
  6. COMMIT
  7. DROP
  8. DELETE
  9. ROLLBACK

💡 Tip: Test your queries using the in-browser interactive runner above.


Key Takeaway

TEXT
DDL → STRUCTURE
DML → DATA
DQL → RETRIEVE
DCL → ACCESS
TCL → TRANSACTION

SQL commands are commonly grouped according to what they do with the database.

End of Overview of SQL Command Types