· 8 years ago · Apr 13, 2018, 09:40 AM
1-- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64)
2--
3-- Host: localhost Database: school
4-- ------------------------------------------------------
5-- Server version 5.7.21-0ubuntu0.16.04.1
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10/*!40101 SET NAMES utf8 */;
11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12/*!40103 SET TIME_ZONE='+00:00' */;
13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18--
19-- Current Database: `school`
20--
21
22CREATE DATABASE /*!32312 IF NOT EXISTS*/ `school` /*!40100 DEFAULT CHARACTER SET latin1 */;
23
24USE `school`;
25
26--
27-- Table structure for table `reserve`
28--
29
30DROP TABLE IF EXISTS `reserve`;
31/*!40101 SET @saved_cs_client = @@character_set_client */;
32/*!40101 SET character_set_client = utf8 */;
33CREATE TABLE `reserve` (
34 `id` int(11) NOT NULL AUTO_INCREMENT,
35 `day` date DEFAULT NULL,
36 `hour` time DEFAULT NULL,
37 `duration` int(11) DEFAULT NULL,
38 `user_id` int(11) DEFAULT NULL,
39 `room_id` int(11) DEFAULT NULL,
40 PRIMARY KEY (`id`),
41 KEY `user_id` (`user_id`),
42 KEY `room_id` (`room_id`),
43 CONSTRAINT `reserve_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`dossier`),
44 CONSTRAINT `reserve_ibfk_2` FOREIGN KEY (`room_id`) REFERENCES `room` (`id`)
45) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
46/*!40101 SET character_set_client = @saved_cs_client */;
47
48--
49-- Dumping data for table `reserve`
50--
51
52LOCK TABLES `reserve` WRITE;
53/*!40000 ALTER TABLE `reserve` DISABLE KEYS */;
54INSERT INTO `reserve` VALUES (1,'2018-04-24','10:00:00',30,1,1),(3,'2018-04-28','14:00:00',30,3,1),(4,'2018-04-28','15:00:00',45,4,1),(5,'2018-04-28','17:00:00',60,2,5),(6,'2018-04-28','18:00:00',30,5,3),(7,'2018-04-30','10:00:00',30,6,6),(8,'2018-04-30','12:00:00',30,7,6),(9,'2018-05-02','14:00:00',60,8,5),(10,'2018-05-02','15:00:00',60,9,6),(11,'2018-05-02','17:00:00',60,10,6);
55/*!40000 ALTER TABLE `reserve` ENABLE KEYS */;
56UNLOCK TABLES;
57
58--
59-- Table structure for table `room`
60--
61
62DROP TABLE IF EXISTS `room`;
63/*!40101 SET @saved_cs_client = @@character_set_client */;
64/*!40101 SET character_set_client = utf8 */;
65CREATE TABLE `room` (
66 `id` int(11) NOT NULL AUTO_INCREMENT,
67 `name` varchar(100) DEFAULT NULL,
68 PRIMARY KEY (`id`)
69) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
70/*!40101 SET character_set_client = @saved_cs_client */;
71
72--
73-- Dumping data for table `room`
74--
75
76LOCK TABLES `room` WRITE;
77/*!40000 ALTER TABLE `room` DISABLE KEYS */;
78INSERT INTO `room` VALUES (1,'dojo'),(2,'meeting'),(3,'rest'),(4,'kitchen'),(5,'office'),(6,'openspace');
79/*!40000 ALTER TABLE `room` ENABLE KEYS */;
80UNLOCK TABLES;
81
82--
83-- Table structure for table `users`
84--
85
86DROP TABLE IF EXISTS `users`;
87/*!40101 SET @saved_cs_client = @@character_set_client */;
88/*!40101 SET character_set_client = utf8 */;
89CREATE TABLE `users` (
90 `dossier` int(11) NOT NULL AUTO_INCREMENT,
91 `firstname` varchar(100) DEFAULT NULL,
92 `lastname` varchar(100) DEFAULT NULL,
93 `adress` text,
94 `language` varchar(100) DEFAULT NULL,
95 PRIMARY KEY (`dossier`)
96) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
97/*!40101 SET character_set_client = @saved_cs_client */;
98
99--
100-- Dumping data for table `users`
101--
102
103LOCK TABLES `users` WRITE;
104/*!40000 ALTER TABLE `users` DISABLE KEYS */;
105INSERT INTO `users` VALUES (1,'Pierrick','Quetille','Bordeaux','JS'),(2,'Cedric','Seng','Lormont','JS'),(3,'Kevin','Loiseau','Bordeaux','PHP'),(4,'Benjamin','Seurin','Bordeaux','JS'),(5,'Fanny','Gaudin','Bordeaux','JS'),(6,'Amelie','Barboteau','Bordeaux','JS'),(7,'Maxime','Ordonnez','Arcachon','PHP'),(8,'Axel','Fertinel','Lille','PHP'),(9,'Sebastien','Rose','Bordeaux','PHP'),(10,'Valentin','Bz','Pessac','JS');
106/*!40000 ALTER TABLE `users` ENABLE KEYS */;
107UNLOCK TABLES;
108/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
109
110/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
111/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
112/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
113/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
114/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
115/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
116/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
117
118-- Dump completed on 2018-04-05 10:43:03