DML & Transactions · Question 2 · Easy

DML & Transactions question 2

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

Which holders are left in the table after the DELETE?

DELETE FROM Account WHERE balance < 5000;
SELECT holder FROM Account ORDER BY acc_no;
  1. Gopal; Imran
  2. Hema
  3. Farah; Gopal; Hema; Imran
  4. Farah; Gopal; Imran
Answer and explanation

Answer: D. Farah; Gopal; Imran

Explanation: Only Hema's balance of 800 is below 5000, so only her row is deleted. Farah's balance is exactly 5000, which is not less than 5000, so her row stays.

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