-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiLoveMovies.sql
79 lines (70 loc) · 4 KB
/
iLoveMovies.sql
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';*/
DROP DATABASE IF EXISTS iLoveMovies;
CREATE DATABASE IF NOT EXISTS iLoveMovies;
USE iLoveMovies;
-- ------------------------------------------------------------------------------------------------------------------------------------------
-- Create Tables --
-- -------------------------------------------------------------------------------------------------------------------------------
CREATE TABLE movieInfo (
MovieID INT NOT NULL,
Title VARCHAR(50) NOT NULL,
Rating ENUM('G', 'PG', 'PG-13', 'R'),
Genre VARCHAR(50),
ReleaseDate DATE,
StarRating DECIMAL(2,1),
MovieLanguage VARCHAR(30)
);
ALTER TABLE movieInfo MODIFY MovieID INT AUTO_INCREMENT PRIMARY KEY;
CREATE TABLE users (
userName VARCHAR(50) NOT NULL,
Email VARCHAR(50),
FavoriteMovie VARCHAR(50),
FavoriteGenre VARCHAR(50)
);
-- ------------------------------------------------------------------------------------------------------------------------------------------
-- Insert Data --
-- ---------------------------------------------------------------------------------------------------------------------
INSERT INTO movieInfo
VALUES
(1,'Glass','R','Thriller', '2019-03-01', 4.5, 'English'),
(2,'Matrix','R','Thriller', '2019-03-01', 3.1, 'English'),
(3,'Lego Movie','PG','Comedy', '2019-03-01', 4.3, 'English'),
(4,'Requiem for a Dream','G','Thriller', '2019-03-01', 2.0, 'English'),
(5,'The Truman Show','PG-13','Thriller', '2019-03-01', 4.4, 'English'),
(6,'Big Daddy','R','Comedy', '2019-03-01', 4.3, 'English'),
(7,'Happy Gilmore','R','Comedy', '2019-03-01', 4.5, 'English'),
(8,'Inception','R','Thriller', '2019-03-01', 4.5, 'English'),
(9,'Murder By Numbers','R','Horror', '2019-03-01', 4.9, 'English'),
(10,'Elf','G','Comedy', '2019-03-01', 4.2, 'English'),
(11,'Ace Ventura','PG','Comedy', '2019-03-01', 4.4, 'English'),
(12,'50 First Dates','PG','Comedy', '2019-03-01', 4.3, 'English'),
(13,'Raiders of the Lost Arc', 'PG', 'Action', '1981-06-12', 8.5, 'English'),
(14,'The Breakfast Club', 'R','Drama', '1989-02-15',7.9, 'English'),
(15,'Goonies', 'PG', 'Comedy','1989-06-07', 7.8, 'English'),
(16,'Alice In Wonderland', 'PG','Fantasy', '1999-02-28', 6.3, 'English'),
(17,'Die Hard', 'R', 'Action', '1988-07-20', 8.2, 'English'),
(18,'Home Alone', 'PG', 'Family', '1990-11-16', 7.5, 'English'),
(19,'The Grudge', 'PG-13', 'Horror', '2004-10-22', 7.3, 'English'),
(20,'Cinderella', 'G', 'Family', '1950-03-04', 7.8, 'English'),
(21,'Kill Bill', 'R', 'Action', '2003-10-10', 8.1, 'English'),
(22,'Chariots of Fire', 'PG', 'Sports', '1982-04-09', 7.2, 'English'),
(23,'Planes, Trains, and Automobiles', 'R', 'Comedy', '1987-11-25', 7.6, 'English'),
(24,'Anchorman', 'PG-13', 'Comedy', '2004-07-09', 7.2, 'English'),
(25,'Halloween', 'R', 'Horror', '1978-10-27', 7.8, 'English'),
(26,'Blair Witch Project', 'R', 'Horror', '1999-07-30', 6.4, 'English');
INSERT INTO users
VALUES
('Harry','[email protected]','Raiders of the Lost Arc','Action'),
('Hermione','[email protected]','The Breakfast Club','Documentary'),
('Ron','[email protected]','Goonies','Comedy'),
('Luna','[email protected]','Alice In Wonderland','Fantasy'),
('Ginny','[email protected]','Die Hard','Action'),
('Neville','[email protected]','Home Alone','Foreign'),
('Draco','[email protected]','The Grudge','Horror'),
('Pansy','[email protected]','Cinderella','Romance'),
('Dean','[email protected]','Kill Bill', 'Thriller'),
('Seamus','[email protected]','Chariots of Fire','Sports'),
('Fred','[email protected]','Planes, Trains, and Automobiles','Comedy'),
('George','[email protected]','Anchorman','Comedy'),
('Crabbe','[email protected]','Halloween','Horror'),
('Goyle','[email protected]','Blair Witch Project','Horror');