SQL Commands Explained: Fast Revision Notes for IBPS SO IT Officer
SQL (Structured Query Language) is the standard language used to interact with relational databases. Almost every competitive exam covering DBMS asks questions on SQL command categories, their purpose, and common differences.
This article provides a quick revision of all five SQL command categories with syntax, examples, and exam-focused tips.
This is a Fast Revision guide. If you're preparing one or two days before the exam, focus on the revision tables, examples, and comparison sections.
Why Should You Learn SQL Commands?
SQL commands allow you to:
- Create databases and tables
- Insert and modify records
- Retrieve information
- Manage transactions
- Control user permissions
Questions on SQL command categories are among the easiest marks in the IBPS SO Professional Knowledge section.
SQL Commands at a Glance
| Category | Full Form | Purpose |
|---|---|---|
| DDL | Data Definition Language | Defines database objects |
| DML | Data Manipulation Language | Inserts, updates, and deletes data |
| DQL | Data Query Language | Retrieves data |
| DCL | Data Control Language | Manages user permissions |
| TCL | Transaction Control Language | Manages transactions |

1. DDL (Data Definition Language)
DDL commands define or modify the structure of database objects.
Common Commands
| Command | Purpose |
|---|---|
| CREATE | Creates a database or table |
| ALTER | Modifies an existing table |
| DROP | Deletes a database object |
| TRUNCATE | Removes all rows while keeping the table |
| RENAME | Renames a database object |
Example
CREATE TABLE Student (
StudentID INT PRIMARY KEY,
Name VARCHAR(50)
);
Important Points
- Changes the database structure.
- Usually performs an implicit COMMIT.
- Cannot usually be rolled back.
2. DML (Data Manipulation Language)
DML commands manipulate the records stored inside tables.
Common Commands
| Command | Purpose |
|---|---|
| INSERT | Adds new records |
| UPDATE | Modifies existing records |
| DELETE | Removes selected records |
Example
INSERT INTO Student
VALUES (101, 'Rahul');
UPDATE Student
SET Name = 'Aman'
WHERE StudentID = 101;
DELETE FROM Student
WHERE StudentID = 101;
3. DQL (Data Query Language)
DQL retrieves data from one or more tables.
Main Command
| Command | Purpose |
|---|---|
| SELECT | Retrieves records |
Example
SELECT Name, Department
FROM Student
WHERE Department = 'IT';
Frequently used clauses include:
- WHERE
- ORDER BY
- GROUP BY
- HAVING
- DISTINCT
- LIMIT
4. DCL (Data Control Language)
DCL controls database access and permissions.
Commands
| Command | Purpose |
|---|---|
| GRANT | Gives permissions |
| REVOKE | Removes permissions |
Example
GRANT SELECT
ON Student
TO user1;
5. TCL (Transaction Control Language)
TCL manages database transactions.
Commands
| Command | Purpose |
|---|---|
| COMMIT | Saves changes permanently |
| ROLLBACK | Undoes changes |
| SAVEPOINT | Creates a rollback point |
Example
UPDATE Account
SET Balance = Balance - 1000
WHERE AccountID = 101;
ROLLBACK;
SQL Command Classification Cheat Sheet
| Category | Commands |
|---|---|
| DDL | CREATE, ALTER, DROP, TRUNCATE, RENAME |
| DML | INSERT, UPDATE, DELETE |
| DQL | SELECT |
| DCL | GRANT, REVOKE |
| TCL | COMMIT, ROLLBACK, SAVEPOINT |
DELETE vs TRUNCATE vs DROP
| Feature | DELETE | TRUNCATE | DROP |
|---|---|---|---|
| Removes Data | ✅ | ✅ | ✅ |
| Removes Table | ❌ | ❌ | ✅ |
| WHERE Clause | ✅ | ❌ | ❌ |
| Rollback Possible | Usually Yes | Usually No | No |
| Command Type | DML | DDL | DDL |
A favourite exam question is identifying the correct category of TRUNCATE. Remember: TRUNCATE is a DDL command, not DML.
Memory Trick
Remember the order:
DDL → DML → DQL → DCL → TCL
A simple mnemonic is:
"Define → Modify → Query → Control → Transaction"
Exam Tips
- Know the classification of every SQL command.
- Remember that SELECT belongs to DQL.
- Learn the difference between DELETE, TRUNCATE, and DROP.
- Revise transaction commands before studying ACID properties.
Related Topics
- SQL Constraints
- SQL Keys
- SQL Joins
- Aggregate Functions
- Transactions
- ACID Properties
Take this free mock test to test your understanding of the SQL commands and get mastery over them.
Test Your DBMS Fundamentals
Attempt a topic-wise mock test covering SQL commands, keys, constraints, and relational databases.
