-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
59 lines (46 loc) · 1.74 KB
/
schema.sql
File metadata and controls
59 lines (46 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
CREATE TABLE IF NOT EXISTS themes(
id INTEGER PRIMARY KEY AUTOINCREMENT ,
name TEXT NOT NULL,
path TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS questions(
id INTEGER PRIMARY KEY AUTOINCREMENT ,
theme_id INTEGER NOT NULL,
question TEXT NOT NULL,
FOREIGN KEY (theme_id) REFERENCES themes(id)
);
CREATE TABLE IF NOT EXISTS answers(
id INTEGER PRIMARY KEY AUTOINCREMENT ,
question_id INTEGER NOT NULL,
answer TEXT NOT NULL,
is_correct BOOLEAN NOT NULL,
FOREIGN KEY (question_id) REFERENCES questions(id)
);
INSERT OR IGNORE INTO themes (id, name, path) VALUES (1, "Anime", "/anime");
INSERT OR IGNORE INTO themes (id, name, path) VALUES (2, "Manhwa", "/manhwa");
INSERT OR IGNORE INTO questions (theme_id, question) VALUES
(1, "In Naruto, what is the name of the fox demon sealed inside Naruto?"),
(1, "In Tokyo Ghoul, what is the name of the organization that hunts ghouls?"),
(1, "In Shingeki no Kyojin (Attack on Titan), what is the true name of the Colossal Titan?"),
(2, "What is the name of Zack Lee's rival in Lookism?"),
(2, "What is one of the main characteristics of Lloyd Frontera in The Real Estate Developer?"),
(2, "Which main character in a manhwa used to say 'ARISE'?");
INSERT OR IGNORE INTO answers (question_id, answer, is_correct) VALUES
(1, "Shukaku", 0),
(1, "Kurama", 1),
(1, "Matatabi", 0),
(2, "Pierrot", 0),
(2, "Aogiri Tree", 0),
(2, "CCG", 1),
(3, "Bertolt Hoover", 1),
(3, "Reiner Braun", 0),
(3, "Zeke Yeager", 0),
(4, "Vasco", 0),
(4, "Daniel Park", 0),
(4, "Johan Seong", 1),
(5, "Ugly", 1),
(5, "Handsome", 0),
(5, "Jealous", 0),
(6, "Javier", 0),
(6, "Sung jin woo", 1),
(6, "Gun Park", 0);