Sobes.tech
Junior — Middle

Can you name the main categories of commands used in SQL for working with a database?

sobes.tech AI

Answer from AI

Main categories of SQL commands for working with a database:

  1. DDL (Data Definition Language) — commands for defining the database structure:

    • CREATE — creating tables, databases, and other objects.
    • ALTER — modifying the structure of existing objects.
    • DROP — deleting objects.
  2. DML (Data Manipulation Language) — commands for working with data:

    • SELECT — data retrieval.
    • INSERT — inserting new records.
    • UPDATE — updating existing records.
    • DELETE — deleting records.
  3. DCL (Data Control Language) — access control commands:

    • GRANT — granting permissions.
    • REVOKE — revoking permissions.
  4. TCL (Transaction Control Language) — transaction management commands:

    • COMMIT — confirming a transaction.
    • ROLLBACK — rolling back a transaction.
    • SAVEPOINT — setting a save point within a transaction.