Which of the following is DDL command?
2023
Which of the following is DDL command?
- A.
UPDATE SET / UPDATE SET
- B.
DELETE / DELETE
- C.
DROP TABLE / DROP TABLE
- D.
INSERT INTO / INSERT INTO
Attempted by 2510 students.
Show answer & explanation
Correct answer: C
Answer: DROP TABLE is a Data Definition Language (DDL) command.
What is DDL? DDL commands change the database schema (structure), for example creating, altering, or dropping tables and indexes.
Why DROP TABLE is DDL: It removes the table definition and all its data, modifying the database schema rather than just row contents.
Examples of DDL: CREATE TABLE, ALTER TABLE, DROP TABLE.
The other commands listed (UPDATE, DELETE, INSERT INTO) are DML: they change table data (rows) but do not alter the table schema.
Quick syntax reminders: UPDATE uses 'UPDATE table_name SET column = value WHERE ...', DELETE uses 'DELETE FROM table_name WHERE ...', and INSERT uses 'INSERT INTO table_name (columns) VALUES (...)'.
Summary: DROP TABLE is the DDL command in this list because it changes the database structure.
A video solution is available for this question — log in and enroll to watch it.