summaryrefslogtreecommitdiff
path: root/lib/movies.sql
blob: 15cbd0ce1ec605ba2bca57b8aa14a89554f9da3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
-- \.

-- find all pixar movies
-- find all studios that don't have a movie.
-- find all studios that did not publish a movie in 2006
-- find all movies published by pixar or disney
-- find all movies not published by pixar
-- find all movies released after 2004
-- find all movies released between 1982 and 2003 - Inclusive
-- sort all movies by descending title
-- sort all movies by ascending title
-- sort all movies by descending release date
-- sort all movies by ascending release date
-- sort all movies by preferred studios and release date ascending