SELECT name_of_cat
FROM cats
WHERE owner_id = (
SELECT owner_id
FROM owners
WHERE name = 'Thabo' AND surname = 'Ndlovu'
)
ORDER BY name_of_cat ASC;
Each owner owns one or more cats, and every cat has exactly one owner.
• The name and surname of each owner must be stored in the database.
• The name of each cat must be stored in the database.
• Each cat belongs to one specific breed, and many cats can belong to the same breed.
• The description of each breed must be stored in the database.
• A cat can enter many competitions, and many cats can enter the same competition.
• The description of each competition must be stored in the database.
Assume that the database has been populated with data. Write the SQL code to
list all the cats belonging to owner Thabo Ndlovu in ascending alphabetical order.
1 answer