|
@@ -0,0 +1,22 @@
|
|
1
|
+INSERT INTO MOVIES (ID, TITLE, RUNTIME, GENRE, IMDB_SCORE, RATING) VALUES (1, 'Howard the Duck', '110', 'Sci-Fi', '4.6', 'PG');
|
|
2
|
+INSERT INTO MOVIES (ID, TITLE, RUNTIME, GENRE, IMDB_SCORE, RATING) VALUES (2, 'Lavalantula', '83', 'Horror', '4.7', 'TV-14');
|
|
3
|
+INSERT INTO MOVIES (ID, TITLE, RUNTIME, GENRE, IMDB_SCORE, RATING) VALUES (3, 'Starship Troopers', '129', 'Sci-Fi', '7.2', 'PG-13');
|
|
4
|
+INSERT INTO MOVIES (ID, TITLE, RUNTIME, GENRE, IMDB_SCORE, RATING) VALUES (4, 'Waltz With Bashir', '90', 'Documentary', '8.0', 'R');
|
|
5
|
+INSERT INTO MOVIES (ID, TITLE, RUNTIME, GENRE, IMDB_SCORE, RATING) VALUES (5, 'Spaceballs', '96', 'Comedy', '7.1', 'PG');
|
|
6
|
+INSERT INTO MOVIES (ID, TITLE, RUNTIME, GENRE, IMDB_SCORE, RATING) VALUES (6, 'Monsters Inc.', '92', 'Animation', '8.1', 'G');
|
|
7
|
+
|
|
8
|
+SELECT * FROM MOVIES WHERE GENRE = 'Sci-Fi';
|
|
9
|
+
|
|
10
|
+SELECT * FROM MOVIES WHERE IMDB_SCORE > 6.5;
|
|
11
|
+
|
|
12
|
+SELECT * FROM MOVIES WHERE RATING = 'G' OR RATING = 'PG' AND RUNTIME < 100;
|
|
13
|
+
|
|
14
|
+SELECT AVG(RUNTIME) FROM MOVIES WHERE IMDB_SCORE < 7.5 GROUP BY GENRE;
|
|
15
|
+
|
|
16
|
+UPDATE MOVIES SET RATING = 'R' WHERE TITLE = 'Starship Troopers';
|
|
17
|
+
|
|
18
|
+SELECT ID, RATING FROM MOVIES WHERE GENRE = 'Horror' OR GENRE = 'Documentary';
|
|
19
|
+
|
|
20
|
+SELECT AVG(IMDB_SCORE), MAX(IMDB_SCORE), MIN(IMDB_SCORE) FROM MOVIES HAVING COUNT(*) > 1;
|
|
21
|
+
|
|
22
|
+DELETE FROM MOVIES WHERE RATING = 'R';
|