· 8 years ago · Jan 18, 2018, 11:56 AM
1-- MySQL dump 10.13 Distrib 5.7.20, for Win64 (x86_64)
2--
3-- Host: localhost Database: festival
4-- ------------------------------------------------------
5-- Server version 5.7.20-log
6/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
7/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
8/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
9/*!40101 SET NAMES utf8 */;
10/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
11/*!40103 SET TIME_ZONE='+00:00' */;
12/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
13/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
14/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
15/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
16--
17-- Table structure for table `actor`
18--
19DROP TABLE IF EXISTS `actor`;
20/*!40101 SET @saved_cs_client = @@character_set_client */;
21/*!40101 SET character_set_client = utf8 */;
22CREATE TABLE `actor` (
23 `id` int(11) NOT NULL,
24 `first_name` varchar(45) NOT NULL,
25 `last_name` varchar(45) NOT NULL,
26 `birthdate` date NOT NULL,
27 `sex` varchar(1) NOT NULL,
28 PRIMARY KEY (`id`)
29) ENGINE=InnoDB DEFAULT CHARSET=utf8;
30/*!40101 SET character_set_client = @saved_cs_client */;
31--
32-- Table structure for table `attendees`
33--
34DROP TABLE IF EXISTS `attendees`;
35/*!40101 SET @saved_cs_client = @@character_set_client */;
36/*!40101 SET character_set_client = utf8 */;
37CREATE TABLE `attendees` (
38 `id` int(11) NOT NULL,
39 `attendee_type` varchar(45) NOT NULL,
40 `first_name` varchar(45) NOT NULL,
41 `last_name` varchar(45) NOT NULL,
42 `birthdate` date NOT NULL,
43 `sex` varchar(1) NOT NULL,
44 `address` varchar(200) NOT NULL,
45 `badge_id` int(11) NOT NULL,
46 `helped_by_employee_id` int(11) DEFAULT NULL,
47 PRIMARY KEY (`id`),
48 KEY `badge_id_idx` (`badge_id`),
49 KEY `helped_by_employee_id_idx` (`helped_by_employee_id`),
50 CONSTRAINT `badge_id` FOREIGN KEY (`badge_id`) REFERENCES `badge` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
51 CONSTRAINT `helped_by_employee_id` FOREIGN KEY (`helped_by_employee_id`) REFERENCES `employee` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
52) ENGINE=InnoDB DEFAULT CHARSET=utf8;
53/*!40101 SET character_set_client = @saved_cs_client */;
54--
55-- Table structure for table `badge`
56--
57DROP TABLE IF EXISTS `badge`;
58/*!40101 SET @saved_cs_client = @@character_set_client */;
59/*!40101 SET character_set_client = utf8 */;
60CREATE TABLE `badge` (
61 `id` int(11) NOT NULL,
62 `release_time` datetime NOT NULL,
63 `release_employee_id` int(11) NOT NULL,
64 PRIMARY KEY (`id`),
65 KEY `release_employee_id_idx` (`release_employee_id`),
66 CONSTRAINT `release_employee_id` FOREIGN KEY (`release_employee_id`) REFERENCES `employee` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
67) ENGINE=InnoDB DEFAULT CHARSET=utf8;
68/*!40101 SET character_set_client = @saved_cs_client */;
69--
70-- Table structure for table `cast`
71--
72DROP TABLE IF EXISTS `cast`;
73/*!40101 SET @saved_cs_client = @@character_set_client */;
74/*!40101 SET character_set_client = utf8 */;
75CREATE TABLE `cast` (
76 `id` int(11) NOT NULL,
77 `movie_id` int(11) NOT NULL,
78 `actor_id` int(11) NOT NULL,
79 `role` varchar(45) DEFAULT NULL,
80 PRIMARY KEY (`id`),
81 KEY `actor_id_idx` (`actor_id`),
82 CONSTRAINT `actor_id` FOREIGN KEY (`actor_id`) REFERENCES `actor` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
83) ENGINE=InnoDB DEFAULT CHARSET=utf8;
84/*!40101 SET character_set_client = @saved_cs_client */;
85--
86-- Table structure for table `employee`
87--
88DROP TABLE IF EXISTS `employee`;
89/*!40101 SET @saved_cs_client = @@character_set_client */;
90/*!40101 SET character_set_client = utf8 */;
91CREATE TABLE `employee` (
92 `id` int(11) NOT NULL,
93 `first_name` varchar(45) NOT NULL,
94 `last_name` varchar(45) NOT NULL,
95 `birthdate` date NOT NULL,
96 `address` varchar(200) NOT NULL,
97 `sex` varchar(1) NOT NULL,
98 `salary` int(10) unsigned DEFAULT NULL,
99 `employee_type` varchar(45) NOT NULL,
100 `start_date` date DEFAULT NULL,
101 `end_date` date DEFAULT NULL,
102 PRIMARY KEY (`id`)
103) ENGINE=InnoDB DEFAULT CHARSET=utf8;
104/*!40101 SET character_set_client = @saved_cs_client */;
105--
106-- Table structure for table `movie`
107--
108DROP TABLE IF EXISTS `movie`;
109/*!40101 SET @saved_cs_client = @@character_set_client */;
110/*!40101 SET character_set_client = utf8 */;
111CREATE TABLE `movie` (
112 `id` int(11) NOT NULL,
113 `title` varchar(45) NOT NULL,
114 `release_year` year(4) NOT NULL,
115 `track_id` int(11) NOT NULL,
116 PRIMARY KEY (`id`),
117 KEY `'track_id_idx` (`track_id`),
118 CONSTRAINT `'track_id` FOREIGN KEY (`track_id`) REFERENCES `track` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
119) ENGINE=InnoDB DEFAULT CHARSET=utf8;
120/*!40101 SET character_set_client = @saved_cs_client */;
121--
122-- Table structure for table `prize_types`
123--
124DROP TABLE IF EXISTS `prize_types`;
125/*!40101 SET @saved_cs_client = @@character_set_client */;
126/*!40101 SET character_set_client = utf8 */;
127CREATE TABLE `prize_types` (
128 `id` int(11) NOT NULL,
129 `title` varchar(200) NOT NULL,
130 PRIMARY KEY (`id`),
131 UNIQUE KEY `title_UNIQUE` (`title`)
132) ENGINE=InnoDB DEFAULT CHARSET=utf8;
133/*!40101 SET character_set_client = @saved_cs_client */;
134--
135-- Table structure for table `prizes`
136--
137DROP TABLE IF EXISTS `prizes`;
138/*!40101 SET @saved_cs_client = @@character_set_client */;
139/*!40101 SET character_set_client = utf8 */;
140CREATE TABLE `prizes` (
141 `id` int(11) NOT NULL,
142 `prize_type_id` int(11) NOT NULL,
143 `movie_id` int(11) DEFAULT NULL,
144 `actor_id` int(11) NOT NULL,
145 `time_given` datetime NOT NULL,
146 PRIMARY KEY (`id`),
147 KEY `prize_type_id_idx` (`prize_type_id`),
148 KEY `movie_id_idx` (`movie_id`),
149 KEY `actor_id_idx` (`actor_id`)
150) ENGINE=InnoDB DEFAULT CHARSET=utf8;
151/*!40101 SET character_set_client = @saved_cs_client */;
152--
153-- Table structure for table `showing`
154--
155DROP TABLE IF EXISTS `showing`;
156/*!40101 SET @saved_cs_client = @@character_set_client */;
157/*!40101 SET character_set_client = utf8 */;
158CREATE TABLE `showing` (
159 `id` int(11) NOT NULL,
160 `movie_id` int(11) NOT NULL,
161 `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
162 `room` varchar(45) NOT NULL,
163 `revenue` int(11) NOT NULL,
164 `audience_type` varchar(45) NOT NULL,
165 `presented_by_attendee_id` int(11) DEFAULT NULL,
166 PRIMARY KEY (`id`),
167 KEY `presented_by_attendee_id_idx` (`presented_by_attendee_id`),
168 KEY `movie_id_idx` (`movie_id`),
169 CONSTRAINT `presented_by_attendee_id` FOREIGN KEY (`presented_by_attendee_id`) REFERENCES `attendees` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
170) ENGINE=InnoDB DEFAULT CHARSET=utf8;
171/*!40101 SET character_set_client = @saved_cs_client */;
172--
173-- Table structure for table `track`
174--
175DROP TABLE IF EXISTS `track`;
176/*!40101 SET @saved_cs_client = @@character_set_client */;
177/*!40101 SET character_set_client = utf8 */;
178CREATE TABLE `track` (
179 `id` int(11) NOT NULL,
180 `theme` varchar(45) NOT NULL DEFAULT 'competition track',
181 PRIMARY KEY (`id`)
182) ENGINE=InnoDB DEFAULT CHARSET=utf8;
183/*!40101 SET character_set_client = @saved_cs_client */;
184/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
185/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
186/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
187/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
188/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
189/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
190/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
191/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
192-- Dump completed on 2018-01-16 16:02:26