box-o-sand/lsqlthw-remnants/ex13-queries.sql

16 lines
367 B
MySQL
Raw Normal View History

2014-03-10 12:38:32 +00:00
SELECT
pet.name,
person.first_name,
person.last_name,
person_pet.purchased_on
FROM pet, person, person_pet
WHERE
person_pet.purchased_on >= DATETIME('2004-01-01 00:00:00')
AND person_pet.pet_id = pet.id
AND person_pet.person_id = person.id;
SELECT pet.name
FROM pet, person
WHERE pet.parent = person.id
AND person.first_name = 'Zed';