-
Notifications
You must be signed in to change notification settings - Fork 0
/
305_project.sql
165 lines (133 loc) · 4.37 KB
/
305_project.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Dec 05, 2018 at 08:37 PM
-- Server version: 5.7.23
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `305_project`
--
-- --------------------------------------------------------
--
-- Table structure for table `acted_in`
--
DROP TABLE IF EXISTS `acted_in`;
CREATE TABLE IF NOT EXISTS `acted_in` (
`actor_id` int(11) NOT NULL,
`movie_id` int(11) NOT NULL,
`role` varchar(45) DEFAULT NULL,
KEY `actor_id` (`actor_id`),
KEY `movie_id` (`movie_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `actor`
--
DROP TABLE IF EXISTS `actor`;
CREATE TABLE IF NOT EXISTS `actor` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`award` varchar(45) DEFAULT NULL,
`birth` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=25 DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `directed_movie`
--
DROP TABLE IF EXISTS `directed_movie`;
CREATE TABLE IF NOT EXISTS `directed_movie` (
`director_id` int(11) NOT NULL,
`movie_id` int(11) NOT NULL,
`director_type` varchar(45) DEFAULT NULL,
KEY `movie_id` (`movie_id`),
KEY `director_id` (`director_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `director`
--
DROP TABLE IF EXISTS `director`;
CREATE TABLE IF NOT EXISTS `director` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`award` varchar(45) NOT NULL,
`birth` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `distributed_movies`
--
DROP TABLE IF EXISTS `distributed_movies`;
CREATE TABLE IF NOT EXISTS `distributed_movies` (
`distributor_id` int(11) NOT NULL,
`movie_id` int(11) NOT NULL,
`distribution_date` date DEFAULT NULL,
KEY `distributor_id` (`distributor_id`),
KEY `movie_id` (`movie_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `distributor`
--
DROP TABLE IF EXISTS `distributor`;
CREATE TABLE IF NOT EXISTS `distributor` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`location` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `movie`
--
DROP TABLE IF EXISTS `movie`;
CREATE TABLE IF NOT EXISTS `movie` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`rating` varchar(45) DEFAULT NULL,
`released` date NOT NULL,
`duration` int(11) DEFAULT NULL,
`genre` varchar(45) DEFAULT NULL,
`director` int(11) DEFAULT NULL,
`producer` int(11) DEFAULT NULL,
`cast` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `produced_movies`
--
DROP TABLE IF EXISTS `produced_movies`;
CREATE TABLE IF NOT EXISTS `produced_movies` (
`producer_id` int(11) NOT NULL,
`movie_id` int(11) NOT NULL,
`producer_role` varchar(45) DEFAULT NULL,
KEY `producer_id` (`producer_id`),
KEY `movie_id` (`movie_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `producer`
--
DROP TABLE IF EXISTS `producer`;
CREATE TABLE IF NOT EXISTS `producer` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;