|
CREATE TABLE movies ( |
|
id serial PRIMARY KEY, |
|
title text, |
|
duration integer, |
|
rating varchar(10), |
|
genre text, |
|
is_3d boolean NOT NULL, |
|
released_at datetime, |
|
score decimal(3, 1) |
|
); |
|
|
|
CREATE TABLE plots ( |
|
id serial PRIMARY KEY, |
|
movie_id integer REFERENCES movies(id), |
|
summary text |
|
); |
|
|
|
CREATE TABLE awards ( |
|
id serial PRIMARY KEY, |
|
movie_id integer REFERENCES movies(id), |
|
kind text, |
|
name text |
|
); |
|
|
|
CREATE TABLE actors ( |
|
id serial, |
|
name text, |
|
birthed_at datetime |
|
); |
|
|
|
CREATE TABLE actors_movies ( |
|
id serial, |
|
actor_id integer REFERENCES actors(id), |
|
movie_id integer REFERENCES movies(id), |
|
role text |
|
); |
|
|
|
INSERT INTO movies (title, duration, rating, genre, is_3d, released_at, score) |
|
VALUES ('Frozen', 102, 'PG', 'Animation', TRUE, '2013-11-27 00:00:00', 7.6); |
|
|
|
INSERT INTO movies (title, duration, rating, genre, is_3d, released_at, score) |
|
VALUES ('X-Men: Apocalypse', 144, 'PG-13', 'Action', TRUE, '2016-05-27 00:00:00', 7.4); |
|
|
|
INSERT INTO movies (title, duration, rating, genre, is_3d, released_at, score) |
|
VALUES ('The Princess Bride', 98, 'PG', 'Adventure', FALSE, '1987-10-09 00:00:00', 8.1); |
|
|
|
INSERT INTO movies (title, duration, rating, genre, is_3d, released_at, score) |
|
VALUES ('Pulp Fiction', 154, 'R', 'Crime', FALSE, '1994-10-14 00:00:00', 8.9); |
|
|
|
INSERT INTO plots (movie_id, summary) |
|
VALUES (1, 'Anna, a fearless optimist, sets off on an epic journey - teaming up with rugged mountain man Kristoff and his loyal reindeer Sven - to find her sister Elsa, whose icy powers have trapped the kingdom of Arendelle in eternal winter. Encountering Everest-like conditions, mystical trolls and a hilarious snowman named Olaf, Anna and Kristoff battle the elements in a race to save the kingdom. From the outside Anna''s sister, Elsa looks poised, regal and reserved, but in reality, she lives in fear as she wrestles with a mighty secret-she was born with the power to create ice and snow. It''s a beautiful ability, but also extremely dangerous. Haunted by the moment her magic nearly killed her younger sister Anna, Elsa has isolated herself, spending every waking minute trying to suppress her growing powers. Her mounting emotions trigger the magic, accidentally setting off an eternal winter that she can''t stop. She fears she''s becoming a monster and that no one, not even her sister, can help her.'); |
|
|
|
INSERT INTO plots (movie_id, summary) |
|
VALUES (2, 'Since the dawn of civilization, he was worshipped as a God. Apocalypse, the first and most powerful mutant from Marvel''s X-Men universe, amassed the powers of many other mutants, becoming immortal and invincible. Upon awakening after thousands of years, he is disillusioned with the world as he finds it and recruits a team of powerful mutants, including a disheartened Magneto, to cleanse mankind and create a new world order, over which he will reign. As the fate of the Earth hangs in the balance, Raven with the help of Professor X must lead a team of young X-Men to stop their greatest nemesis and save mankind from complete destruction.'); |
|
|
|
INSERT INTO plots (movie_id, summary) |
|
VALUES (3, 'A kindly grandfather sits down with his ill grandson and reads him a story. The story is one that has been passed down from father to son for generations. As the grandfather reads the story, the action comes alive. The story is a classic tale of love and adventure as the beautiful Buttercup, engaged to the odious Prince Humperdinck, is kidnapped and held against her will in order to start a war, It is up to Westley (her childhood beau, now returned as the Dread Pirate Roberts) to save her. On the way he meets a thief and his hired helpers, an accomplished swordsman and a huge, super strong giant, both of whom become Westley''s companions in his quest.'); |
|
|
|
INSERT INTO plots (movie_id, summary) |
|
VALUES (4, 'Jules Winnfield and Vincent Vega are two hitmen who are out to retrieve a suitcase stolen from their employer, mob boss Marsellus Wallace. Wallace has also asked Vincent to take his wife Mia out a few days later when Wallace himself will be out of town. Butch Coolidge is an aging boxer who is paid by Wallace to lose his next fight. The lives of these seemingly unrelated people are woven together comprising of a series of funny, bizarre and uncalled-for incidents.'); |
|
|
|
|
|
INSERT INTO awards (movie_id, kind, name) |
|
VALUES (1, 'Oscar', 'Best Animated Feature Film of the Year'); |
|
|
|
INSERT INTO awards (movie_id, kind, name) |
|
VALUES (1, 'Oscar', 'Best Achievement in Music Written for Motion Pictures, Original Song'); |
|
|
|
INSERT INTO awards (movie_id, kind, name) |
|
VALUES (3, 'Saturn Award', 'Best Fantasy Film'); |
|
|
|
INSERT INTO awards (movie_id, kind, name) |
|
VALUES (3, 'Saturn Award', 'Best Costumes'); |
|
|
|
INSERT INTO awards (movie_id, kind, name) |
|
VALUES (4, 'Oscar', 'Best Writing, Screenplay Written Directly for the Screen'); |
|
|
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('Kristen Bell', '1980-07-18 00:00:00'); |
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('Idina Menzel', '1971-05-30 00:00:00'); |
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('James McAvoy', '1979-04-21 00:00:00'); |
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('Michael Fassbender', '1977-04-02 00:00:00'); |
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('Jennifer Lawrence', '1990-08-15 00:00:00'); |
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('Cary Elwes', '1962-10-26 00:00:00'); |
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('Robin Wright', '1966-04-08 00:00:00'); |
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('Chris Sarandon', '1942-07-24 00:00:00'); |
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('John Travolta', '1954-02-18 00:00:00'); |
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('Samuel L. Jackson', '1948-12-21 00:00:00'); |
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('Tim Roth', '1961-05-14 00:00:00'); |
|
|
|
INSERT INTO actors (name, birthed_at) |
|
VALUES ('Amanda Plummer', '1957-03-23 00:00:00'); |
|
|
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (1, 1, 'Anna'); |
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (2, 1, 'Elsa'); |
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (3, 2, 'Professor Charles Xavier'); |
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (4, 2, 'Erik Lehnsherr / Magneto'); |
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (5, 2, 'Raven / Mystique'); |
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (6, 3, 'Westley'); |
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (7, 3, 'The Princess Bride'); |
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (8, 3, 'Prince Humperdinck'); |
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (9, 4, 'Vincent Vega'); |
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (10, 4, 'Jules Winnfield'); |
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (11, 4, 'Pumpkin / Ringo'); |
|
|
|
INSERT INTO actors_movies (actor_id, movie_id, role) |
|
VALUES (12, 4, 'Honey Bunny / Yolanda'); |