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

correction bdd

parent 6dc22d70
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,8 @@ CREATE TABLE robotise.machine (
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
nom_ingredient VARCHAR (50) NOT NULL,
UNIQUE id_bec
);
CREATE TABLE robotise.cocktail (
......@@ -33,11 +34,15 @@ CREATE TABLE robotise.composition (
);
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.machine(id_bec, quantite) VALUES (0, NULL);
INSERT INTO robotise.machine(id_bec, quantite) VALUES (1, NULL);
INSERT INTO robotise.machine(id_bec, quantite) VALUES (2, NULL);
INSERT INTO robotise.machine(id_bec, quantite) VALUES (3, NULL);
INSERT INTO robotise.machine(id_bec, quantite) VALUES (4, NULL);
INSERT INTO robotise.machine(id_bec, quantite) VALUES (5, NULL);
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);
INSERT INTO robotise.composition (id_cocktail, id_ingredient, quantite) VALUES (1, 3, 10);
\ No newline at end of file
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