· 8 years ago · Apr 05, 2018, 02:14 AM
1DROP TABLE IF EXISTS `Reservation`;
2/*!40101 SET @saved_cs_client = @@character_set_client */;
3/*!40101 SET character_set_client = utf8 */;
4CREATE TABLE `Reservation` (
5 `datetime` date NOT NULL,
6 `duration` int(11) NOT NULL,
7 `person_id` int(11) NOT NULL,
8 `room_id` int(11) NOT NULL,
9 PRIMARY KEY (`person_id`,`room_id`),
10 KEY `FK_Reservation_room_id` (`room_id`),
11 CONSTRAINT `FK_Reservation_person_id` FOREIGN KEY (`person_id`) REFERENCES `Person` (`person_id`),
12 CONSTRAINT `FK_Reservation_room_id` FOREIGN KEY (`room_id`) REFERENCES `Room` (`room_id`)
13) ENGINE=InnoDB DEFAULT CHARSET=latin1;
14/*!40101 SET character_set_client = @saved_cs_client */;
15
16--
17-- Dumping data for table `Reservation`
18--
19
20LOCK TABLES `Reservation` WRITE;
21/*!40000 ALTER TABLE `Reservation` DISABLE KEYS */;
22INSERT INTO `Reservation` VALUES ('2018-01-02',30,1,1),('2018-04-02',30,2,1),('2018-05-02',30,3,1),('2018-06-06',40,4,5),('2018-07-07',45,5,5),('2018-08-10',50,6,3),('2018-08-10',50,7,6),('2018-10-10',55,8,6),('2018-11-10',55,9,6),('2018-11-10',40,10,6);
23/*!40000 ALTER TABLE `Reservation` ENABLE KEYS */;
24UNLOCK TABLES;
25
26--
27-- Table structure for table `Room`
28--
29
30DROP TABLE IF EXISTS `Room`;
31/*!40101 SET @saved_cs_client = @@character_set_client */;
32/*!40101 SET character_set_client = utf8 */;
33CREATE TABLE `Room` (
34 `room_id` int(11) NOT NULL AUTO_INCREMENT,
35 `name` varchar(25) NOT NULL,
36 PRIMARY KEY (`room_id`)
37) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
38/*!40101 SET character_set_client = @saved_cs_client */;
39
40--
41-- Dumping data for table `Room`
42--
43
44LOCK TABLES `Room` WRITE;
45/*!40000 ALTER TABLE `Room` DISABLE KEYS */;
46INSERT INTO `Room` VALUES (1,'Salle de Dojo'),(2,'Salle de réunion'),(3,'Salle de repos'),(4,'Cuisine'),(5,'Bureau'),(6,'OpenSpace');
47/*!40000 ALTER TABLE `Room` ENABLE KEYS */;
48UNLOCK TABLES;
49/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
50
51/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
52/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
53/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
54/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
55/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
56/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
57/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
58
59-- Dump completed on 2018-03-27 18:12:12