SQL DCL, DQL & TCL: Permissions, Queries, and Transactions Explained

So far you might know about DDL (structure) and DML (data). There are a few more groups of SQL commands that complete the big picture: DCL, DQL, and TCL.

1. DCL - Data Control Language (Permissions)

DCL is about who is allowed to see or change data. Two common commands are GRANT and REVOKE.

-- Give a user permission to read from a table
GRANT SELECT ON customers TO analyst_user;

-- Remove that permission
REVOKE SELECT ON customers FROM analyst_user;

In many organisations you won’t run these yourself, but they explain why some queries fail with 'permission denied'.

2. DQL - Data Query Language (Asking Questions)

Some people treat SELECT and its related clauses as a separate group called DQL: Data Query Language.

DQL includes SELECT with WHERE, GROUP BY, HAVING, ORDER BY, and LIMIT. As a data analyst, most of your day is effectively DQL: you’re not changing the data, you’re questioning it.

3. TCL - Transaction Control Language (All-or-Nothing Changes)

When multiple changes need to succeed or fail together, databases use transactions. TCL controls them with commands like COMMIT and ROLLBACK.

BEGIN;  -- start a transaction
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT;  -- save both updates together

If something goes wrong in the middle, you can ROLLBACK instead of COMMIT to undo the changes. This protects data consistency.

4. Why These Categories Matter for Analysts

  • DCL explains why access is restricted and why roles matter.
  • DQL reminds you that good analysis is about asking clear questions in SQL.
  • TCL shows you that serious systems treat multi-step updates as all-or-nothing operations to avoid partial mess.

You don’t need to memorise every term to be a strong analyst, but knowing the categories helps SQL feel organised. It also helps you have more confident conversations with data engineers, DBAs, and senior analysts.

Try it yourself

Start with Level 1: SELECT, in your browser.

The first 5 levels are free · no sign-up needed