π Day 3: The Building Blocks of SQL: Exploring Core Command Types

Hello readers ! ππ»
Today, I began exploring the different types of SQL commands by watching a helpful tutorial. What surprised me was learning that SQL has over 12 command types and around 900 keywords, yet in real-world applications, we frequently use only a small portion of them.
In this post, Iβm summarizing what I learned about the five major categories of SQL commands and giving you a quick overview of how theyβre used.
What Are SQL Commands?
SQL commands are instructions used to interact with relational databases. They help us create structures, manipulate data, manage user access, and control transactions.
Major Categories of SQL Commands:
DDL β Data Definition Language
Used to define or modify database structure (schema).
CREATE - creates new tables or databases
DROP - deletes tables or databases
ALTER - modify existing database objects
\=> Think of DDL as the blueprint for your database.
DQL - Data Query Language
Used to retrieve data from a database
- SELECT - retrieve data from tables
DML β Data Manipulation Language
Used to manage data within tables.
INSERT - add new data
UPDATE - modify existing data
DELETE - remove data
\=> DML lets you work with the actual records in the database.
DCL β Data Control Language
Used to control access and permissions in the database.
GRANT - give privileges to users
REVOKE - remove user privileges
\=> DCL is all about managing who can do what.
TCL β Transaction Control Language
Used to manage transactions in a database.
COMMIT - save all changes made in the current transaction
ROLLBACK - undo changes from the current transaction
SAVEPOINT - set a save point within a transaction
SET TRANSACTION - configure transaction behavior
\=> TCL ensures data integrity and safe execution of operations.
Conclusion
Understanding the different types of SQL commands (DDL, DML, DCL, TCL, and DQL) has given me a clearer view of how databases are created, managed, and secured. While SQL may have hundreds of keywords, knowing when and how to use the essential ones is what truly matters. This foundational knowledge is key to writing efficient and reliable queries in real-world applications.
Thanks for following along.
Let me know if you have any tips or resources on SQL. Iβd love to explore more β€οΈ.
Subscribe to my newsletter
Read articles from Jahnavi Sri Kavya Bollimuntha directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
