Repaso
EspaƱol

What are the main groups of SQL commands?

Options

  1. DDL, DML, DQL, DCL, TCL: structure, data, queries, rights, transactions (Correct option)
  2. Only SELECT and INSERT, because all the others are variations
  3. HTML, CSS and JS commands, which are used in web pages
  4. Frontend and backend commands, used by different developers

Answer

DDL (define structure: CREATE, ALTER, DROP), DML (change data: INSERT, UPDATE, DELETE), DQL (query: SELECT), DCL (permissions: GRANT, REVOKE), TCL (transactions: COMMIT, ROLLBACK)

Why

SQL commands are grouped by purpose:

  • DDL (Data Definition Language): create or change the structure: CREATE TABLE, ALTER TABLE, DROP TABLE.
  • DML (Data Manipulation): change data: INSERT, UPDATE, DELETE.
  • DQL (Data Query): read data: SELECT.
  • DCL (Data Control): permissions: GRANT, REVOKE.
  • TCL (Transaction Control): BEGIN, COMMIT, ROLLBACK.

Remember

DDL structure, DML change data, DQL read, DCL permissions, TCL transactions.

Key terms

Practice this question in Repaso