-
Notifications
You must be signed in to change notification settings - Fork 0
/
spelling-appDB.sql
163 lines (155 loc) · 4.02 KB
/
spelling-appDB.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
drop table if exists
accounts,
roles,
account_roles,
sessions,
spelling_table
cascade;
CREATE TABLE accounts (
user_id serial PRIMARY KEY,
firstName VARCHAR ( 100 ) NOT NULL,
lastName VARCHAR ( 100 ) NOT NULL,
userName VARCHAR ( 100 ) UNIQUE NOT NULL,
password VARCHAR ( 100 ) NOT NULL,
email VARCHAR ( 255 ) NOT NULL,
created_on TIMESTAMP,
last_login TIMESTAMP
);
CREATE TABLE roles(
role_id serial PRIMARY KEY,
role_name VARCHAR (255) UNIQUE NOT NULL
);
CREATE TABLE account_roles (
user_id INT NOT NULL,
role_id INT NOT NULL,
grant_date TIMESTAMP,
PRIMARY KEY (user_id, role_id),
FOREIGN KEY (role_id) REFERENCES roles (role_id),
FOREIGN KEY (user_id) REFERENCES accounts (user_id)
);
CREATE TABLE sessions (
session_id serial PRIMARY KEY,
user_id INT REFERENCES accounts (user_id),
correctWordsList TEXT,
wrongWordsList TEXT,
number_of_correct_words INT,
number_of_incorrect_words INT,
session_accuracy_percentage NUMERIC(5,2),
percentage_sign VARCHAR(1) DEFAULT '%'
);
CREATE TABLE spelling_table(
word_id serial PRIMARY KEY,
year3And4Words varchar(50),
year5And6Words varchar(50)
);
INSERT INTO spelling_table(year3And4Words, year5And6Words)
VALUES
('accident', 'accompany'),
('accidentally', 'according'),
('actual', 'achieve'),
('actually', 'aggressive'),
('address', 'amateur'),
('answer', 'ancient'),
('appear', 'apparent'),
('arrive', 'appreciate'),
('believe', 'attached'),
('bicycle', 'available'),
('breath', 'average'),
('breathe', 'awkward'),
('build', 'bargain'),
('busy', 'bruise'),
('business', 'category'),
('calendar', 'cemetery'),
('caught', 'committee'),
('centre', 'communicate'),
('century', 'community'),
('certain', 'competition'),
('circle', 'conscience'),
('complete', 'conscious'),
('consider', 'controversy'),
('continue', 'convenience'),
('decide', 'correspond'),
('describe', 'criticise'),
('different', 'curiosity'),
('difficult', 'definite'),
('disappear', 'desperate'),
('early', 'determined'),
('earth', 'develop'),
('eight', 'dictionary'),
('eighth', 'disastrous'),
('enough', 'embarrass'),
('exercise', 'environment'),
('experience', 'equip'),
('experiment', 'especially'),
('extreme', 'exaggerate'),
('famous', 'excellent'),
('favourite', 'existence'),
('February', 'explanation'),
('forward', 'familiar'),
('forwards', 'foreign'),
('fruit', 'forty'),
('grammar', 'frequently'),
('group', 'government'),
('guard', 'guarantee'),
('guide', 'harass'),
('heard', 'hindrance'),
('heart', 'identity'),
('height', 'immediate'),
('history', 'individual'),
('imagine', 'interfere'),
('increase', 'interrupt'),
('important', 'language'),
('interest', 'leisure'),
('island', 'lightning'),
('knowledge', 'marvellous'),
('learn', 'mischievous'),
('length', 'muscle'),
('library', 'necessary'),
('material', 'neighbour'),
('medicine', 'nuisance'),
('mention', 'occupy'),
('minute', 'occur'),
('natural', 'opportunity'),
('naughty', 'parliament'),
('notice', 'persuade'),
('occasion', 'physical'),
('occasionally', 'prejudice'),
('often', 'privilege'),
('opposite', 'profession'),
('ordinary', 'programme'),
('particular', 'pronunciation'),
('peculiar', 'queue'),
('perhaps', 'recognise'),
('popular', 'recommend'),
('position', 'relevant'),
('possess', 'restaurant'),
('possession', 'rhyme'),
('possible', 'rhythm'),
('potatoes', 'sacrifice'),
('pressure', 'secretary'),
('probably', 'shoulder'),
('promise', 'signature'),
('purpose', 'sincere'),
('quarter', 'soldier'),
('question', 'stomach'),
('recent', 'sufficient'),
('regular', 'suggest'),
('reign', 'symbol'),
('remember', 'system'),
('sentence', 'temperature'),
('separate', 'thorough'),
('special', 'twelfth'),
('straight', 'variety'),
('strange', 'vegetable'),
('strength', 'vehicle'),
('suppose', 'yacht'),
('surprise', ''),
('therefore', ''),
('though', ''),
('although', ''),
('thought', ''),
('through', ''),
('various', ''),
('weight', ''),
('woman', ''),
('women', '');