box-o-sand/lsqlthw-remnants/ex10.sql

13 lines
258 B
MySQL
Raw Normal View History

2014-03-09 23:02:07 +00:00
SELECT * FROM pet;
UPDATE pet SET name = "Zed's Pet" WHERE id IN (
SELECT pet.id
FROM pet, person_pet, person
WHERE
person.id = person_pet.person_id AND
pet.id = person_pet.pet_id AND
person.first_name = "Zed"
);
SELECT * FROM pet;