Kodewick
Start learning →
Mini challenge←→0 / 70

No pets yet

#063Mini challengeSubqueriesNULL6 min

Some people in the vet's owners table have no pet on file yet. Pick their name: the owners whose id isn't among the owner_ids in pets. Careful: some owner_ids are empty.

The tables
owners
idnamecityphone
1LenaOslo555-0101
2MarcoRomeNULL
3PriyaOslo555-0103
4OmarCairoNULL
5SofiaRome555-0105
5 rows
pets
idnamekindageweightowner_id
1Biscuitdog3121
2Mochicat541
3Pepperdog8202
4Nemofish1NULL3
5Lunacat233
6Rexdog1130NULL
7Kiwibird4NULL5
8Tofucat75NULL
8 rows
query.sql
SELECT name
FROM owners
WHERE id NOT IN (
  -- your code here: the owner_id from pets, with WHERE dropping the empty ones
);
Ctrl + Enter runs too
Result

Run shows what your query gives. When it looks right, Submit.