Skip to content

CS Professional · Artificial Intelligence, Data Analytics and Cyber Security - Laws and Practice · Database Management

A firm's database administrator runs a DELETE statement without a WHERE clause inside a transaction that has not been committed, then realises the error. Which statement is correct?

Issuing ROLLBACK restores the deleted rows. DELETE is a DML command, so until the transaction is committed its effect can be undone. It removes rows, not table structure, and GRANT only controls privileges and cannot recover data.

  1. AIssuing ROLLBACK restores the deleted rowsCorrect
  2. BRows are gone permanently because DELETE auto-commits in all cases
  3. CDELETE without WHERE only removes the table structure
  4. DGRANT can be used to recover the rows

Explanation

DELETE is a DML command that removes rows and can be rolled back before COMMIT in a transactional database. It does not drop the table structure, and GRANT is a privilege command with no recovery function.

Did you get it right without looking?

One question tells you little. A timed set on Database Management shows your real accuracy, how long you take and where you lose marks.

More Database Management questions