-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathmysql.sql
150 lines (119 loc) · 3.92 KB
/
mysql.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `imdb`
--
-- --------------------------------------------------------
--
-- Table structure for table `acted_in`
--
CREATE TABLE IF NOT EXISTS `acted_in` (
`idacted_in` int(11) NOT NULL AUTO_INCREMENT,
`idmovies` int(11) NOT NULL,
`idseries` int(11) DEFAULT NULL,
`idactors` int(11) NOT NULL,
`character` varchar(1023) NOT NULL,
`billing_position` int(11) DEFAULT NULL,
PRIMARY KEY (`idacted_in`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `actors`
--
CREATE TABLE IF NOT EXISTS `actors` (
`idactors` int(11) NOT NULL AUTO_INCREMENT,
`lname` varchar(1023) NOT NULL,
`fname` varchar(1023) NOT NULL,
`mname` varchar(1023) DEFAULT NULL,
`gender` int(11) NOT NULL,
`number` int(11) DEFAULT NULL,
PRIMARY KEY (`idactors`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `aka_names`
--
CREATE TABLE IF NOT EXISTS `aka_names` (
`idaka_names` int(11) NOT NULL AUTO_INCREMENT,
`idactors` int(11) NOT NULL,
`name` varchar(1023) NOT NULL,
PRIMARY KEY (`idaka_names`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `aka_titles`
--
CREATE TABLE IF NOT EXISTS `aka_titles` (
`idaka_titles` int(11) NOT NULL AUTO_INCREMENT,
`idmovies` int(11) NOT NULL,
`title` varchar(1023) NOT NULL,
`location` varchar(127) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
PRIMARY KEY (`idaka_titles`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `genres`
--
CREATE TABLE IF NOT EXISTS `genres` (
`idgenres` int(11) NOT NULL AUTO_INCREMENT,
`genre` varchar(127) NOT NULL,
PRIMARY KEY (`idgenres`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `keywords`
--
CREATE TABLE IF NOT EXISTS `keywords` (
`idkeywords` int(11) NOT NULL AUTO_INCREMENT,
`keyword` varchar(127) NOT NULL,
PRIMARY KEY (`idkeywords`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `movies`
--
CREATE TABLE IF NOT EXISTS `movies` (
`idmovies` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(1023) NOT NULL,
`year` year(4) NOT NULL,
`number` int(11) DEFAULT NULL,
`type` int(11) DEFAULT NULL,
`location` varchar(127) DEFAULT NULL,
`language` varchar(127) DEFAULT NULL,
PRIMARY KEY (`idmovies`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `movies_genres`
--
CREATE TABLE IF NOT EXISTS `movies_genres` (
`idmovies_genres` int(11) NOT NULL AUTO_INCREMENT,
`idmovies` int(11) NOT NULL,
`idgenres` int(11) NOT NULL,
`idseries` int(11) DEFAULT NULL,
PRIMARY KEY (`idmovies_genres`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `movies_keywords`
--
CREATE TABLE IF NOT EXISTS `movies_keywords` (
`idmovies_keywords` int(11) NOT NULL AUTO_INCREMENT,
`idmovies` int(11) NOT NULL,
`idkeywords` int(11) NOT NULL,
`idseries` int(11) DEFAULT NULL,
PRIMARY KEY (`idmovies_keywords`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `series`
--
CREATE TABLE IF NOT EXISTS `series` (
`idseries` int(11) NOT NULL AUTO_INCREMENT,
`idmovies` int(11) NOT NULL,
`name` varchar(1023) DEFAULT NULL,
`season` int(11) DEFAULT NULL,
`number` int(11) DEFAULT NULL,
PRIMARY KEY (`idseries`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;