| 1 | truncate table administrator restart identity cascade;
|
|---|
| 2 | truncate table attempt restart identity cascade;
|
|---|
| 3 | truncate table badge restart identity cascade;
|
|---|
| 4 | truncate table badge_is_awarded_to_quiztaker restart identity cascade;
|
|---|
| 5 | truncate table category restart identity cascade;
|
|---|
| 6 | truncate table choice restart identity cascade;
|
|---|
| 7 | truncate table hint restart identity cascade;
|
|---|
| 8 | truncate table user_table restart identity cascade;
|
|---|
| 9 | truncate table medal restart identity cascade;
|
|---|
| 10 | truncate table medal_is_awarded_to_quiztaker restart identity cascade;
|
|---|
| 11 | truncate table moderator restart identity cascade;
|
|---|
| 12 | truncate table question restart identity cascade;
|
|---|
| 13 | truncate table question_is_part_of_quiz restart identity cascade;
|
|---|
| 14 | truncate table quiz restart identity cascade;
|
|---|
| 15 | truncate table quiz_is_part_of_tournament restart identity cascade;
|
|---|
| 16 | truncate table quiztaker restart identity cascade;
|
|---|
| 17 | truncate table quiztaker_participates_in_tournament restart identity cascade;
|
|---|
| 18 | truncate table quiztaker_participates_in_tournamentphase restart identity cascade;
|
|---|
| 19 | truncate table result_table restart identity cascade;
|
|---|
| 20 | truncate table selectedchoice restart identity cascade;
|
|---|
| 21 | truncate table selectionquestion restart identity cascade;
|
|---|
| 22 | truncate table subject restart identity cascade;
|
|---|
| 23 | truncate table textquestion restart identity cascade;
|
|---|
| 24 | truncate table tournament restart identity cascade;
|
|---|
| 25 | truncate table tournamentorganizer restart identity cascade;
|
|---|
| 26 | truncate table tournamentorganizer_hosts_tournament restart identity cascade;
|
|---|
| 27 | truncate table tournamentphase restart identity cascade;
|
|---|
| 28 | truncate table quiz_is_part_of_tournamentphase restart identity cascade;
|
|---|
| 29 |
|
|---|
| 30 | insert into user_table(fullname, username, password_attr) values
|
|---|
| 31 | ('Kliment Shukanov', 'shukan123', 'User321!'),
|
|---|
| 32 | ('Petar Pucoski', 'perikus123', 'najsecurelozinka'),
|
|---|
| 33 | ('Stefan Risteski', 'fankyoste', 'password_attr123'),
|
|---|
| 34 | ('Petre Petreski', 'mitre123', 'pass123'),
|
|---|
| 35 | ('Kiril Lazarov', 'kirilLazarov', 'pass321'),
|
|---|
| 36 | ('Quiz Tester', 'quizTester', 'pass321123!'),
|
|---|
| 37 | ('Stevo Stevoski', 'stefs', 'asdjkdas'),
|
|---|
| 38 | ('Stole Dimitrieski', 'stoleGK', 'gk123321'),
|
|---|
| 39 | ('Quiz Tester 2', 'quizTester2', 'pass32112332!');
|
|---|
| 40 |
|
|---|
| 41 | insert into administrator (userID) values
|
|---|
| 42 | (1), (2), (3);
|
|---|
| 43 |
|
|---|
| 44 | insert into moderator (userID) values
|
|---|
| 45 | (4), (5), (6);
|
|---|
| 46 |
|
|---|
| 47 | insert into quiztaker(userid) values
|
|---|
| 48 | (7), (8), (9);
|
|---|
| 49 |
|
|---|
| 50 | insert into tournament(tournamentname) values
|
|---|
| 51 | ('History Quiz Tournament'),
|
|---|
| 52 | ('General Sport Knowledge Test'),
|
|---|
| 53 | ('Geography Tournament');
|
|---|
| 54 |
|
|---|
| 55 | insert into tournamentphase(tournamentid, tournamentphasename) values
|
|---|
| 56 | (1, 'First phase'), (1, 'Semi-finals'), (1, 'Finals'), (2, 'Phase 1'), (2, 'Phase 2'), (2, 'Phase 3'), (2, 'Phase 4'), (2, 'Grand final'), (3, 'First phase'), (3, 'Second phase');
|
|---|
| 57 |
|
|---|
| 58 | insert into tournamentorganizer(userid) values
|
|---|
| 59 | (4), (5), (6);
|
|---|
| 60 |
|
|---|
| 61 | insert into subject(subjectname) values
|
|---|
| 62 | ('History'), ('Sport'), ('Geography'), ('Physics');
|
|---|
| 63 |
|
|---|
| 64 | insert into category(subjectid, categoryname) values
|
|---|
| 65 | (1, 'World War 1'), (1, 'World War 2'), (1, 'Balkan Wars'),
|
|---|
| 66 | (2, 'Football'), (2, 'Basketball'), (3, 'Europe'), (3, 'Asia');
|
|---|
| 67 |
|
|---|
| 68 | insert into quiz(categoryid, quizname, tournamentphaseid) values
|
|---|
| 69 | (2, 'World War 2 Trivia'),
|
|---|
| 70 | (4, 'Football Legends'),
|
|---|
| 71 | (5, 'Basketball legends'),
|
|---|
| 72 | (6, 'European Landmarks'),
|
|---|
| 73 | (4, 'Champions league');
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 | insert into medal(tournamentid, medalname, description) values
|
|---|
| 77 | (2, 'Sports-wiz', 'Your knowledge of sports is impeccable'),
|
|---|
| 78 | (1, 'History nerd', 'You are a true historian'),
|
|---|
| 79 | (3, 'Geography geek', 'Master of geography');
|
|---|
| 80 |
|
|---|
| 81 | insert into question(questiontext) values
|
|---|
| 82 | ('Who got the Rookie of the Year award in 2021'),
|
|---|
| 83 | ('Give your opinion on who will win the 2022 season and why?'),
|
|---|
| 84 | ('Guess this flag?'),
|
|---|
| 85 | ('What is the capital of Germany?'),
|
|---|
| 86 | ('Who won the 2010 World Cup?'),
|
|---|
| 87 | ('What is the most populated nation in Asia?');
|
|---|
| 88 |
|
|---|
| 89 | insert into hint(hinttext, questionid) values
|
|---|
| 90 | ('This player plays in Charlotte Hornets', 1),
|
|---|
| 91 | ('It is a country in the north of Europe', 3),
|
|---|
| 92 | ('Their nickname is the Red Furia', 5);
|
|---|
| 93 |
|
|---|
| 94 | insert into textquestion (questionid) values
|
|---|
| 95 | (2), (4), (6);
|
|---|
| 96 |
|
|---|
| 97 | insert into selectionquestion (questionid) values
|
|---|
| 98 | (1), (3), (5);
|
|---|
| 99 |
|
|---|
| 100 | insert into choice(questionid, iscorrect, choicetext) values
|
|---|
| 101 | (1, true, 'LaMelo Ball'),
|
|---|
| 102 | (1, false, 'Luka Doncic'),
|
|---|
| 103 | (1, false, 'Nikola Jokic');
|
|---|
| 104 |
|
|---|
| 105 | insert into attempt(userid, attemptdate, quizid) values
|
|---|
| 106 | (7, '12/10/2021', 3),
|
|---|
| 107 | (8, '11/10/2021', 3),
|
|---|
| 108 | (9, '10/10/2021', 3);
|
|---|
| 109 |
|
|---|
| 110 | insert into selectedchoice(choiceid, attemptid) values
|
|---|
| 111 | (2, 1), (3, 2), (1, 3);
|
|---|
| 112 |
|
|---|
| 113 | insert into result_table(attemptid, points) values
|
|---|
| 114 | (1, 0), (2, 0), (3, 100);
|
|---|
| 115 |
|
|---|
| 116 | insert into badge(resultid, badgename , description) values
|
|---|
| 117 | (1, 'High performance', 'You scored a score above 90 points'),
|
|---|
| 118 | (2, 'Participation badge', 'At least you tried'),
|
|---|
| 119 | (3, 'Basketball maniac', 'Score above 90 points on a quiz about basketball');
|
|---|
| 120 |
|
|---|
| 121 | insert into quiz_is_part_of_tournament(quizid, tournamentid) values
|
|---|
| 122 | (5, 2), (1, 1), (3,2);
|
|---|
| 123 |
|
|---|
| 124 | insert into quiz_is_part_of_tournamentphase (quizid, tournamentphaseid) values
|
|---|
| 125 | (5, 8), (1, 1), (3, 7);
|
|---|
| 126 |
|
|---|
| 127 | insert into tournamentorganizer_hosts_tournament (userid , tournamentid) values
|
|---|
| 128 | (1,2), (2,1), (3,3);
|
|---|
| 129 |
|
|---|
| 130 | insert into question_is_part_of_quiz(questionid, quizid) values
|
|---|
| 131 | (1,3), (2, 3), (9, 4);
|
|---|
| 132 |
|
|---|
| 133 | insert into quiztaker_participates_in_tournamentphase (userid, tournamentphaseid) values
|
|---|
| 134 | (7, 8), (8, 2), (9, 3);
|
|---|
| 135 |
|
|---|
| 136 | insert into quiztaker_participates_in_tournament (userid, tournamentid) values
|
|---|
| 137 | (7, 2), (8, 1), (9,1);
|
|---|
| 138 |
|
|---|
| 139 | insert into medal_is_awarded_to_quiztaker (medalid, userid) values
|
|---|
| 140 | (2, 7), (2, 8), (1, 9);
|
|---|
| 141 |
|
|---|
| 142 | insert into badge_is_awarded_to_quiztaker (badgeid, userid) values
|
|---|
| 143 | (2,7), (2, 8), (3, 9);
|
|---|
| 144 | |
|---|