-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_db.sql
137 lines (106 loc) · 3.3 KB
/
create_db.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
drop table if exists noun;
drop table if exists adjective;
drop table if exists pronoun;
drop table if exists adverb;
drop table if exists preposition;
drop table if exists noun_flex;
drop table if exists flex;
drop table if exists temporality;
create table noun_flex
(
noun_flex_id INTEGER PRIMARY KEY AUTOINCREMENT,
meaning TEXT not null,
noun_flex_1 TEXT not null,
noun_flex_2 TEXT not null,
noun_flex_3 TEXT not null,
noun_flex_4 TEXT not null,
noun_flex_5 TEXT not null,
noun_flex_6 TEXT not null,
UNIQUE(meaning, noun_flex_1, noun_flex_2, noun_flex_3, noun_flex_4, noun_flex_5, noun_flex_6)
);
create table flex
(
flex_id INTEGER PRIMARY KEY AUTOINCREMENT,
meaning TEXT not null,
flex_masc_1 TEXT not null,
flex_masc_2 TEXT not null,
flex_masc_3 TEXT not null,
flex_masc_4 TEXT not null,
flex_masc_5 TEXT not null,
flex_masc_6 TEXT not null,
flex_neu_1 TEXT not null,
flex_neu_2 TEXT not null,
flex_neu_3 TEXT not null,
flex_neu_4 TEXT not null,
flex_neu_5 TEXT not null,
flex_neu_6 TEXT not null,
flex_fem_1 TEXT not null,
flex_fem_2 TEXT not null,
flex_fem_3 TEXT not null,
flex_fem_4 TEXT not null,
flex_fem_5 TEXT not null,
flex_fem_6 TEXT not null,
flex_plur_1 TEXT not null,
flex_plur_2 TEXT not null,
flex_plur_3 TEXT not null,
flex_plur_4 TEXT not null,
flex_plur_5 TEXT not null,
flex_plur_6 TEXT not null,
UNIQUE(flex_masc_1,flex_masc_2,flex_masc_3,flex_masc_4,flex_masc_5,flex_masc_6,
flex_neu_1,flex_neu_2,flex_neu_3,flex_neu_4,flex_neu_5,flex_neu_6,
flex_fem_1,flex_fem_2,flex_fem_3,flex_fem_4,flex_fem_5,flex_fem_6,
flex_plur_1,flex_plur_2,flex_plur_3,flex_plur_4,flex_plur_5,flex_plur_6)
);
create table temporality
(
temporality_id INTEGER PRIMARY KEY AUTOINCREMENT,
temp_class TEXT not null,
temp_type TEXT default null,
temp_subtype TEXT default null,
unique(temp_class, temp_type, temp_subtype)
);
create table adverb
(
adv_id INTEGER PRIMARY KEY AUTOINCREMENT,
firstform TEXT not null,
temporality INTEGER not null,
unique(firstform),
foreign key(temporality) references temporality(temporality_id)
);
create table preposition
(
prep_id INTEGER PRIMARY KEY AUTOINCREMENT,
firstform TEXT not null,
temporality INTEGER not null,
unique(firstform),
foreign key(temporality) references temporality(temporality_id)
);
create table adjective
(
adj_id INTEGER PRIMARY KEY AUTOINCREMENT,
firstform TEXT not null,
quasibase TEXT not null,
set_of_flexes INTEGER not null,
temporality INTEGER not null,
unique(quasibase),
foreign key(set_of_flexes) references flex(flex_id),
foreign key(temporality) references temporality(temporality_id)
);
create table pronoun
(
pronoun_id INTEGER PRIMARY KEY AUTOINCREMENT,
firstform TEXT not null,
quasibase TEXT not null,
set_of_flexes INTEGER not null,
unique(quasibase),
foreign key(set_of_flexes) references flex(flex_id)
);
create table noun
(
noun_id INTEGER PRIMARY KEY AUTOINCREMENT,
firstform TEXT not null,
quasibase TEXT not null,
set_of_flexes INTEGER not null,
unique(quasibase),
foreign key(set_of_flexes) references noun_flex(noun_flex_id)
);