Multiple choice technology databases

Suppose you have to remove a table. There are several indexes associated with this table. Which among the following would remove all the indexes associated with the table?

  1. DROP INDEX

  2. ALTER TABLE ....... DROP PRIMARY KEY CASCADE

  3. ALTER TABLE ....... DROP CONSTRAINT

  4. DROP TABLE

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

When you execute a DROP TABLE command, the database automatically drops the table along with all indexes defined on that table. There is no need to drop the indexes individually, as they cannot exist without the base table. Other options like dropping constraints or primary keys cascade do not remove all table indexes.