Introduction
If you're just starting, don’t worry. In this blog, I’ll walk you through the core SQL commands that every beginner should be familiar with. Whether you are building a simple app or just exploring SQL Server for the first time, these commands will give you a strong foundation.
What is SQL?
SQL stands for Structured Query Language. It is a programming language for storing and processing information in a relational database.
With SQL, you can,
- Create and manage databases
- Add and retrieve data
- Update or delete records
- Control access to data
SQL Commands
1. DDL ( Data Definition Language )
What it does: DDL commands define and modify the structure of database objects like tables, schemas, or databases.
Common DDL Commands
- CREATE
- ALTER
- DROP
- TRUNCATE
Example
![Database]()
Note. DDL commands are auto-committed — once executed, you cannot roll them back.
2. DML – Data Manipulation Language
What it does: DML commands let you insert, update, or delete actual data inside your tables.
Common DML Commands
Example
![Data Manipulation]()
Note. Use WHERE carefully, forgetting that it can update or delete every row in the table.
3. DQL – Data Query Language
What it does: DQL is all about retrieving data from the database using queries.
Main DQL Command
SELECT
Example
![Data Query]()
This is the most-used category for anyone working with reports, dashboards, or APIs.
4. TCL – Transaction Control Language
What it does: TCL commands help manage transactions in SQL. These are useful when you want to ensure multiple operations succeed or fail together.
Common TCL Commands
- BEGIN TRANSACTION
- COMMIT
- ROLLBACK
- SAVEPOINT (optional/advanced)
Example
![Transaction Control]()
Best used when making multiple changes that must all succeed or fail together.
5. DCL – Data Control Language
What it does: DCL commands are about access control and permissions in the database.
Common DCL Commands
Example
![Data Control]()
Useful for managing users in production environments where security matters.
Conclusion
Understanding SQL command categories like DDL, DML, DQL, TCL, and DCL makes it much easier to work with databases. Whether you're creating tables, inserting data, running queries, or managing transactions, knowing which command to use and helps you write better and safer SQL.