summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-11-20 09:47:46 -0700
committermo khan <mo@mokhan.ca>2015-11-20 09:47:46 -0700
commit646eb5300a7452718e8615534c2390ae5f06531b (patch)
tree0f8fe8995e1c9a57feee5f087605b1d29c5cfbf4
parent06c80ee9bbef7cb5d368363ada0a221dced56374 (diff)
add questions for sql tests.
-rw-r--r--lib/movies.sql30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/movies.sql b/lib/movies.sql
new file mode 100644
index 0000000..79c6a80
--- /dev/null
+++ b/lib/movies.sql
@@ -0,0 +1,30 @@
+CREATE TABLE movies (
+ id integer NOT NULL,
+ title character varying(255),
+ studio_id integer,
+ year integer
+);
+
+CREATE TABLE studios (
+ id integer NOT NULL,
+ title character varying(255)
+);
+
+-- COPY studios (id, title) FROM stdin;
+-- 1 Castle Rock
+-- 2 MiramaxFilms
+-- 3 RegencyEnterprises
+-- 4 Pixar
+-- 5 Disney
+-- \.
+
+-- Can find all pixar movies
+-- Can find all movies published by pixar or disney
+-- Can find all movies not published by pixar
+-- Can find all movies released after 2004
+-- Can find all movies released between 1982 and 2003 - Inclusive
+-- Sorts all movies by descending title
+-- Sorts all movies by ascending title
+-- Sorts all movies by descending release date
+-- Sorts all movies by ascending release date
+-- Sorts all movies by preferred studios and release date ascending