diff --git a/insert_all_data.sql b/insert_all_data.sql index a9f3e9f..19f9b14 100644 --- a/insert_all_data.sql +++ b/insert_all_data.sql @@ -502,18 +502,11 @@ VALUES ('Here is looking at you, kid.', 'Casablanca', 'Gone with the Wind', 'Citizen Kane', 'The Maltese Falcon', 'Casablanca'); -- INSERTION TABLE Quiz -INSERT INTO Quiz (nb_quest) +INSERT INTO Quiz (title,img,nb_quest) VALUES -(10), -(10), -(10), -(10), -(10), -(10), -(10), -(10), -(10), -(10); +("Titre du quiz n°1",56,4), +("Titre du quiz n°1",100,5); + -- INSERTION TABLE Quiz_Question @@ -522,13 +515,12 @@ VALUES (1, 1), -- Quiz 1, Question 1 (1, 2), -- Quiz 1, Question 2 (1, 3), -- Quiz 1, Question 3 -(2, 1), -- Quiz 2, Question 1 -(2, 4), -- Quiz 2, Question 4 -(3, 2), -- Quiz 3, Question 2 -(3, 5), -- Quiz 3, Question 5 -(4, 6), -- Quiz 4, Question 6 -(5, 3), -- Quiz 5, Question 3 -(5, 7); -- Quiz 5, Question 7 +(1, 4), -- Quiz 1, Question 4 +(2, 5), -- Quiz 2, Question 5 +(2, 6), -- Quiz 2, Question 6 +(2, 7), -- Quiz 2, Question 7 +(2, 8), -- Quiz 2, Question 8 +(2, 9), -- Quiz 2, Question 9 INSERT INTO DailyQuote (citation_id) diff --git a/scripts/init.sql b/scripts/init.sql index aef47bf..4256537 100644 --- a/scripts/init.sql +++ b/scripts/init.sql @@ -48,8 +48,11 @@ CREATE TABLE Question( ); CREATE TABLE Quiz( - id_quiz SERIAL PRIMARY KEY, - nb_quest numeric + id_quiz SERIAL PRIMARY KEY, + title varchar(40) NOT NULL, + img NUMERIC NOT NULL, + nb_quest numeric, + CONSTRAINT fk_img FOREIGN KEY(img) REFERENCES Image(id_img) ); CREATE TABLE Quiz_Question(