SELECT c.name
FROM Customer c
WHERE NOT EXISTS(SELECT w.WID
FROM Woker w
WHERE NOT EXISTS(SELECT la
FROM look_after la
WHERE la.CID = c.CID
AND la.WID = w.WID));
I dont know what the code means... Could anyone tell me broadly what the code do? C is a Customer, who will looked after from a Worker.
The query selects customers that are looked after by all workers.
The double not exists
is a way to implement relational division.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With