From 513afbebdb7b9568648c54e81cc8a597a45cf341 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 9 Mar 2014 19:02:07 -0400 Subject: [PATCH] lsqlthw ex10 --- lsqlthw-remnants/ex10.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lsqlthw-remnants/ex10.sql diff --git a/lsqlthw-remnants/ex10.sql b/lsqlthw-remnants/ex10.sql new file mode 100644 index 0000000..38674ef --- /dev/null +++ b/lsqlthw-remnants/ex10.sql @@ -0,0 +1,12 @@ +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;