Skip to content

Instantly share code, notes, and snippets.

@saraclima
Created November 8, 2017 16:43
Show Gist options
  • Save saraclima/ed1cc93ff2abaa8772b990789819d847 to your computer and use it in GitHub Desktop.
Save saraclima/ed1cc93ff2abaa8772b990789819d847 to your computer and use it in GitHub Desktop.
Quete BDD numero 2
-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64)
--
-- Host: localhost Database: db_name
-- ------------------------------------------------------
-- Server version 5.7.20-0ubuntu0.16.04.1
/*!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 utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Current Database: `db_name`
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db_name` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `db_name`;
--
-- Table structure for table `enseigne_langages`
--
DROP TABLE IF EXISTS `enseigne_langages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `enseigne_langages` (
`ID_personne` int(11) DEFAULT NULL,
`ID_lang` int(11) DEFAULT NULL,
KEY `ID_personne` (`ID_personne`),
KEY `ID_lang` (`ID_lang`),
CONSTRAINT `enseigne_langages_ibfk_1` FOREIGN KEY (`ID_personne`) REFERENCES `personne` (`ID_personne`),
CONSTRAINT `enseigne_langages_ibfk_2` FOREIGN KEY (`ID_lang`) REFERENCES `langages` (`ID_lang`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `enseigne_langages`
--
LOCK TABLES `enseigne_langages` WRITE;
/*!40000 ALTER TABLE `enseigne_langages` DISABLE KEYS */;
INSERT INTO `enseigne_langages` VALUES (1,5),(2,3),(4,4),(6,1),(8,6),(9,4),(10,7);
/*!40000 ALTER TABLE `enseigne_langages` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `langages`
--
DROP TABLE IF EXISTS `langages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `langages` (
`ID_lang` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ID_lang`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `langages`
--
LOCK TABLES `langages` WRITE;
/*!40000 ALTER TABLE `langages` DISABLE KEYS */;
INSERT INTO `langages` VALUES (1,'php'),(2,'python'),(3,'ruby'),(4,'javascript'),(5,'java'),(6,'c++'),(7,'html');
/*!40000 ALTER TABLE `langages` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `personne`
--
DROP TABLE IF EXISTS `personne`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `personne` (
`ID_personne` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(255) DEFAULT NULL,
`prenom` varchar(255) DEFAULT NULL,
`ID_role` int(11) DEFAULT NULL,
PRIMARY KEY (`ID_personne`),
KEY `ID_role` (`ID_role`),
CONSTRAINT `personne_ibfk_1` FOREIGN KEY (`ID_role`) REFERENCES `role` (`ID_role`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `personne`
--
LOCK TABLES `personne` WRITE;
/*!40000 ALTER TABLE `personne` DISABLE KEYS */;
INSERT INTO `personne` VALUES (1,'Google','Inc',1),(2,'Laurie','Marmelade',1),(3,'Dyana','Bitschey',2),(4,'Nam','Get',1),(5,'Samia','Sashay Away',2),(6,'Cindy','Cosima',1),(7,'Cyril','DelRio',2),(8,'Trinity-K','Bonet',1),(9,'RuPaul','DragRace',1),(10,'Laganja','Strandja',1);
/*!40000 ALTER TABLE `personne` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `reservation`
--
DROP TABLE IF EXISTS `reservation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `reservation` (
`ID_reservation` int(11) NOT NULL AUTO_INCREMENT,
`date_reservation` datetime DEFAULT NULL,
`ID_salle` int(11) DEFAULT NULL,
`ID_personne` int(11) DEFAULT NULL,
PRIMARY KEY (`ID_reservation`),
KEY `ID_salle` (`ID_salle`),
KEY `ID_personne` (`ID_personne`),
CONSTRAINT `reservation_ibfk_1` FOREIGN KEY (`ID_salle`) REFERENCES `salle` (`ID_salle`),
CONSTRAINT `reservation_ibfk_2` FOREIGN KEY (`ID_personne`) REFERENCES `personne` (`ID_personne`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `reservation`
--
LOCK TABLES `reservation` WRITE;
/*!40000 ALTER TABLE `reservation` DISABLE KEYS */;
INSERT INTO `reservation` VALUES (3,'1986-12-12 21:00:00',1,1),(6,'1954-02-02 13:00:00',1,3),(7,'2011-10-02 13:00:00',1,3),(8,'2013-12-10 10:00:00',5,4),(9,'2014-12-08 10:00:00',5,5),(10,'2010-10-08 14:00:00',3,6),(11,'2013-01-12 10:00:00',6,7),(12,'2015-08-02 09:00:00',6,8),(13,'2016-11-11 09:00:00',6,9),(14,'2017-12-01 16:20:00',6,10);
/*!40000 ALTER TABLE `reservation` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `role`
--
DROP TABLE IF EXISTS `role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role` (
`ID_role` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(70) DEFAULT NULL,
PRIMARY KEY (`ID_role`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `role`
--
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
INSERT INTO `role` VALUES (1,'Enseignant'),(2,'Eleve');
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `salle`
--
DROP TABLE IF EXISTS `salle`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `salle` (
`ID_salle` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(255) DEFAULT NULL,
`numero_salle` int(11) DEFAULT NULL,
PRIMARY KEY (`ID_salle`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `salle`
--
LOCK TABLES `salle` WRITE;
/*!40000 ALTER TABLE `salle` DISABLE KEYS */;
INSERT INTO `salle` VALUES (1,'Salle de dojo',11),(2,'Salle de reunion',12),(3,'Salle de repos',13),(4,'Cuisine',14),(5,'Bureau',15),(6,'OpenSpace',16);
/*!40000 ALTER TABLE `salle` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-11-08 17:39:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment