CS FundamentalsEasyWipro · Cognizant technical pattern
Which SQL command removes a table completely — its rows, its structure and its definition in the catalogue?
- A. DELETE FROM
- B. TRUNCATE TABLE
- C. ALTER TABLE … REMOVE
- D. DROP TABLE
Correct answer: D. DROP TABLE
DROP TABLE deletes the table object itself. DELETE and TRUNCATE remove rows but keep the empty table; there is no ALTER TABLE … REMOVE command.
More DBMS and SQL questions
- Table Orders(id, cust, city, amount) rows: (1, 'Ana', 'Pune', 500), (2, 'Ben', 'Delhi', NULL), (3, 'Ana', 'Pune', 300), (4, 'Chen'…
- Table Orders(id, cust, city, amount) rows: (1, 'Ana', 'Pune', 500), (2, 'Ben', 'Delhi', NULL), (3, 'Ana', 'Pune', 300), (4, 'Chen'…
- Table Orders(id, cust, city, amount) rows: (1, 'Ana', 'Pune', 500), (2, 'Ben', 'Delhi', NULL), (3, 'Ana', 'Pune', 300), (4, 'Chen'…
- Transaction T1 reads a row, transaction T2 then updates that row and commits, and T1 reads the same row again and sees a different value…
- Table Orders(id, cust, city, amount) rows: (1, 'Ana', 'Pune', 500), (2, 'Ben', 'Delhi', NULL), (3, 'Ana', 'Pune', 300), (4, 'Chen'…
- Table Orders(id, cust, city, amount) rows: (1, 'Ana', 'Pune', 500), (2, 'Ben', 'Delhi', NULL), (3, 'Ana', 'Pune', 300), (4, 'Chen'…