Add 'lsqlthw-remnants/' from commit '45ac55d14c734fb12e130efc80476325866c4cb7'

git-subtree-dir: lsqlthw-remnants
git-subtree-mainline: 01e5a4e45f
git-subtree-split: 45ac55d14c
This commit is contained in:
Dan Buch 2013-01-09 23:47:55 -05:00
commit c076df41c6
8 changed files with 55 additions and 0 deletions

1
lsqlthw-remnants/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.db

6
lsqlthw-remnants/ex1.sql Normal file
View File

@ -0,0 +1,6 @@
CREATE TABLE person (
id INTEGER PRIMARY KEY,
first_name TEXT,
last_name TEXT,
age INTEGER
);

19
lsqlthw-remnants/ex2.sql Normal file
View File

@ -0,0 +1,19 @@
CREATE TABLE person (
id INTEGER PRIMARY KEY,
first_name TEXT,
last_name TEXT,
age INTEGER
);
CREATE TABLE pet (
id INTEGER PRIMARY KEY,
name TEXT,
breed TEXT,
age INTEGER,
dead INTEGER
);
CREATE TABLE person_pet (
person_id INTEGER,
pet_id INTEGER
);

View File

@ -0,0 +1,8 @@
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);
INSERT INTO pet (id, name, breed, age, dead)
VALUES (3, "Zooey", "Cat", 7, 0);

7
lsqlthw-remnants/ex3.sql Normal file
View File

@ -0,0 +1,7 @@
INSERT INTO person (id, first_name, last_name, age)
VALUES (0, "Zed", "Shaw", 37);
INSERT INTO pet (id, name, breed, age, dead)
VALUES (0, "Fluffy", "Unicorn", 1000, 0);
INSERT INTO pet VALUES (1, "Gigantor", "Robot", 1, 1);

View File

@ -0,0 +1,5 @@
INSERT INTO person_pet (person_id, pet_id)
VALUES (1, 2);
INSERT INTO person_pet (person_id, pet_id)
VALUES (1, 3);

2
lsqlthw-remnants/ex4.sql Normal file
View File

@ -0,0 +1,2 @@
INSERT INTO person_pet (person_id, pet_id) VALUES (0, 0);
INSERT INTO person_pet VALUES (0, 1);

7
lsqlthw-remnants/ex5.sql Normal file
View File

@ -0,0 +1,7 @@
SELECT * FROM person;
SELECT name, age FROM pet;
SELECT name, age FROM pet WHERE dead = 0;
SELECT * FROM person WHERE first_name != "Zed";