From 2389a72430a6b6d6cf0fe2f9ca5fc38e5831460e Mon Sep 17 00:00:00 2001 From: Adrien Burgun Date: Mon, 27 Feb 2023 15:48:43 +0100 Subject: [PATCH] :tada: First commit --- README.md | 22 +++ cafe/Dockerfile | 6 + cafe/comprend.csv | 91 +++++++++++++ cafe/consommation.csv | 17 +++ cafe/ds52-cafe.sql | 308 ++++++++++++++++++++++++++++++++++++++++++ cafe/facture.csv | 36 +++++ cafe/serveur.csv | 6 + cafe/tables.csv | 7 + 8 files changed, 493 insertions(+) create mode 100644 README.md create mode 100644 cafe/Dockerfile create mode 100644 cafe/comprend.csv create mode 100644 cafe/consommation.csv create mode 100644 cafe/ds52-cafe.sql create mode 100644 cafe/facture.csv create mode 100644 cafe/serveur.csv create mode 100644 cafe/tables.csv diff --git a/README.md b/README.md new file mode 100644 index 0000000..2128433 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# ds52-db + +Database dumps from the DS52 class, in MySQL and Docker form. + +The DS52 class uses shady Windows Server VMs, which contain an equivalently shady installation of Oracle SQL. +The VM is 14GB in size, and has incredibly poor accessibility. + +I managed to dump the databases in [CSV format](https://gist.github.com/adri326/a846a523fd5425888f239e60b660a19f), +and I now import these into a MariaDB database, before dumping this one again into MySQL format, +which can then be imported into other MariaDB instances or into a Docker image of MariaDB. + +The currently-available images are: + +- [`ds52-cafe`](https://hub.docker.com/r/shadamethyst/ds52-cafe) +- *ds52-gescom* (TODO) +- *ds52-course* (TODO) + +## TODO + +- a sql script to automatically import the cafe database +- the gescom database +- the course database \ No newline at end of file diff --git a/cafe/Dockerfile b/cafe/Dockerfile new file mode 100644 index 0000000..d3736cd --- /dev/null +++ b/cafe/Dockerfile @@ -0,0 +1,6 @@ +FROM mariadb:latest +ADD ds52-cafe.sql /docker-entrypoint-initdb.d/ds52-cafe.sql +ENV MARIADB_PASSWORD="cafe" +ENV MARIADB_USER="cafe" +ENV MARIADB_ROOT_PASSWORD="ds52-cafe-root" +ENV MARIADB_DATABASE="cafe" diff --git a/cafe/comprend.csv b/cafe/comprend.csv new file mode 100644 index 0000000..29f9831 --- /dev/null +++ b/cafe/comprend.csv @@ -0,0 +1,91 @@ +"NUMFACTURE","NUMCONS","QTE" +1000,100,3 +1000,101,1 +1001,102,1 +1001,101,2 +1001,105,2 +1002,106,1 +1002,107,1 +1003,106,1 +1003,107,1 +1003,108,1 +1003,110,1 +1003,122,1 +1003,130,1 +1004,100,2 +1004,122,3 +1005,100,2 +1005,108,3 +1005,124,2 +1006,105,2 +1007,102,1 +1007,108,1 +1007,124,2 +1008,102,1 +1008,108,1 +1008,100,3 +1009,108,3 +1009,100,1 +1010,102,1 +1010,124,3 +1011,102,1 +1012,124,3 +1013,102,3 +1013,124,1 +1013,100,1 +1014,102,1 +1014,105,1 +1015,130,4 +1016,107,1 +1017,122,1 +1017,130,4 +1100,101,1 +1100,102,1 +1101,101,2 +1101,105,2 +1102,106,1 +1102,107,1 +1102,122,1 +1103,106,1 +1103,107,1 +1103,108,1 +1103,110,1 +1103,130,1 +1104,100,2 +1104,122,3 +1104,124,2 +1105,100,2 +1105,108,3 +1106,102,1 +1106,105,2 +1107,108,1 +1107,124,2 +1108,102,1 +1108,108,1 +1200,101,3 +1200,106,1 +1200,120,1 +1200,130,1 +1201,101,2 +1201,106,2 +1202,100,1 +1202,101,1 +1202,122,1 +1203,101,1 +1203,102,1 +1203,108,1 +1203,121,1 +1203,130,1 +1204,101,2 +1204,122,3 +1204,124,2 +1205,100,2 +1205,101,3 +1206,101,1 +1206,108,2 +1207,108,1 +1207,110,2 +1207,101,1 +1208,101,1 +1208,108,1 +1207,200,1 diff --git a/cafe/consommation.csv b/cafe/consommation.csv new file mode 100644 index 0000000..b9d48f1 --- /dev/null +++ b/cafe/consommation.csv @@ -0,0 +1,17 @@ +"NUMCONS","LIBCONS","PRIXCONS" +100,"Café",1 +101,"Café double",2 +102,"Café crème",1.6 +105,"Chocolat",2 +106,"Bière pression",2.5 +107,"Bière 25 Cl",2.5 +108,"Bière 33 Cl",3 +110,"Bière 50 Cl",4.5 +120,"Jus de fruit",2 +121,"Fruit pressé",3 +122,"Perrier",2.5 +124,"Orangina",2.7 +130,"Coca Cola",2 +150,"Jus de tomate",2 +200,"Bière Blonde",4.5 +300,"Cocktail",8 diff --git a/cafe/ds52-cafe.sql b/cafe/ds52-cafe.sql new file mode 100644 index 0000000..7be050d --- /dev/null +++ b/cafe/ds52-cafe.sql @@ -0,0 +1,308 @@ +-- MariaDB dump 10.19 Distrib 10.11.2-MariaDB, for Linux (x86_64) +-- +-- Host: localhost Database: cafe +-- ------------------------------------------------------ +-- Server version 10.11.2-MariaDB + +/*!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 */; +/*!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 */; + +-- +-- Table structure for table `comprend` +-- + +DROP TABLE IF EXISTS `comprend`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `comprend` ( + `numfacture` int(11) NOT NULL, + `numcons` int(11) NOT NULL, + `qte` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `comprend` +-- + +LOCK TABLES `comprend` WRITE; +/*!40000 ALTER TABLE `comprend` DISABLE KEYS */; +INSERT INTO `comprend` VALUES +(1000,100,3), +(1000,101,1), +(1001,102,1), +(1001,101,2), +(1001,105,2), +(1002,106,1), +(1002,107,1), +(1003,106,1), +(1003,107,1), +(1003,108,1), +(1003,110,1), +(1003,122,1), +(1003,130,1), +(1004,100,2), +(1004,122,3), +(1005,100,2), +(1005,108,3), +(1005,124,2), +(1006,105,2), +(1007,102,1), +(1007,108,1), +(1007,124,2), +(1008,102,1), +(1008,108,1), +(1008,100,3), +(1009,108,3), +(1009,100,1), +(1010,102,1), +(1010,124,3), +(1011,102,1), +(1012,124,3), +(1013,102,3), +(1013,124,1), +(1013,100,1), +(1014,102,1), +(1014,105,1), +(1015,130,4), +(1016,107,1), +(1017,122,1), +(1017,130,4), +(1100,101,1), +(1100,102,1), +(1101,101,2), +(1101,105,2), +(1102,106,1), +(1102,107,1), +(1102,122,1), +(1103,106,1), +(1103,107,1), +(1103,108,1), +(1103,110,1), +(1103,130,1), +(1104,100,2), +(1104,122,3), +(1104,124,2), +(1105,100,2), +(1105,108,3), +(1106,102,1), +(1106,105,2), +(1107,108,1), +(1107,124,2), +(1108,102,1), +(1108,108,1), +(1200,101,3), +(1200,106,1), +(1200,120,1), +(1200,130,1), +(1201,101,2), +(1201,106,2), +(1202,100,1), +(1202,101,1), +(1202,122,1), +(1203,101,1), +(1203,102,1), +(1203,108,1), +(1203,121,1), +(1203,130,1), +(1204,101,2), +(1204,122,3), +(1204,124,2), +(1205,100,2), +(1205,101,3), +(1206,101,1), +(1206,108,2), +(1207,108,1), +(1207,110,2), +(1207,101,1), +(1208,101,1), +(1208,108,1), +(1207,200,1); +/*!40000 ALTER TABLE `comprend` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `consommation` +-- + +DROP TABLE IF EXISTS `consommation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `consommation` ( + `numcons` int(11) NOT NULL AUTO_INCREMENT, + `libcons` varchar(255) NOT NULL, + `prixcons` decimal(10,2) NOT NULL, + PRIMARY KEY (`numcons`) +) ENGINE=InnoDB AUTO_INCREMENT=301 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `consommation` +-- + +LOCK TABLES `consommation` WRITE; +/*!40000 ALTER TABLE `consommation` DISABLE KEYS */; +INSERT INTO `consommation` VALUES +(100,'Café',1.00), +(101,'Café double',2.00), +(102,'Café crème',1.60), +(105,'Chocolat',2.00), +(106,'Bière pression',2.50), +(107,'Bière 25 Cl',2.50), +(108,'Bière 33 Cl',3.00), +(110,'Bière 50 Cl',4.50), +(120,'Jus de fruit',2.00), +(121,'Fruit pressé',3.00), +(122,'Perrier',2.50), +(124,'Orangina',2.70), +(130,'Coca Cola',2.00), +(150,'Jus de tomate',2.00), +(200,'Bière Blonde',4.50), +(300,'Cocktail',8.00); +/*!40000 ALTER TABLE `consommation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `facture` +-- + +DROP TABLE IF EXISTS `facture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `facture` ( + `numfacture` int(11) NOT NULL AUTO_INCREMENT, + `numtable` int(11) NOT NULL, + `numserveur` int(11) NOT NULL, + `datefacture` date NOT NULL, + PRIMARY KEY (`numfacture`) +) ENGINE=InnoDB AUTO_INCREMENT=1209 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `facture` +-- + +LOCK TABLES `facture` WRITE; +/*!40000 ALTER TABLE `facture` DISABLE KEYS */; +INSERT INTO `facture` VALUES +(1001,5,53,'2005-12-02'), +(1002,3,52,'2005-12-02'), +(1003,5,50,'2005-12-04'), +(1004,4,52,'2005-12-04'), +(1005,1,53,'2005-12-05'), +(1006,3,52,'2005-12-06'), +(1007,5,53,'2005-12-07'), +(1008,7,51,'2005-12-08'), +(1009,1,53,'2005-12-09'), +(1010,5,53,'2005-12-09'), +(1011,3,52,'2005-12-09'), +(1012,5,50,'2005-12-09'), +(1013,4,52,'2005-12-10'), +(1014,1,53,'2005-12-11'), +(1015,3,52,'2005-12-11'), +(1016,5,53,'2005-12-12'), +(1017,7,51,'2005-12-12'), +(1100,1,53,'2006-01-21'), +(1101,5,53,'2006-01-21'), +(1102,3,52,'2006-01-21'), +(1103,5,50,'2006-01-21'), +(1104,4,52,'2006-01-22'), +(1105,1,53,'2006-01-22'), +(1106,3,52,'2006-01-22'), +(1107,5,53,'2006-01-22'), +(1108,7,51,'2006-01-22'), +(1200,1,53,'2006-02-21'), +(1201,5,53,'2006-02-21'), +(1202,3,52,'2006-02-21'), +(1203,5,50,'2006-02-21'), +(1204,4,52,'2006-02-22'), +(1205,1,53,'2006-02-22'), +(1206,3,52,'2006-02-22'), +(1207,5,53,'2006-02-22'), +(1208,7,51,'2006-02-22'); +/*!40000 ALTER TABLE `facture` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `serveur` +-- + +DROP TABLE IF EXISTS `serveur`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `serveur` ( + `numserveur` int(11) NOT NULL AUTO_INCREMENT, + `nomserveur` varchar(255) NOT NULL, + `rueserveur` varchar(255) NOT NULL, + `cpserveur` int(11) NOT NULL, + `villeserveur` varchar(255) NOT NULL, + `datenserveur` date NOT NULL, + `email` varchar(255) NOT NULL, + PRIMARY KEY (`numserveur`) +) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `serveur` +-- + +LOCK TABLES `serveur` WRITE; +/*!40000 ALTER TABLE `serveur` DISABLE KEYS */; +INSERT INTO `serveur` VALUES +(50,'Durant Pierre','3 Rue des Lilas',90000,'BELFORT','1976-12-10','p.durant@lecafe.fr'), +(51,'Duchemin Paul','25 Avenue ROOSEVELT',90100,'DELLE','1978-06-05','p.duchemin@lecafe.fr'), +(52,'Martin Cathy','46 Grande rue',90500,'BAVILLIERS','1976-09-03','c.martin@lecafe.fr'), +(53,'Pillot Alain','5 Impasse Martin',90000,'BELFORT','1976-08-09','a.pillot@lecafe.fr'), +(54,'Séré Alain','Place des ducs',21000,'DIJON','1973-10-11','a.sere@lecafe.fr'); +/*!40000 ALTER TABLE `serveur` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `tables` +-- + +DROP TABLE IF EXISTS `tables`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `tables` ( + `numtable` int(11) NOT NULL AUTO_INCREMENT, + `nomtable` varchar(255) NOT NULL, + `numplace` int(11) NOT NULL, + PRIMARY KEY (`numtable`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `tables` +-- + +LOCK TABLES `tables` WRITE; +/*!40000 ALTER TABLE `tables` DISABLE KEYS */; +INSERT INTO `tables` VALUES +(1,'Entree-gche',6), +(3,'Fenetre1',3), +(4,'Fenetre2',8), +(5,'Fenetre3',4), +(6,'Fond-gche',4), +(7,'Fond-dte',2); +/*!40000 ALTER TABLE `tables` 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 2023-02-27 10:30:24 diff --git a/cafe/facture.csv b/cafe/facture.csv new file mode 100644 index 0000000..9c3ec6a --- /dev/null +++ b/cafe/facture.csv @@ -0,0 +1,36 @@ +1000,1,53,"01-DEC-05" +1001,5,53,"02-DEC-05" +1002,3,52,"02-DEC-05" +1003,5,50,"04-DEC-05" +1004,4,52,"04-DEC-05" +1005,1,53,"05-DEC-05" +1006,3,52,"06-DEC-05" +1007,5,53,"07-DEC-05" +1008,7,51,"08-DEC-05" +1009,1,53,"09-DEC-05" +1010,5,53,"09-DEC-05" +1011,3,52,"09-DEC-05" +1012,5,50,"09-DEC-05" +1013,4,52,"10-DEC-05" +1014,1,53,"11-DEC-05" +1015,3,52,"11-DEC-05" +1016,5,53,"12-DEC-05" +1017,7,51,"12-DEC-05" +1100,1,53,"21-JAN-06" +1101,5,53,"21-JAN-06" +1102,3,52,"21-JAN-06" +1103,5,50,"21-JAN-06" +1104,4,52,"22-JAN-06" +1105,1,53,"22-JAN-06" +1106,3,52,"22-JAN-06" +1107,5,53,"22-JAN-06" +1108,7,51,"22-JAN-06" +1200,1,53,"21-FEB-06" +1201,5,53,"21-FEB-06" +1202,3,52,"21-FEB-06" +1203,5,50,"21-FEB-06" +1204,4,52,"22-FEB-06" +1205,1,53,"22-FEB-06" +1206,3,52,"22-FEB-06" +1207,5,53,"22-FEB-06" +1208,7,51,"22-FEB-06" diff --git a/cafe/serveur.csv b/cafe/serveur.csv new file mode 100644 index 0000000..46ba256 --- /dev/null +++ b/cafe/serveur.csv @@ -0,0 +1,6 @@ +"NUMSERVEUR","NOMSERVEUR","RUESERVEUR","CPSERVEUR","VILLESERVEUR","DATENSERVEUR","EMAIL" +50,"Durant Pierre","3 Rue des Lilas",90000,"BELFORT","10-DEC-76","p.durant@lecafe.fr" +51,"Duchemin Paul","25 Avenue ROOSEVELT",90100,"DELLE","05-JUN-78","p.duchemin@lecafe.fr" +52,"Martin Cathy","46 Grande rue",90500,"BAVILLIERS","03-SEP-76","c.martin@lecafe.fr" +53,"Pillot Alain","5 Impasse Martin",90000,"BELFORT","09-AUG-76","a.pillot@lecafe.fr" +54,"Séré Alain","Place des ducs",21000,"DIJON","11-OCT-73","a.sere@lecafe.fr" diff --git a/cafe/tables.csv b/cafe/tables.csv new file mode 100644 index 0000000..804923a --- /dev/null +++ b/cafe/tables.csv @@ -0,0 +1,7 @@ +"NUMTABLE","NOMTABLE","NBPLACE" +1,"Entree-gche",6 +3,"Fenetre1",3 +4,"Fenetre2",8 +5,"Fenetre3",4 +6,"Fond-gche",4 +7,"Fond-dte",2