DML & Transactions · Question 7 · Easy

DML & Transactions question 7

Table Account:
acc_no | holder | balance
101 | Farah | 5000
102 | Gopal | 12000
103 | Hema | 800
104 | Imran | 7000

What does the SELECT return after the DELETE?

DELETE FROM Account;
SELECT COUNT(*) FROM Account;
  1. 4
  2. 1
  3. 0
  4. An error, because the table Account no longer exists
Answer and explanation

Answer: C. 0

Explanation: DELETE without WHERE removes every row but keeps the table itself, so the SELECT still works and counts 0 rows. Only DROP TABLE removes the table.

Previous: Table Account: acc_no | holder | balance 101 | Farah | 5000 102 | Gopal |… · Next: Table Account: acc_no | holder | balance 101 | Farah | 5000 102 | Gopal |…

Practise dml & transactions

Try a fresh set of dml & transactions questions with an explanation after every answer, free and without signing up: DML & Transactions practice. Or sit a full placement mock test.

More dml & transactions questions

More sql practice

SELECT, WHERE & ORDER BY · SQL Joins · Aggregates & GROUP BY · Subqueries & CTEs · Window Functions · NULL Handling · SQL Functions & CASE · UNION, INTERSECT & EXCEPT

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge