DML & Transactions · Question 11 · Medium

DML & Transactions question 11

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

Table Blocked:
acc_no
102
104

Which holders are left in Account after the DELETE?

DELETE FROM Account
WHERE acc_no IN (SELECT acc_no FROM Blocked);
SELECT holder FROM Account ORDER BY acc_no;
  1. Gopal; Imran
  2. Farah; Gopal; Hema; Imran
  3. No rows
  4. Farah; Hema
Answer and explanation

Answer: D. Farah; Hema

Explanation: The subquery returns the account numbers 102 and 104. The DELETE removes the Account rows with those numbers (Gopal and Imran), leaving Farah and Hema. The Blocked table itself is not changed.

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