SQL Delete

1.What does DELETE do in SQL?
  • A. Deletes a table structure
  • B. Removes one or more rows
  • C. Removes a column
  • D. Clears all tables

Removes one or more rows

Removes one or more rows

2.Which of these is correct syntax to delete selected rows?
  • A. DELETE FROM table WHERE condition;
  • B. REMOVE FROM table WHERE condition;
  • C. ERASE table IF condition;
  • D. DELETE ROWS WHERE condition FROM table;

DELETE FROM table WHERE condition;

DELETE FROM table WHERE condition;

3.What happens if DELETE is used without a WHERE clause?
  • A. No row is deleted
  • B. One row is deleted
  • C. All rows are deleted
  • D. Table is dropped

All rows are deleted

All rows are deleted

4.Which statement is true about DELETE and TRUNCATE?
  • A. DELETE removes table
  • B. TRUNCATE removes selected rows
  • C. DELETE can be rolled back
  • D. TRUNCATE is DML

DELETE can be rolled back

DELETE can be rolled back

5.What does DELETE FROM Students WHERE roll_no = 3; do?
  • A. Deletes entire table
  • B. Deletes student with roll_no 3
  • C. Deletes column roll_no
  • D. Deletes roll_no 3 from all tables

Deletes student with roll_no 3

Deletes student with roll_no 3