diff --git a/readme.md b/readme.md index 0e3659a28a7b3827dd65a9e51979f2844a10a526..2203b98c7e2a1b9de69312c87e1041bd68b4d62e 100644 --- a/readme.md +++ b/readme.md @@ -1,18 +1,14 @@ -# Mini projet Spring boot "TP-QUIZ" +# Starter quiz ## Configuration du projet Le projet utilise les ressources suivantes situées dans le répertoire `src/main/resources` : - `docker-compose.yml` : Ce fichier permet de lancer deux conteneurs Docker, l'un pour MariaDB et l'autre pour phpMyAdmin. - - `quiz.sql` : Ce fichier contient le script SQL pour créer la BDD. - +- `data.sql` : Ce fichier contient le script SQL pour remplir la bdd. - `application.properties` : Ce fichier contient la configuration de Spring Boot . - - - spring.datasource.* => Configuration pour la connexion a la BDD - - - server.servlet.context-path => permet de préfixe les routes par "/api" +- spring.datasource.* => Configuration pour la connexion a la BDD ## Lancer le projet @@ -30,7 +26,7 @@ Le projet utilise les ressources suivantes situées dans le répertoire `src/mai - Mot de passe : root -3. Dans phpMyAdmin, importez le fichier `quiz.sql` pour créer votre schéma de base de données. +3. Dans phpMyAdmin, importez le fichier `quiz.sql` pour créer votre schéma de base de données, puis `data.sql`pour les données. ### Exécution de spring boot diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 94250cb47eabe77945a56f047b0baa0d90b88fc0..b3f41a33b773aae6787b98beaf1b8852adfa99b8 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,4 @@ -spring.datasource.url=jdbc:mariadb://localhost:3307/quiz +spring.datasource.url=jdbc:mariadb://localhost:3308/quiz spring.datasource.username=root spring.datasource.password=root spring.datasource.driver-class-name=org.mariadb.jdbc.Driver -server.servelt.context-path=/api diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql new file mode 100644 index 0000000000000000000000000000000000000000..2ba1c4081e8cbf49c742f4da9735744011890f60 --- /dev/null +++ b/src/main/resources/data.sql @@ -0,0 +1,988 @@ +INSERT INTO categories (name) VALUES + ('Entertainment: Books'), + ('Geography'), + ('Politics'), + ('Entertainment: Board Games'), + ('Entertainment: Japanese Anime & Manga'), + ('Sports'), + ('Mythology'), + ('Science: Gadgets'), + ('Entertainment: Video Games'), + ('Entertainment: Music'), + ('Science: Computers'), + ('Science & Nature'), + ('Entertainment: Cartoon & Animations'), + ('General Knowledge'), + ('Animals'), + ('Vehicles'), + ('Entertainment: Film'), + ('Science: Mathematics'), + ('Entertainment: Television'), + ('History'); + +INSERT INTO questions (question_text, category_id) VALUES + ('The logo for Snapchat is a Bell.', (SELECT id FROM categories WHERE name = 'Science: Computers')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('False', TRUE, @last_question_id), + ('True', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Where was the Games of the XXII Olympiad held?', (SELECT id FROM categories WHERE name = 'Sports')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Moscow', TRUE, @last_question_id), + ('Barcelona', FALSE, @last_question_id), + ('Tokyo', FALSE, @last_question_id), + ('Los Angeles', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which one of the following is NOT a sub-company of the Volkswagen Group?', (SELECT id FROM categories WHERE name = 'Vehicles')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Opel', TRUE, @last_question_id), + ('Porsche', FALSE, @last_question_id), + ('Bugatti', FALSE, @last_question_id), + ('Bentley', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which Beatles album does NOT feature any of the band members on it''s cover?', (SELECT id FROM categories WHERE name = 'Entertainment: Music')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('The Beatles (White Album)', TRUE, @last_question_id), + ('Rubber Soul', FALSE, @last_question_id), + ('Abbey Road', FALSE, @last_question_id), + ('Magical Mystery Tour', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What round is a classic AK-47 chambered in?', (SELECT id FROM categories WHERE name = 'Science: Gadgets')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('7.62x39mm', TRUE, @last_question_id), + ('7.62x51mm', FALSE, @last_question_id), + ('5.56x45mm', FALSE, @last_question_id), + ('5.45x39mm', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What is the name of the album released in 2014 by American band Maroon 5?', (SELECT id FROM categories WHERE name = 'Entertainment: Music')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('V', TRUE, @last_question_id), + ('X', FALSE, @last_question_id), + ('III', FALSE, @last_question_id), + ('IV', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In 2016, the IUCN reclassified the status of Giant Pandas from endangered to vulnerable.', (SELECT id FROM categories WHERE name = 'Animals')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('True', TRUE, @last_question_id), + ('False', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which boxing personality was one of the presenters in the 1999 revival of It''s a Knockout?', (SELECT id FROM categories WHERE name = 'Entertainment: Television')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Frank Bruno', TRUE, @last_question_id), + ('Henry Cooper', FALSE, @last_question_id), + ('Muhammad Ali', FALSE, @last_question_id), + ('Joe Fraiser', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In what year was Tchaikovsky''s 1812 Overture composed?', (SELECT id FROM categories WHERE name = 'Entertainment: Music')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('1880', TRUE, @last_question_id), + ('1812', FALSE, @last_question_id), + ('1790', FALSE, @last_question_id), + ('1840', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What is the name of the copper-rich protein that creates the blue blood in the Antarctic octopus?', (SELECT id FROM categories WHERE name = 'Animals')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Hemocyanin', TRUE, @last_question_id), + ('Cytochrome', FALSE, @last_question_id), + ('Iron', FALSE, @last_question_id), + ('Methionine', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Alan Reed is known for providing the voice of which character?', (SELECT id FROM categories WHERE name = 'Entertainment: Television')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Fred Flintstone', TRUE, @last_question_id), + ('Bugs Bunny', FALSE, @last_question_id), + ('Fangface', FALSE, @last_question_id), + ('G.I. Joe', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which Sanrio character was introduced in 1996?', (SELECT id FROM categories WHERE name = 'Entertainment: Cartoon & Animations')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Pompompurin', TRUE, @last_question_id), + ('My Melody', FALSE, @last_question_id), + ('Badtz-Maru', FALSE, @last_question_id), + ('Kerropi', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What year did Gerald Ford Become President?', (SELECT id FROM categories WHERE name = 'Politics')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('1974', TRUE, @last_question_id), + ('1977', FALSE, @last_question_id), + ('1973', FALSE, @last_question_id), + ('1969', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('How many time zones does China have?', (SELECT id FROM categories WHERE name = 'Geography')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('1', TRUE, @last_question_id), + ('3', FALSE, @last_question_id), + ('4', FALSE, @last_question_id), + ('2', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What was William Frederick Cody better known as?', (SELECT id FROM categories WHERE name = 'History')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Buffalo Bill', TRUE, @last_question_id), + ('Billy the Kid', FALSE, @last_question_id), + ('Wild Bill Hickok', FALSE, @last_question_id), + ('Pawnee Bill', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In the Monster Hunter Series, it is possible to capture Elder Dragons.', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('False', TRUE, @last_question_id), + ('True', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In The Simpsons, which war did Seymour Skinner serve in the USA Army as a Green Beret?', (SELECT id FROM categories WHERE name = 'Entertainment: Cartoon & Animations')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Vietnam War', TRUE, @last_question_id), + ('World War 2', FALSE, @last_question_id), + ('World War 1', FALSE, @last_question_id), + ('Cold War', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Who is the only US president to serve two non-consecutive terms in office?', (SELECT id FROM categories WHERE name = 'Politics')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Grover Cleveland', TRUE, @last_question_id), + ('James K. Polk', FALSE, @last_question_id), + ('Franklin D. Roosevelt', FALSE, @last_question_id), + ('Thomas Jefferson', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('How many partners can you obtain in Paper Mario: The Thousand-Year Door?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('7', TRUE, @last_question_id), + ('6', FALSE, @last_question_id), + ('9', FALSE, @last_question_id), + ('10', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What''s the name of the halloween-related Sims 4 Stuff Pack released September 29th, 2015?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Spooky Stuff', TRUE, @last_question_id), + ('Ghosts n'' Ghouls', FALSE, @last_question_id), + ('Nerving Nights', FALSE, @last_question_id), + ('Fearful Frights', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In the 1968 Cartoon Show "Wacky Races" what was the name of cavemen duo who rode in The Boulder Mobile?', (SELECT id FROM categories WHERE name = 'Entertainment: Cartoon & Animations')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('The Slag Brothers', TRUE, @last_question_id), + ('The Slate Brothers', FALSE, @last_question_id), + ('The Rock Brothers', FALSE, @last_question_id), + ('The Stone Brothers', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What is the world''s most expensive spice by weight?', (SELECT id FROM categories WHERE name = 'General Knowledge')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Saffron', TRUE, @last_question_id), + ('Cinnamon', FALSE, @last_question_id), + ('Cardamom', FALSE, @last_question_id), + ('Vanilla', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which one of these Pink Floyd albums were also a movie?', (SELECT id FROM categories WHERE name = 'Entertainment: Music')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('The Wall', TRUE, @last_question_id), + ('The Dark Side of the Moon', FALSE, @last_question_id), + ('Wish You Were Here', FALSE, @last_question_id), + ('Animals', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('The book 1984 was published in 1949.', (SELECT id FROM categories WHERE name = 'Entertainment: Books')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('True', TRUE, @last_question_id), + ('False', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Who is the frontman of Muse?', (SELECT id FROM categories WHERE name = 'Entertainment: Music')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Matt Bellamy', TRUE, @last_question_id), + ('Dominic Howard', FALSE, @last_question_id), + ('Thom Yorke', FALSE, @last_question_id), + ('Jonny Greenwood', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('The names of Roxas''s Keyblades in Kingdom Hearts are "Oathkeeper" and "Oblivion".', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('True', TRUE, @last_question_id), + ('False', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('The value of one Calorie is different than the value of one calorie.', (SELECT id FROM categories WHERE name = 'Science & Nature')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('True', TRUE, @last_question_id), + ('False', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which souls game was not directed by Hidetaka Miyazaki?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Dark Souls 2', TRUE, @last_question_id), + ('Demon Souls', FALSE, @last_question_id), + ('Dark Souls', FALSE, @last_question_id), + ('Dark Souls 3', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What is the name of Sherlock Holmes''s brother?', (SELECT id FROM categories WHERE name = 'Entertainment: Books')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Mycroft Holmes', TRUE, @last_question_id), + ('Mederi Holmes', FALSE, @last_question_id), + ('Martin Holmes', FALSE, @last_question_id), + ('Herbie Hancock Holmes', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which actor auditioned for the role of Luke Skywalker?', (SELECT id FROM categories WHERE name = 'Entertainment: Film')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Kurt Russell', TRUE, @last_question_id), + ('Christopher Lambert', FALSE, @last_question_id), + ('Laurence Fishburne', FALSE, @last_question_id), + ('James Remar', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which of these animals belongs in class Chondrichthyes?', (SELECT id FROM categories WHERE name = 'Science & Nature')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Great white shark', TRUE, @last_question_id), + ('Octopus', FALSE, @last_question_id), + ('Killer whale', FALSE, @last_question_id), + ('Catfish', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which kind of algorithm is Ron Rivest not famous for creating?', (SELECT id FROM categories WHERE name = 'Science: Computers')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Secret sharing scheme', TRUE, @last_question_id), + ('Hashing algorithm', FALSE, @last_question_id), + ('Asymmetric encryption', FALSE, @last_question_id), + ('Stream cipher', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which female player won the gold medal of table tennis singles in 2016 Olympics Games?', (SELECT id FROM categories WHERE name = 'Sports')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('DING Ning (China)', TRUE, @last_question_id), + ('LI Xiaoxia (China)', FALSE, @last_question_id), + ('Ai FUKUHARA (Japan)', FALSE, @last_question_id), + ('Song KIM (North Korea)', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('How many zeros are there in a googol?', (SELECT id FROM categories WHERE name = 'Science: Mathematics')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('100', TRUE, @last_question_id), + ('10', FALSE, @last_question_id), + ('1,000', FALSE, @last_question_id), + ('1,000,000', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In the show "Futurama" what is Fry''s full name?', (SELECT id FROM categories WHERE name = 'Entertainment: Television')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Philip J. Fry', TRUE, @last_question_id), + ('Fry J. Philip', FALSE, @last_question_id), + ('Fry Rodríguez', FALSE, @last_question_id), + ('Fry Philip', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In "Highschool DxD", Koneko Toujou is from what race?', (SELECT id FROM categories WHERE name = 'Entertainment: Japanese Anime & Manga')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Nekomata', TRUE, @last_question_id), + ('Kitsune', FALSE, @last_question_id), + ('Human', FALSE, @last_question_id), + ('Kappa', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which of these weapon classes DO NOT appear in the first Monster Hunter game?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Bow ', TRUE, @last_question_id), + ('Hammer', FALSE, @last_question_id), + ('Heavy Bowgun', FALSE, @last_question_id), + ('Light Bowgun', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('The Quadrangularis Reversum is best described as which of the following?', (SELECT id FROM categories WHERE name = 'General Knowledge')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('A percussion instrument', TRUE, @last_question_id), + ('A building in Oxford University', FALSE, @last_question_id), + ('A chess move', FALSE, @last_question_id), + ('A geometric theorem', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('The game "Jetpack Joyride" was created by "Redbrick Studios".', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('False', TRUE, @last_question_id), + ('True', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What is the tallest mountain in Canada?', (SELECT id FROM categories WHERE name = 'Geography')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Mount Logan', TRUE, @last_question_id), + ('Mont Tremblant', FALSE, @last_question_id), + ('Whistler Mountain', FALSE, @last_question_id), + ('Blue Mountain', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which is the longest bone in the human body? ', (SELECT id FROM categories WHERE name = 'Science & Nature')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Femur', TRUE, @last_question_id), + ('Scapula', FALSE, @last_question_id), + ('Fibula', FALSE, @last_question_id), + ('Ulna', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In Chobits, Hideki found Chii in his apartment.', (SELECT id FROM categories WHERE name = 'Entertainment: Japanese Anime & Manga')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('False', TRUE, @last_question_id), + ('True', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What year was the Disney film "A Goofy Movie" released?', (SELECT id FROM categories WHERE name = 'Entertainment: Cartoon & Animations')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('1995', TRUE, @last_question_id), + ('1999', FALSE, @last_question_id), + ('2001', FALSE, @last_question_id), + ('1997', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In a standard set of playing cards, which is the only king without a moustache?', (SELECT id FROM categories WHERE name = 'General Knowledge')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Hearts', TRUE, @last_question_id), + ('Spades', FALSE, @last_question_id), + ('Diamonds', FALSE, @last_question_id), + ('Clubs', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('How fast is USB 3.1 Gen 2 theoretically?', (SELECT id FROM categories WHERE name = 'Science: Computers')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('10 Gb/s', TRUE, @last_question_id), + ('5 Gb/s', FALSE, @last_question_id), + ('8 Gb/s', FALSE, @last_question_id), + ('1 Gb/s', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What Nationality is D.Va from Overwatch?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Korean', TRUE, @last_question_id), + ('Japanese', FALSE, @last_question_id), + ('Chinese', FALSE, @last_question_id), + ('Vietnamese ', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Who was the first American in space?', (SELECT id FROM categories WHERE name = 'History')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Alan Shephard', TRUE, @last_question_id), + ('Neil Armstrong', FALSE, @last_question_id), + ('John Glenn', FALSE, @last_question_id), + ('Jim Lovell', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What mythology did the god "Apollo" come from?', (SELECT id FROM categories WHERE name = 'Mythology')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Greek and Roman', TRUE, @last_question_id), + ('Roman and Spanish', FALSE, @last_question_id), + ('Greek and Chinese', FALSE, @last_question_id), + ('Greek, Roman and Norse', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In board games, an additional or ammended rule that applies to a certain group or place is informally known as a "what" rule?', (SELECT id FROM categories WHERE name = 'Entertainment: Board Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('House', TRUE, @last_question_id), + ('Custom', FALSE, @last_question_id), + ('Extra', FALSE, @last_question_id), + ('Change', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('The Western Lowland Gorilla is scientifically know as?', (SELECT id FROM categories WHERE name = 'Science & Nature')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Gorilla Gorilla Gorilla', TRUE, @last_question_id), + ('Gorilla Gorilla Diehli', FALSE, @last_question_id), + ('Gorilla Beringei Graueri', FALSE, @last_question_id), + ('Gorilla Beringei Beringei', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Who plays "Bruce Wayne" in the 2008 movie "The Dark Knight"?', (SELECT id FROM categories WHERE name = 'Entertainment: Film')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Christian Bale', TRUE, @last_question_id), + ('Michael Caine', FALSE, @last_question_id), + ('Ron Dean', FALSE, @last_question_id), + ('Heath Ledger', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('The communication protocol NFC stands for Near-Field Control.', (SELECT id FROM categories WHERE name = 'Science: Gadgets')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('False', TRUE, @last_question_id), + ('True', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('For the film "Raiders of The Lost Ark", what was Harrison Ford sick with during the filming of the Cairo chase?', (SELECT id FROM categories WHERE name = 'Entertainment: Film')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Dysentery', TRUE, @last_question_id), + ('Anemia', FALSE, @last_question_id), + ('Constipation', FALSE, @last_question_id), + ('Acid Reflux ', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What musician made the song "F**kin` Perfect" in 2010?', (SELECT id FROM categories WHERE name = 'Entertainment: Music')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('P!nk', TRUE, @last_question_id), + ('Mitis', FALSE, @last_question_id), + ('Adam lambert', FALSE, @last_question_id), + ('Koven', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Who is the lead singer of Silverchair?', (SELECT id FROM categories WHERE name = 'Entertainment: Music')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Daniel Johns', TRUE, @last_question_id), + ('Ben Gillies', FALSE, @last_question_id), + ('Chris Joannou', FALSE, @last_question_id), + ('George Costanza', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which of the following computer components can be built using only NAND gates?', (SELECT id FROM categories WHERE name = 'Science: Computers')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('ALU', TRUE, @last_question_id), + ('CPU', FALSE, @last_question_id), + ('RAM', FALSE, @last_question_id), + ('Register', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Soccer player Cristiano Ronaldo opened a museum dedicated to himself.', (SELECT id FROM categories WHERE name = 'Sports')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('True', TRUE, @last_question_id), + ('False', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('During WWII, in 1945, the United States dropped atomic bombs on the two Japanese cities of Hiroshima and what other city?', (SELECT id FROM categories WHERE name = 'History')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Nagasaki', TRUE, @last_question_id), + ('Kawasaki', FALSE, @last_question_id), + ('Tokyo', FALSE, @last_question_id), + ('Kagoshima', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In Counter-Strike: Global Offensive, what''s the rarity of discontinued skins called?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Contraband', TRUE, @last_question_id), + ('Discontinued', FALSE, @last_question_id), + ('Diminshed', FALSE, @last_question_id), + ('Limited', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What is the oldest team in Major League Baseball?', (SELECT id FROM categories WHERE name = 'Sports')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Atlanta Braves', TRUE, @last_question_id), + ('Chicago Cubs', FALSE, @last_question_id), + ('Cincinnati Reds', FALSE, @last_question_id), + ('St. Louis Cardinals', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('"Typewriter" is the longest word that can be typed using only the first row on a QWERTY keyboard.', (SELECT id FROM categories WHERE name = 'General Knowledge')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('True', TRUE, @last_question_id), + ('False', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In the "Kagerou Daze" series, Shintaro Kisaragi is prominently shown with the color red.', (SELECT id FROM categories WHERE name = 'Entertainment: Japanese Anime & Manga')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('True', TRUE, @last_question_id), + ('False', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('A ''Millinillion'' is a real number.', (SELECT id FROM categories WHERE name = 'Science: Mathematics')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('True', TRUE, @last_question_id), + ('False', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In AMC''s TV Series "The Walking Dead" what are "Zombies" referred to as?', (SELECT id FROM categories WHERE name = 'Entertainment: Television')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Walkers', TRUE, @last_question_id), + ('Creepers', FALSE, @last_question_id), + ('Maggots', FALSE, @last_question_id), + ('Hell Pigs', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What is the main character''s name in "Braid"?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Tim', TRUE, @last_question_id), + ('Boregard', FALSE, @last_question_id), + ('James', FALSE, @last_question_id), + ('Jackson', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('The Paradox Interactive game "Stellaris" was released in 2016.', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('True', TRUE, @last_question_id), + ('False', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Who won the premier league title in the 2015-2016 season following a fairy tale run?', (SELECT id FROM categories WHERE name = 'Sports')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Leicester City', TRUE, @last_question_id), + ('Tottenham Hotspur', FALSE, @last_question_id), + ('Watford', FALSE, @last_question_id), + ('Stoke City', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In PROTOTYPE 2. who is referred to as "Tango Primary"?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('James Heller', TRUE, @last_question_id), + ('Alex Mercer', FALSE, @last_question_id), + ('Dana Mercer', FALSE, @last_question_id), + ('Any Goliaths roaming around', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('The fictional movie ''Rochelle, Rochelle'' features in which sitcom?', (SELECT id FROM categories WHERE name = 'Entertainment: Television')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Seinfeld', TRUE, @last_question_id), + ('Frasier', FALSE, @last_question_id), + ('Cheers', FALSE, @last_question_id), + ('Friends', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which of the following Copy Abilities was only featured in "Kirby & The Amazing Mirror"?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Mini', TRUE, @last_question_id), + ('Magic', FALSE, @last_question_id), + ('Smash', FALSE, @last_question_id), + ('Missile', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What was Bank of America originally established as?', (SELECT id FROM categories WHERE name = 'General Knowledge')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Bank of Italy', TRUE, @last_question_id), + ('Bank of Long Island', FALSE, @last_question_id), + ('Bank of Pennsylvania', FALSE, @last_question_id), + ('Bank of Charlotte', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which of the following is a character in the video game Destiny?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Cayde-6', TRUE, @last_question_id), + ('Ostrava of Boletaria', FALSE, @last_question_id), + ('Mordecai the Hunter', FALSE, @last_question_id), + ('Leon S. Kennedy', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What film did James Cameron''s Avatar dethrone as the highest-grossing film ever?', (SELECT id FROM categories WHERE name = 'Entertainment: Film')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Titanic', TRUE, @last_question_id), + ('Star Wars', FALSE, @last_question_id), + ('Gone with the Wind', FALSE, @last_question_id), + ('Jaws', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In the Mario Kart series, which game introduced the "Shield Drifting" mechanic?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Mario Kart Arcade GP DX', TRUE, @last_question_id), + ('Mario Kart: Double Dash', FALSE, @last_question_id), + ('Mario Kart Super Circuit', FALSE, @last_question_id), + ('Mario Kart DS', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Shaquille O''Neal appeared in the 1997 film "Space Jam".', (SELECT id FROM categories WHERE name = 'Entertainment: Film')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('False', TRUE, @last_question_id), + ('True', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In Mulan (1998), who is the leader of the Huns?', (SELECT id FROM categories WHERE name = 'Entertainment: Film')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Shan Yu', TRUE, @last_question_id), + ('Chien-Po', FALSE, @last_question_id), + ('Li Shang', FALSE, @last_question_id), + ('Fa Zhou', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('The map featured in Arma 3 named "Altis" is based off of what Greek island?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Lemnos', TRUE, @last_question_id), + ('Ithaca', FALSE, @last_question_id), + ('Naxos', FALSE, @last_question_id), + ('Anafi', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What was the first "Team Fortress 2" update to include a war?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Sniper vs. Spy Update', TRUE, @last_question_id), + ('WAR! Update', FALSE, @last_question_id), + ('Meet Your Match Update', FALSE, @last_question_id), + ('Spy Vs. Engineer Update', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In the video game Overwatch, which playable character is infamous for saying "It''s high noon."?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('McCree', TRUE, @last_question_id), + ('Hanzo', FALSE, @last_question_id), + ('Pharah', FALSE, @last_question_id), + ('Soldier: 76', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('On which planet does the game Freedom Planet (2014) take place?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Avalice', TRUE, @last_question_id), + ('Freedom', FALSE, @last_question_id), + ('Galaxytrail', FALSE, @last_question_id), + ('Shang Mu', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Released in 2001, the first edition of Apple''s Mac OS X operating system (version 10.0) was given what animal code name?', (SELECT id FROM categories WHERE name = 'Science: Computers')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Cheetah', TRUE, @last_question_id), + ('Puma', FALSE, @last_question_id), + ('Tiger', FALSE, @last_question_id), + ('Leopard', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which game is NOT part of the Science Adventure series by 5pb. and Nitroplus?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Occultic; Nine', TRUE, @last_question_id), + ('Steins; Gate', FALSE, @last_question_id), + ('Robotics; Notes', FALSE, @last_question_id), + ('Chaos; Child', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('How many flagship monsters appear in Monster Hunter Gernerations?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('4', TRUE, @last_question_id), + ('1', FALSE, @last_question_id), + ('2', FALSE, @last_question_id), + ('3', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In 1720, England was in massive debt and became involved in the South Sea Bubble. Who was the main mastermind behind it?', (SELECT id FROM categories WHERE name = 'History')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('John Blunt', TRUE, @last_question_id), + ('Daniel Defoe', FALSE, @last_question_id), + ('Robert Harley', FALSE, @last_question_id), + ('John Churchill', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Who played Baron Victor Frankestein in the 1957 Hammer horror film "The Curse of Frankenstein"?', (SELECT id FROM categories WHERE name = 'Entertainment: Film')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Peter Cushing', TRUE, @last_question_id), + ('Boris Karloff', FALSE, @last_question_id), + ('Vincent Price', FALSE, @last_question_id), + ('Lon Chaney Jr.', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('The NVidia GTX 1080 gets its name because it can only render at a 1920x1080 screen resolution.', (SELECT id FROM categories WHERE name = 'Science: Computers')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('False', TRUE, @last_question_id), + ('True', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which element has the atomic number of 7?', (SELECT id FROM categories WHERE name = 'Science & Nature')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Nitrogen', TRUE, @last_question_id), + ('Oxygen', FALSE, @last_question_id), + ('Hydrogen', FALSE, @last_question_id), + ('Neon', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('How many types of quarks are there in the standard model of physics?', (SELECT id FROM categories WHERE name = 'Science & Nature')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('6', TRUE, @last_question_id), + ('2', FALSE, @last_question_id), + ('3', FALSE, @last_question_id), + ('4', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which naval battle was considered the turning point of the Pacific Ocean Theater during World War 2?', (SELECT id FROM categories WHERE name = 'History')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Battle of Midway', TRUE, @last_question_id), + ('Attack on Truk Island', FALSE, @last_question_id), + ('Attack on Pearl Harbor', FALSE, @last_question_id), + ('Battle of the Coral Sea', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What five letter word is the motto of the IBM Computer company?', (SELECT id FROM categories WHERE name = 'Science: Computers')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Think', TRUE, @last_question_id), + ('Click', FALSE, @last_question_id), + ('Logic', FALSE, @last_question_id), + ('Pixel', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which gas forms about 78% of the Earth’s atmosphere?', (SELECT id FROM categories WHERE name = 'Science & Nature')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Nitrogen', TRUE, @last_question_id), + ('Oxygen', FALSE, @last_question_id), + ('Argon', FALSE, @last_question_id), + ('Carbon Dioxide', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which of these programming languages is a low-level language?', (SELECT id FROM categories WHERE name = 'Science: Computers')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Assembly', TRUE, @last_question_id), + ('Python', FALSE, @last_question_id), + ('C#', FALSE, @last_question_id), + ('Pascal', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Pistons were added to Minecraft in Beta 1.5.', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('False', TRUE, @last_question_id), + ('True', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What is the name of the first level in "Call of Duty: World at War"?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Semper Fi', TRUE, @last_question_id), + ('Ring of Steel', FALSE, @last_question_id), + ('Vendetta', FALSE, @last_question_id), + ('Eviction', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('When was the 3rd album "Notes from the Underground" of the band "Hollywood Undead" released?', (SELECT id FROM categories WHERE name = 'Entertainment: Music')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('2013', TRUE, @last_question_id), + ('2011', FALSE, @last_question_id), + ('2014', FALSE, @last_question_id), + ('2009', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('What was the last message of the Dolphins in "The Hitchhiker''s Guide to the Galaxy"?', (SELECT id FROM categories WHERE name = 'Entertainment: Books')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('"So long, and thanks for all the fish."', TRUE, @last_question_id), + ('"The answer is 42."', FALSE, @last_question_id), + ('"Land of the brave."', FALSE, @last_question_id), + ('"Goodbye cruel world!"', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('In the game "Fire Emblem: Shadow Dragon", what is the central protagonist''s name?', (SELECT id FROM categories WHERE name = 'Entertainment: Video Games')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Marth', TRUE, @last_question_id), + ('Roy', FALSE, @last_question_id), + ('Eliwood', FALSE, @last_question_id), + ('Robin', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Who did the score to the original Blade Runner?', (SELECT id FROM categories WHERE name = 'Entertainment: Film')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Vangelis', TRUE, @last_question_id), + ('Kitaro', FALSE, @last_question_id), + ('Yanni', FALSE, @last_question_id), + ('Enya', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('Which species of Brown Bear is not extinct?', (SELECT id FROM categories WHERE name = 'Animals')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('Syrian Brown Bear', TRUE, @last_question_id), + ('California Grizzly Bear', FALSE, @last_question_id), + ('Atlas Bear', FALSE, @last_question_id), + ('Mexican Grizzly Bear', FALSE, @last_question_id); + +INSERT INTO questions (question_text, category_id) VALUES + ('When was Cadillac founded?', (SELECT id FROM categories WHERE name = 'Vehicles')); +SET @last_question_id = LAST_INSERT_ID(); + +INSERT INTO answers (answer_text, correct, question_id) VALUES + ('1902', TRUE, @last_question_id), + ('1964', FALSE, @last_question_id), + ('1898', FALSE, @last_question_id), + ('1985', FALSE, @last_question_id); + diff --git a/src/main/resources/quiz.sql b/src/main/resources/quiz.sql index cb3ec0f80596179c66073076376b5991d658dab7..2b4f9aca06cbc114fbf803cc529d9dee77f176a1 100644 --- a/src/main/resources/quiz.sql +++ b/src/main/resources/quiz.sql @@ -3,17 +3,6 @@ CREATE TABLE IF NOT EXISTS categories ( name TEXT NOT NULL UNIQUE ); -INSERT INTO categories (name) VALUES - ('Géographie'), - ('Histoire'), - ('Science'), - ('Cinéma'), - ('Musique'), - ('Sport'), - ('Informatique'), - ('Cuisine'), - ('Littérature'), - ('Art'); CREATE TABLE IF NOT EXISTS questions ( id INTEGER PRIMARY KEY AUTO_INCREMENT, @@ -36,53 +25,3 @@ CREATE TABLE IF NOT EXISTS users ( lastname TEXT NOT NULL, email TEXT NOT NULL UNIQUE ); - - -INSERT INTO questions (question_text, category_id) -VALUES - ('Question 1', 1), - ('Question 2', 2), - ('Question 3', 3), - ('Question 4', 1), - ('Question 5', 2), - ('Question 6', 3), - ('Question 7', 1), - ('Question 8', 2), - ('Question 9', 3), - ('Question 10', 1); - --- Insérer 30 réponses dans la table "answers" avec une réponse correcte par question -INSERT INTO answers (answer_text, correct, question_id) -VALUES - ('Réponse 1 Question 1', TRUE, 1), - ('Réponse 2 Question 1', FALSE, 1), - ('Réponse 3 Question 1', FALSE, 1), - ('Réponse 1 Question 2', FALSE, 2), - ('Réponse 2 Question 2', TRUE, 2), - ('Réponse 3 Question 2', FALSE, 2), - ('Réponse 1 Question 3', FALSE, 3), - ('Réponse 2 Question 3', FALSE, 3), - ('Réponse 3 Question 3', TRUE, 3), - ('Réponse 1 Question 4', TRUE, 4), - ('Réponse 2 Question 4', FALSE, 4), - ('Réponse 3 Question 4', FALSE, 4), - ('Réponse 1 Question 5', FALSE, 5), - ('Réponse 2 Question 5', TRUE, 5), - ('Réponse 3 Question 5', FALSE, 5), - ('Réponse 1 Question 6', FALSE, 6), - ('Réponse 2 Question 6', FALSE, 6), - ('Réponse 3 Question 6', TRUE, 6), - ('Réponse 1 Question 7', TRUE, 7), - ('Réponse 2 Question 7', FALSE, 7), - ('Réponse 3 Question 7', FALSE, 7), - ('Réponse 1 Question 8', FALSE, 8), - ('Réponse 2 Question 8', TRUE, 8), - ('Réponse 3 Question 8', FALSE, 8), - ('Réponse 1 Question 9', FALSE, 9), - ('Réponse 2 Question 9', FALSE, 9), - ('Réponse 3 Question 9', TRUE, 9), - ('Réponse 1 Question 10', TRUE, 10), - ('Réponse 2 Question 10', FALSE, 10), - ('Réponse 3 Question 10', FALSE, 10); - -