-
Notifications
You must be signed in to change notification settings - Fork 5
/
schema.sql
47 lines (46 loc) · 1.15 KB
/
schema.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
drop table if exists users;
drop table if exists records;
drop table if exists topics;
drop table if exists links;
drop table if exists questions;
drop table if exists skill2topic;
create table users (
id integer primary key autoincrement,
name string not null,
password string not null,
reg_time timestamp not null
);
create table records (
id integer primary key autoincrement,
user_id integer,
log_ip string not null,
log_time timestamp not null,
correct integer not null,
question_id integer not null
);
create table topics (
topic_id integer primary key autoincrement,
topic_name string not null,
description string
);
create table links (
id integer primary key autoincrement,
source integer not null,
target integer not null
);
create table questions (
question_id integer primary key,
description string,
skill_id integer not null,
topic_id integer not null
);
create table skill2topic (
skill_id integer primary key autoincrement,
skill_name string not null unique,
topic_id integer not null
);
drop table if exists next_question_map;
create table next_question_map (
temp_id integer primary key,
next_id not null
);