SQL command used to remove a table from the database is

2026

SQL command used to remove a table from the database is

Answer: B. DROPSQL commands span several categories — DDL, DML, DCL, and TCL — grouped by what they act on. Two of those categories matter here: Data Definition Language…

  1. A.

    DELETE

  2. B.

    DROP

  3. C.

    TRUNCATE

  4. D.

    REMOVE

Attempted by 223 students.

Show answer & explanation

Correct answer: B

SQL commands span several categories — DDL, DML, DCL, and TCL — grouped by what they act on. Two of those categories matter here: Data Definition Language (DDL) commands change the STRUCTURE of a database object — creating, altering, or removing an entire table, view, or index. Data Manipulation Language (DML) commands change only the DATA (rows) stored inside an object that already exists, without touching its structure.

DROP is the DDL command that eliminates a table object completely — its structure, its stored rows, and any indexes or constraints defined on it — from the database, so DROP is the command used to remove a table.

Command

Effect on the table object

DROP

Removes the table object itself — its structure, its stored rows, and the indexes and constraints defined on it — from the schema.

DELETE

Removes only the rows chosen by an optional WHERE clause; the table object, with its column definitions and constraints, stays in the schema.

TRUNCATE

Empties every row in one bulk operation; the table’s columns, indexes and constraints remain defined.

REMOVE

Not a keyword defined by the SQL standard, so no database engine executes a ‘REMOVE TABLE’ command.

This can be cross-checked by the effect on a later query: after DROP TABLE, querying that table name fails because the object no longer exists in the schema; after an unqualified DELETE (no WHERE clause) or after TRUNCATE, the same query still succeeds and returns zero rows, because the table itself still exists — only its rows are gone. Only DROP removes the table, confirming it as the correct command.

Explore the full course: Niacl Ao It Specialist

Loading lesson…