DDL, DML, DCL, TCL and DESC MCQs: 12 Solved SQL Questions with Explanations

Solve 12 SQL command MCQs on schema changes, rows, privileges, transactions and table inspection. Each answer explains the decisive clue and every distractor.

KnowledgeGate Team

Exam prep & CS education

3 Sep 20268 min read

It is easy to memorise five SQL labels. The confusion begins when exam options mix changes to structures, rows, privileges, transaction state and table inspection. CREATE and ALTER change definitions, INSERT and UPDATE change rows, GRANT and REVOKE change access, COMMIT and ROLLBACK change transaction state, and DESC changes nothing at all because it only reports. Attempt each question before reading its explanation.

First build a command-family decision map

Use this map to connect each command with the layer it affects, a useful habit across core CS fundamentals.

Family/tool

Acts on

Representative commands

Fast clue

DDL

Schema objects

CREATE, ALTER, DROP, commonly TRUNCATE

Defines or changes structure

DML

Rows

INSERT, UPDATE, DELETE; SELECT may be separate DQL

Changes table data

DCL

Permissions

GRANT, REVOKE

Gives or removes access

TCL

Transaction state

COMMIT, ROLLBACK, SAVEPOINT

Ends, reverses or marks work

DESC/DESCRIBE

Table structure

DESC MANAGER;

Inspects fields and datatypes

Ask, in order: structure, rows, privileges, transaction boundary, or inspection? Also, DESC MANAGER; has nothing to do with ORDER BY salary DESC.

DDL MCQs: CREATE, ALTER, DROP and TRUNCATE

Start with Student(roll_no INT PRIMARY KEY, name VARCHAR(40)), then follow what happens to its definition and rows.

Question 1: purpose of CREATE

Which of the following best describes the purpose of the CREATE statement in the Data Definition Language (DDL) subset of SQL?

  • A. It retrieves data from one or more database tables.

  • B. It defines a new structure, such as a table or a view, in the database.

  • C. It modifies the contents of an existing table.

  • D. It removes specific records based on a given condition.

Correct option: B. It defines a new structure, such as a table or a view, in the database. CREATE TABLE Student (roll_no INT PRIMARY KEY, name VARCHAR(40)); defines a new table. Retrieval is SELECT, changing contents is UPDATE, and conditional record removal is DELETE.

Question 2: use of ALTER TABLE

The SQL ALTER TABLE statement is used to:

  • A. Add, delete, or modify columns in an existing table

  • B. Drop an existing table in a database

  • C. Insert or modify records in a table

  • D. Delete existing records in a table

Correct option: A. Add, delete, or modify columns in an existing table. ALTER TABLE Student ADD email VARCHAR(80); produces columns roll_no, name, and email. DROP removes the table, INSERT or UPDATE changes records, and DELETE removes records.

Question 3: incorrect DROP and TRUNCATE statement

In most standard SQL implementations, which of the following statements regarding DROP and TRUNCATE commands is incorrect?

  • A. DROP removes both the table structure and table data.

  • B. TRUNCATE removes all rows while preserving the table structure.

  • C. TRUNCATE is generally faster than DELETE for removing all rows from a table.

  • D. TRUNCATE can always be reversed using ROLLBACK regardless of the DBMS implementation.

  • E. DROP removes associated indexes and constraints along with the table.

Correct option: D. TRUNCATE can always be reversed using ROLLBACK regardless of the DBMS implementation. “Always” and “regardless” make it incorrect. If Student holds (1, 'Asha', 'asha@example.com') and (2, 'Ravi', 'ravi@example.com'), TRUNCATE TABLE Student; leaves zero rows but retains three fields. DROP TABLE Student; removes the object, its indexes and constraints. TRUNCATE is generally faster than DELETE. Rollback and implicit-commit behaviour varies by DBMS and transaction context.

DML MCQs: DELETE, UPDATE and INSERT

Begin with Employee(emp_id, name, dept, salary) rows (101, 'Asha', 'Sales', 50000) and (102, 'Ravi', 'IT', 60000).

Question 4: number of tuples DELETE can remove

The DELETE SQL command can be used to delete ______ tuple(s) from the tables of the database.

  • A. only one

  • B. single or multiple

  • C. at least two

  • D. at the most five

Correct option: B. single or multiple. After INSERT adds (103, 'Meera', 'IT', 55000), WHERE emp_id = 102 selects one row, while WHERE dept = 'IT' selects Ravi and Meera. The predicate decides the count, so “only one”, “at least two”, and “at the most five” impose false limits.

Question 5: changing attribute values

Which of the following SQL commands is used to change the attribute values of one or more rows in a table?

  • A. Update

  • B. Insert

  • C. Alter

  • D. More than one of the above

  • E. None of the above

Correct option: A. Update. UPDATE Employee SET salary = 55000 WHERE emp_id = 101; changes Asha's salary from 50000 to 55000 without changing her row identity or the schema. INSERT adds a row, while ALTER changes table structure, so neither the combined nor the none option works.

Question 6: adding a new row

Which SQL command is used to add new rows to a database table?

  • A. ADD

  • B. CREATE

  • C. INSERT

  • D. More than one of the above

  • E. None of the above

Correct option: C. INSERT. INSERT INTO Employee VALUES (103, 'Meera', 'IT', 55000); adds Meera's row. ADD normally appears inside ALTER TABLE, and CREATE defines an object. Therefore the combined and none options also fail. If DELETE FROM Employee WHERE dept = 'IT'; follows, Ravi and Meera are removed, leaving Asha at salary 55000.

DCL and TCL MCQs: privileges and transaction boundaries

Keep permissions separate from transaction outcomes. One controls who may act; the other controls whether current changes become durable or are reversed.

Question 7: identify the DCL command

Which one is a DCL command in SQL?

  • A. UPDATE

  • B. SELECT

  • C. DELETE

  • D. GRANT

  • E. None of these

Correct option: D. GRANT. GRANT SELECT ON Employee TO analyst1; gives analyst1 read access; REVOKE SELECT ON Employee FROM analyst1; withdraws it. UPDATE and DELETE manipulate rows. SELECT queries rows and may be called DQL when a syllabus separates it from DML. Thus “None of these” is false.

Question 8: identify the TCL pair

TCL commands are:

  • A. SELECT and INSERT

  • B. GRANT and REVOKE

  • C. UPDATE and TRUNCATE

  • D. COMMIT and ROLLBACK

Correct option: D. COMMIT and ROLLBACK. With A = 5000 and B = 3000, debit 800 gives A = 5000 − 800 = 4200; credit 800 gives B = 3000 + 800 = 3800. COMMIT fixes (4200, 3800). ROLLBACK before commit restores (5000, 3000). The other pairs are query/manipulation, control, and mixed manipulation/definition commands.

Question 9: match DCL, DML, TCL and binary operation

Match the following:
List – I                                          List – II
(a) DCL                                              (i) LOCK TABLE
(b) DML                                             (ii) COMMIT 
(c) TCL                                              (iii) Natural Difference
(d) Binary operation                       (iv) REVOKE
  • A. a-(ii), b-(i), c-(iii), d-(iv)

  • B. a-(i), b-(ii), c-(iv), d-(iii)

  • C. a-(iii), b-(i), c-(i), d-(iv)

  • D. a-(iv), b-(i), c-(ii), d-(iii)

Correct option: D. a-(iv), b-(i), c-(ii), d-(iii). Fix the unambiguous pairs first: DCL with REVOKE, TCL with COMMIT, and binary operation with Natural Difference. The remaining intended match is DML with LOCK TABLE. Option A pairs DCL with COMMIT, TCL with Natural Difference and binary operation with REVOKE. Option B gives DCL LOCK TABLE, DML COMMIT and TCL REVOKE, leaving only the binary-operation pair correct. Option C uses (i) LOCK TABLE twice, for both DML and TCL, and never uses (ii) COMMIT, so one list item is spent twice and another is dropped.

Rollback and DESC MCQs: two common trap words

Rollback concerns uncommitted changes. DESC can mean table description in one context and descending order in another.

Question 10: generally rollback-able before COMMIT

Under standard DBMS transaction theory used in basic SQL classification, which of the following commands is generally rollback-able before COMMIT?

  • A. SELECT

  • B. COMMIT

  • C. DELETE

  • D. CREATE

  • E. ALTER

Correct option: C. DELETE. Suppose a transfer-log row records amount 800. DELETE removes it, and ROLLBACK before commit restores it. The qualifiers “standard DBMS transaction theory”, “generally”, and “before COMMIT” matter. SELECT makes no stored row change, while COMMIT closes the rollback window. Transactional behaviour for CREATE and ALTER varies by DBMS.

Question 11: inspect fields and datatypes

The command used to see the fields of the table along with their datatypes in SQL is

  • A. Select fields from dual where table = "MANAGER";

  • B. Select field_names, datatype from dual where table_name = "MANAGER";

  • C. Desc MANAGER;

  • D. Select description from dual where table_name = "MANAGER";

Correct option: C. Desc MANAGER;. For MANAGER(manager_id INT, name VARCHAR(40), salary DECIMAL(10,2)), the descriptive output is manager_id | INT, name | VARCHAR(40), and salary | DECIMAL(10,2). The invented dual queries do not inspect that schema. In SELECT * FROM MANAGER ORDER BY salary DESC;, however, DESC sets sort direction. DESC is common client shorthand for DESCRIBE; exact support depends on the product.

Mixed classification MCQ and the five-question elimination routine

Question 12: find the invented SQL command type

Which of the following is NOT a type of SQL command ?

  • A. Data Definition Language (DDL)

  • B. Data Manipulation Language (DML)

  • C. Data Query Language (DQL)

  • D. Data Extraction Language (DEL)

Correct option: D. Data Extraction Language (DEL). DDL and DML are standard teaching categories, while DQL is commonly used in exam syllabi for query operations. DEL is the invented distractor. SQL references do not all use exactly the same category boundaries, but that variation does not make DEL a standard family here.

For any mixed set, ask five questions:

  1. Does it define structure?

  2. Does it change rows?

  3. Does it control privileges?

  4. Does it finish or reverse a transaction?

  5. Does it inspect structure?

Run the routine across one command from each family: CREATE TABLE Employee ... defines structure (DDL); UPDATE Employee SET salary = 55000 WHERE emp_id = 101 changes rows (DML); GRANT SELECT ON Employee TO analyst1 controls access (DCL); ROLLBACK after the 800 transfer affects transaction state (TCL); and DESC MANAGER reports structure without changing anything.

Apply the same routine to SQL query MCQs and transaction MCQs. The DBMS MCQ practice hub connects these command families with the wider subject.

Rapid revision, traps and next step

Recall

Fast distinction

DDL

Structure or schema object

DML

Rows or attribute values

DCL

Access and permissions

TCL

Transaction state

DESC table

Structure inspection

Four traps deserve a final check: ALTER changes structure, while UPDATE changes values. DROP removes the object, while DELETE removes qualifying rows. GRANT and REVOKE concern access, not data. DESC table inspects structure, while ORDER BY ... DESC sorts results.

For a 60-second answer method, underline the object of the verb, classify the affected layer, reject cross-layer options, then inspect absolute words such as “always”. For an academic end-to-end route, use the Zero to Hero complete CS course. For interview-focused revision, use CS Fundamentals for Placements.