· 9 years ago · Jan 15, 2017, 08:40 PM
1CREATE KEYSPACE IF NOT EXISTS ci WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
2USE ci;
3CREATE TABLE IF NOT EXISTS movies (
4 imdb_id varchar,
5 Title varchar,
6 Year varchar,
7 Rated varchar,
8 Released varchar,
9 Runtime varchar,
10 Genre varchar,
11 Director varchar,
12 Writer varchar,
13 Actors varchar,
14 Plot text,
15 Country varchar,
16 PRIMARY KEY (Title, Year)
17) WITH CLUSTERING ORDER BY (Year DESC);
18
19CREATE INDEX imdb_id_idx ON ci.movies( imdb_id );
20
21INSERT INTO movies (imdb_id, Title , Year, Rated , Released , Runtime , Genre , Director , Writer , Actors , Plot , Country) VALUES ('tt2709768','The Secret Life of Pets','2016','PG','08 Jul 2016','87 min','Animation, Adventure, Comedy','Chris Renaud, Yarrow Cheney','Cinco Paul, Ken Daurio, Brian Lynch, Simon Rich (additional characters created by)','Louis C.K., Eric Stonestreet, Kevin Hart, Jenny Slate','The quiet life of a terrier named Max is upended when his owner takes in Duke, a stray whom Max instantly dislikes.','USA, Japan');
22INSERT INTO movies (imdb_id, Title , Year, Rated , Released , Runtime , Genre , Director , Writer , Actors , Plot , Country) VALUES ('tt3748528','Rogue One: A Star Wars Story','2016','PG-13','16 Dec 2016','133 min','Action, Adventure, Sci-Fi','Gareth Edwards','Chris Weitz (screenplay), Tony Gilroy (screenplay), John Knoll (story by), Gary Whitta (story by), George Lucas (based on characters created by)','Felicity Jones, Diego Luna, Alan Tudyk, Donnie Yen','The Rebel Alliance makes a risky move to steal the plans for the Death Star, setting up the epic saga to follow.','USA');
23INSERT INTO movies (imdb_id, Title , Year, Rated , Released , Runtime , Genre , Director , Writer , Actors , Plot , Country) VALUES ('tt3521164','Moana','2016','PG','23 Nov 2016','107 min','Animation, Adventure, Comedy','Ron Clements, Don Hall, John Musker, Chris Williams','Jared Bush (screenplay), Ron Clements (story by), John Musker (story by), Chris Williams (story by), Don Hall (story by), Pamela Ribon (story by), Aaron Kandell (story by), Jordan Kandell (story by)','Auli i Cravalho, Dwayne Johnson, Rachel House, Temuera Morrison','In Ancient Polynesia, when a terrible curse incurred by Maui reaches an impetuous Chieftain s daughter s island, she answers the Ocean s call to seek out the demigod to set things right.','USA');
24INSERT INTO movies (imdb_id, Title , Year, Rated , Released , Runtime , Genre , Director , Writer , Actors , Plot , Country) VALUES ('tt3717252','Underworld: Blood Wars','2016','06 Jan 2017','91 min','Action, Horror','Anna Foerster','Cory Goodman (screenplay), Kyle Ward (story by), Cory Goodman (story by), Kevin Grevioux (based on characters created by), Len Wiseman (based on characters created by), Danny McBride (based on characters created by)','Kate Beckinsale, Theo James, Lara Pulver, Charles Dance','Vampire death dealer, Selene (Kate Beckinsale) fights to end the eternal war between the Lycan clan and the Vampire faction that betrayed her.','USA');
25INSERT INTO movies (imdb_id, Title , Year, Rated , Released , Runtime , Genre , Director , Writer , Actors , Plot , Country) VALUES ('tt1386697','Suicide Squad','2016','PG-13','05 Aug 2016','123 min','Action, Adventure, Fantasy','David Ayer','David Ayer','Will Smith, Jaime FitzSimons, Ike Barinholtz, Margot Robbie','A secret government agency recruits some of the most dangerous incarcerated super-villains to form a defensive task force. Their first mission: save the world from the apocalypse.','USA');