box-o-sand/oldstuff/lsqlthw-remnants/ex13-queries.sql
2015-06-22 13:15:42 -05:00

16 lines
367 B
SQL

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';