Skip to content

ISRO Scientist/Engineer CSE 2020Databases › SQL

ISRO Scientist/Engineer CSE 2020 PYQ: Properties of $\text{‘DELETE’}$ and $\text{‘TRUNCATE’}$ commands indicate that

Properties of $\text{‘DELETE’}$ and $\text{‘TRUNCATE’}$ commands indicate that

  1. A
    After the execution of $\text{‘TRUNCATE’}$ operation, $\text{COMMIT}$ , and $\text{ROLLBACK}$ statements cannot be performed to retrieve the lost data, while $\text{‘DELETE’}$ allow it
    Correct answer
  2. B
    After the execution of $\text{‘DELETE’}$ and $\text{‘TRUNCATE’}$ operation retrieval is easily possible for the lost data
  3. C
    After the execution of $\text{‘DELETE’}$ operation, $\text{COMMIT}$ and $\text{ROLLBACK}$ statements can be performed to retrieve the lost data, while $\text{TRUNCATE}$ do not allow it
  4. D
    After the execution of $\text{‘DELETE’}$ and $\text{‘TRUNCATE’}$ operation no retrieval is possible for the lost data

Answer

(A) After the execution of $\text{‘TRUNCATE’}$ operation, $\text{COMMIT}$ , and $\text{ROLLBACK}$ statements cannot be performed to retrieve the lost data, while $\text{‘DELETE’}$ allow it

Approach

In standard SQL, DELETE is a DML command. It removes rows one at a time and records each deletion in the transaction log, so its effects can be undone with ROLLBACK as long as the transaction has not been committed. Once COMMIT is issued, however, the deletion becomes permanent and COMMIT itself does not restore any lost data. TRUNCATE is generally classified as a DDL command: it deallocates the data pages and, in most DBMSs such as Oracle and MySQL, causes an implicit commit, so it cannot be rolled back to retrieve the removed rows. Thus the key distinction is that TRUNCATE does not allow recovery of lost data via COMMIT or ROLLBACK, while DELETE does allow recovery before COMMIT through ROLLBACK. Option A states exactly this: after TRUNCATE, COMMIT cannot recover the lost data, whereas after DELETE, ROLLBACK can recover the lost data (before commit). The other options misstate the recoverability semantics: they either claim COMMIT can restore data lost by TRUNCATE, or claim ROLLBACK cannot restore data lost by DELETE, both of which contradict standard transaction behavior. Therefore the correct answer is A.

Reviewed by ISRO IQ Editorial Team.