From bf4f303f5abd35864dd2777c98b1155f6fc76c15 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 9 Mar 2014 15:24:50 -0400 Subject: [PATCH] Dusting off lsqlthw, up to ex6 --- lsqlthw-remnants/ex3-myself.sql | 2 +- lsqlthw-remnants/ex6.sql | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 lsqlthw-remnants/ex6.sql diff --git a/lsqlthw-remnants/ex3-myself.sql b/lsqlthw-remnants/ex3-myself.sql index 391d32f..54273b4 100644 --- a/lsqlthw-remnants/ex3-myself.sql +++ b/lsqlthw-remnants/ex3-myself.sql @@ -2,7 +2,7 @@ INSERT INTO person (id, first_name, last_name, age) VALUES (1, "Dan", "Buch", 31); INSERT INTO pet (id, name, breed, age, dead) - VALUES (2, "Franny", "Dog", 14, 0); + VALUES (2, "Franny", "Dog", 14, 1); INSERT INTO pet (id, name, breed, age, dead) VALUES (3, "Zooey", "Cat", 7, 0); diff --git a/lsqlthw-remnants/ex6.sql b/lsqlthw-remnants/ex6.sql new file mode 100644 index 0000000..0c30148 --- /dev/null +++ b/lsqlthw-remnants/ex6.sql @@ -0,0 +1,6 @@ +SELECT pet.id, pet.name, pet.age, pet.dead + FROM pet, person_pet, person + WHERE + pet.id = person_pet.pet_id AND + person_pet.person_id = person.id AND + person.first_name = "Zed";