|
@@ -0,0 +1,45 @@
|
|
1
|
+SELECT * FROM MOVIES
|
|
2
|
+
|
|
3
|
+INSERT INTO MOVIES(TITLE, RUNTIME, GENRE, IMDB_SCORE, RATING)
|
|
4
|
+VALUES('Howard the Duck ', '110', 'Sci-Fi', '4.6', 'PG')
|
|
5
|
+VALUES('Lavalantula', '83', 'Horror', '4.7', 'TV-14')
|
|
6
|
+VALUES ('Starship Troopers', '129', 'Sci-Fi', '7.2', 'PG-13')
|
|
7
|
+VALUES ('Waltz With Bashir', '90', 'Documentary', '8.0', 'R')
|
|
8
|
+VALUES ('Spaceballs', '96', 'Comedy', '7.1', 'PG')
|
|
9
|
+VALUES ('Monsters Inc.', '92', 'Animation', '8.1', 'G')
|
|
10
|
+VALUES('The Fellowship of the Ring', '228', 'Fantasy', '8.8', 'PG-13')
|
|
11
|
+VALUES('Logan', '141', 'Sci-Fi', '8.1', 'R')
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+SELECT TITLE FROM MOVIES
|
|
15
|
+WHERE GENRE = 'Sci-Fi'
|
|
16
|
+
|
|
17
|
+SELECT TITLE FROM MOVIES
|
|
18
|
+WHERE IMDB_SCORE >= 6.5;
|
|
19
|
+
|
|
20
|
+SELECT TITLE FROM MOVIES
|
|
21
|
+WHERE RUNTIME < 100 AND (RATING = 'G' OR RATING = 'PG')
|
|
22
|
+
|
|
23
|
+SELECT AVG (RUNTIME)
|
|
24
|
+FROM MOVIES
|
|
25
|
+WHERE IMDB_SCORE < 7.5
|
|
26
|
+GROUP BY genre;
|
|
27
|
+
|
|
28
|
+UPDATE MOVIES
|
|
29
|
+SET RATING = 'R'
|
|
30
|
+WHERE TITLE = 'Starship Troopers'
|
|
31
|
+
|
|
32
|
+SELECT ID, TITLE, RATING FROM MOVIES
|
|
33
|
+WHERE GENRE = 'Horror' OR GENRE = 'Documentary'
|
|
34
|
+
|
|
35
|
+SELECT RATING, AVG (IMDB_SCORE), MAX (IMDB_SCORE), MIN (IMDB_SCORE)
|
|
36
|
+FROM MOVIES
|
|
37
|
+GROUP BY RATING;
|
|
38
|
+
|
|
39
|
+SELECT RATING, AVG (IMDB_SCORE), MAX (IMDB_SCORE), MIN (IMDB_SCORE)
|
|
40
|
+FROM MOVIES
|
|
41
|
+GROUP BY RATING
|
|
42
|
+HAVING COUNT(*) > 1;
|
|
43
|
+
|
|
44
|
+DELETE FROM MOVIES
|
|
45
|
+WHERE RATING = 'R';
|