-
Notifications
You must be signed in to change notification settings - Fork 4
/
database.sql
33 lines (28 loc) · 997 Bytes
/
database.sql
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
CREATE TABLE `quiz_log` (
`id` int NOT NULL,
`session_id` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`question_number` int DEFAULT NULL,
`question_id` int DEFAULT NULL,
`question` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`user_answers` text COLLATE utf8mb4_general_ci,
`correct_answers` text COLLATE utf8mb4_general_ci,
`is_correct` tinyint(1) DEFAULT NULL,
`first_modified_time` datetime DEFAULT NULL,
`last_modified_time` datetime DEFAULT NULL
);
ALTER TABLE `quiz_log`
ADD PRIMARY KEY (`id`);
ALTER TABLE `quiz_log`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
CREATE TABLE `session_info` (
`id` int NOT NULL,
`session_id` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
`page_load_time` datetime NOT NULL,
`submission_time` datetime NOT NULL,
`num_questions` int NOT NULL,
`passing_level` float NOT NULL
);
ALTER TABLE `session_info`
ADD PRIMARY KEY (`id`);
ALTER TABLE `session_info`
MODIFY `id` int NOT NULL AUTO_INCREMENT;