Skip to content
Snippets Groups Projects
Commit 6dc22d70 authored by Adrien Chabod's avatar Adrien Chabod
Browse files

nouveau projet

parent 7eae8d32
No related branches found
No related tags found
No related merge requests found
File added
File added
bdd.sql 0 → 100644
DROP DATABASE IF EXISTS robotise;
CREATE DATABASE robotise;
DROP USER IF EXISTS 'robotise'@'localhost';
CREATE USER 'robotise'@'localhost' IDENTIFIED BY 'a693bc7501ca6755ce67329132f581ca';
GRANT ALL PRIVILEGES ON robotise.* TO 'robotise'@'localhost';
FLUSH PRIVILEGES;
CREATE TABLE robotise.machine (
id_bec INT NOT NULL PRIMARY KEY,
quantite INT
);
CREATE TABLE robotise.ingredient (
id_ingredient INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
id_bec INT REFERENCES machine(id_bec),
nom_ingredient VARCHAR (50) NOT NULL
);
CREATE TABLE robotise.cocktail (
id_cocktail INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
nom_cocktail VARCHAR (50) NOT NULL
);
CREATE TABLE robotise.composition (
id_cocktail INT REFERENCES cocktail(id_cocktail),
id_ingredient INT REFERENCES ingredient(id_ingredient),
quantite INT
);
INSERT INTO robotise.cocktail (nom_cocktail) VALUES ('sex on the beach');
INSERT INTO robotise.machine(id_bec, quantite) VALUES (1, 50);
INSERT INTO robotise.machine(id_bec, quantite) VALUES (2, 50);
INSERT INTO robotise.ingredient (id_bec, nom_ingredient) VALUES (1, 'vodka');
INSERT INTO robotise.ingredient (id_bec, nom_ingredient) VALUES (2, 'ananas');
INSERT INTO robotise.ingredient (id_bec, nom_ingredient) VALUES (NULL, 'cramberry');
INSERT INTO robotise.composition (id_cocktail, id_ingredient, quantite) VALUES (1, 1, 3);
INSERT INTO robotise.composition (id_cocktail, id_ingredient, quantite) VALUES (1, 2, 6);
INSERT INTO robotise.composition (id_cocktail, id_ingredient, quantite) VALUES (1, 3, 10);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment