πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!

  • google app store apple app store
  • βœ–

      Question

      What is the difference between DELETE, TRUNCATE, and

      DROP commands in SQL?
      A All three remove data permanently with no differences Correct Answer Incorrect Answer
      B TRUNCATE can be rolled back; DELETE and DROP cannot cannot be rolled back Correct Answer Incorrect Answer
      C DELETE removes columns; TRUNCATE removes rows; DROP removes the database Correct Answer Incorrect Answer
      D DELETE is a DDL to remove specific columns; TRUNCATE is a DML to remove specific rows; DROP is a DCL to remove table Correct Answer Incorrect Answer
      E DELETE removes specific rows; TRUNCATE removes all rows; DROP removes the entire table structure and data Correct Answer Incorrect Answer

      Solution

      DELETE is DML β€” removes rows matching a WHERE clause, fires row-level triggers, logs each deletion, and can be rolled back within a transaction. TRUNCATE is DDL β€” removes ALL rows instantly by deallocating data pages, cannot be rolled back (in most RDBMS), does not fire row triggers, resets identity/auto-increment counters. DROP removes the table schema entirely β€” structure, data, indexes, triggers are all permanently gone. Critical distinction for banking database administration.

      Practice Next

      Relevant for Exams:

      ask-question