-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdatabase.sql
362 lines (336 loc) · 14.5 KB
/
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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
DROP DATABASE IF EXISTS letter_edu;
CREATE DATABASE IF NOT EXISTS letter_edu;
USE letter_edu;
CREATE TABLE IF NOT EXISTS users (
id INT PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
username VARCHAR(30) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
profile_picture VARCHAR(255) DEFAULT 'default.png',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS lessons (
id INT PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(100) NOT NULL,
description VARCHAR(255) NOT NULL
);
CREATE TABLE IF NOT EXISTS lesson_items (
id INT PRIMARY KEY AUTO_INCREMENT,
lesson_id INT,
type ENUM('video', 'content') NOT NULL,
title VARCHAR(100) NOT NULL,
description TEXT,
link VARCHAR(255),
position INT NOT NULL,
FOREIGN KEY (lesson_id) REFERENCES lessons(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS test (
id INT PRIMARY KEY AUTO_INCREMENT,
lesson_id INT,
question TEXT NOT NULL,
FOREIGN KEY (lesson_id) REFERENCES lessons(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS test_options (
id INT PRIMARY KEY AUTO_INCREMENT,
test_id INT NOT NULL,
option_text VARCHAR(255) NOT NULL,
is_correct BOOLEAN DEFAULT FALSE,
FOREIGN KEY (test_id) REFERENCES test(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS tru_false (
id INT PRIMARY KEY AUTO_INCREMENT,
lesson_id INT,
statement TEXT NOT NULL,
is_true BOOLEAN NOT NULL,
FOREIGN KEY (lesson_id) REFERENCES lessons(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS dropdown (
id INT PRIMARY KEY AUTO_INCREMENT,
lesson_id INT,
question TEXT NOT NULL,
correct_answer VARCHAR(255) NOT NULL,
FOREIGN KEY (lesson_id) REFERENCES lessons(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS fill_in_the_blank (
id INT PRIMARY KEY AUTO_INCREMENT,
lesson_id INT,
sentence TEXT NOT NULL,
correct_answer VARCHAR(255) NOT NULL,
FOREIGN KEY (lesson_id) REFERENCES lessons(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS matching (
id INT PRIMARY KEY AUTO_INCREMENT,
lesson_id INT,
left_side TEXT NOT NULL,
right_side TEXT NOT NULL,
FOREIGN KEY (lesson_id) REFERENCES lessons(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS results (
id INT PRIMARY KEY AUTO_INCREMENT,
lesson_id INT,
participant_name VARCHAR(255) NOT NULL,
total_questions INT NOT NULL,
answered_questions INT NOT NULL,
FOREIGN KEY (lesson_id) REFERENCES lessons(id) ON DELETE CASCADE
);
CREATE TABLE questions (
id INT AUTO_INCREMENT PRIMARY KEY,
lesson_id INT,
question_text TEXT NOT NULL,
FOREIGN KEY (lesson_id) REFERENCES lessons(id) ON DELETE CASCADE
);
CREATE TABLE answers (
id INT AUTO_INCREMENT PRIMARY KEY,
question_id INT,
answer_text VARCHAR(255) NOT NULL,
FOREIGN KEY (question_id) REFERENCES questions(id)
);
-- Login: iqbolshoh
-- Password: 1
INSERT INTO
users (
first_name,
last_name,
email,
username,
password
)
VALUES
(
'Iqbolshoh',
'Ilhomjonov',
'iilhomjonov777@gmail.com',
'iqbolshoh',
'65c2a32982abe41b1e6ff888d351ee6b7ade33affd4a595667ea7db910aecaa8'
);
INSERT INTO
lessons (id, title, description)
VALUES
(
1,
'Beginner English',
'Basic English lessons for beginners.'
),
(
2,
'Intermediate English',
'Intermediate-level English to enhance your skills.'
),
(
3,
'Advanced English',
'Advanced-level English for fluency and precision.'
);
INSERT INTO
lesson_items (
lesson_id,
type,
title,
description,
link,
position
)
VALUES
(
1,
'content',
'Basic Greetings',
'Learn how to greet people and introduce yourself in English. Understand various greetings used in different contexts such as formal, informal, and casual settings. This lesson will introduce common phrases like " How are you ? " and " Nice to meet you." You will also explore cultural nuances and appropriate responses, helping you feel confident when initiating conversations in English-speaking environments.',
'',
3
),
(
1,
'video',
'Introduction to English Alphabet',
'This lesson covers the English alphabet, helping you recognize each letter, understand its pronunciation, and discover common words that begin with each letter. You will also see demonstrations of how each letter is articulated in various words. This foundational lesson will strengthen your reading and writing skills and help you improve letter recognition for both uppercase and lowercase characters.',
'IeaadwctbD4',
1
),
(
1,
'content',
'Common Verbs',
'This lesson focuses on frequently used verbs in English, their basic forms, and how to incorporate them into different sentence structures. You will learn the most common verbs and practice using them in affirmative, negative, and interrogative sentences. The goal is to help you use verbs naturally in your conversations, and we will provide tips for memorizing them to boost your confidence.',
'',
4
),
(
1,
'video',
'Basic Pronunciation Tips',
'Improve your pronunciation with clear examples and tips on how to pronounce common words in English. We’ll focus on identifying frequent pronunciation mistakes and strategies to avoid them. This lesson highlights the importance of stress and intonation in spoken English, teaching you how to sound more natural when speaking. You will also practice mimicking native speakers to develop better fluency and clarity in your pronunciation.',
'IeaadwctbD4',
2
),
(
1,
'content',
'Simple Sentences',
'This lesson will teach you how to form simple sentences in English, with clear examples to help you understand sentence structure. We will cover how to use basic components such as nouns, verbs, and adjectives in your sentences. You will also learn some of the most common sentence patterns and how to expand them for more variety, allowing you to express simple ideas confidently in English.',
'',
5
),
(
2,
'video',
'Intermediate Grammar Video',
'This video lesson dives into intermediate grammar concepts like past perfect tense, conditionals, and indirect speech. You will learn how to use these grammatical structures in everyday situations, focusing on their applications in both writing and speaking. The lesson includes interactive examples and practical exercises to help reinforce these rules and enhance your ability to use them in real-life conversations.',
'IeaadwctbD4',
1
),
(
2,
'content',
'Grammar and Usage',
'In this lesson, you will explore intermediate-level grammar concepts such as conditionals, relative clauses, and modal verbs. These structures are essential for expressing complex thoughts and ideas in English. You will learn how to integrate these grammar points into your speech and writing to communicate more naturally. Exercises will help you practice their use and improve fluency in real-world situations.',
'',
3
),
(
2,
'video',
'Idioms and Expressions',
'Discover the world of idioms and expressions in this video lesson. Learn the meanings behind common idioms used in everyday conversations, such as " break the ice " and " get cold feet." We will also explore cultural context and how idioms are used by native speakers. You’ll have the chance to practice these idiomatic expressions in your own sentences and understand their significance in informal conversations.',
'IeaadwctbD4',
2
),
(
2,
'content',
'Phrasal Verbs',
'Phrasal verbs are an essential part of conversational English. This lesson will teach you the meanings and usage of common phrasal verbs. You will see examples of these verbs used in different contexts and practice identifying their literal and idiomatic meanings. We will also focus on using phrasal verbs naturally during conversations, improving your spoken English and fluency.',
'',
4
),
(
2,
'content',
'Listening Practice',
'Enhance your listening skills with intermediate-level dialogues. This lesson includes various audio and video exercises designed to improve your ability to understand different accents and speaking speeds. Focus on picking out key words, main ideas, and supporting details. As you practice, you’ll gain strategies to comprehend complex sentences and follow along more effectively during conversations or presentations.',
'',
5
),
(
3,
'content',
'Complex Sentence Structures',
'This lesson focuses on constructing and using complex and compound-complex sentences in both written and spoken English. You’ll learn how to use conjunctions, relative clauses, and other advanced sentence elements to express more sophisticated ideas. Exercises will help you practice these structures and build your ability to communicate effectively in professional, academic, and personal settings.',
'',
3
),
(
3,
'video',
'Advanced Grammar and Vocabulary',
'Master advanced grammar topics and professional vocabulary in this lesson. We’ll cover complex structures like advanced tenses, inversion, and subjunctive mood. Additionally, we will explore high-level vocabulary used in academic and professional contexts. With interactive examples, you’ll learn how to avoid common mistakes and develop confidence in using advanced grammar and vocabulary in your writing and speaking.',
'IeaadwctbD4',
1
),
(
3,
'content',
'Formal Writing',
'In this lesson, you’ll learn the principles of formal writing, such as structuring essays, reports, and professional emails. You will understand how to organize ideas logically, use formal vocabulary, and avoid colloquial expressions. Through examples of academic and business writing, you will gain insight into effective communication in professional settings. This lesson will enhance your ability to produce clear and polished written content for formal situations.',
'',
4
),
(
3,
'video',
'Professional Writing Tips',
'Learn valuable techniques for writing professional and effective documents such as reports, proposals, and business emails. This video lesson will guide you through the process of crafting compelling content, organizing ideas logically, and ensuring error-free writing. You will see real-world examples and gain the confidence to write clearly and persuasively in a professional context.',
'IeaadwctbD4',
2
),
(
3,
'content',
'Advanced Vocabulary',
'Expand your English vocabulary with more sophisticated words and their proper usage in various contexts. This lesson will teach you advanced vocabulary for formal and academic writing as well as for everyday conversations. You’ll learn how to substitute common words with more refined alternatives and understand the nuances of similar words. By using these advanced words in speaking and writing exercises, you’ll demonstrate your expertise in the language.',
'',
5
);
INSERT INTO
test (lesson_id, question)
VALUES
(1, 'What is the capital of France?'),
(
1,
'Which of the following is a renewable energy source?'
),
(2, 'Which of these animals is a mammal?'),
(3, 'What is the primary function of the heart?');
INSERT INTO
test_options (test_id, option_text, is_correct)
VALUES
(1, 'Paris', TRUE),
(1, 'London', FALSE),
(1, 'Berlin', FALSE),
(2, 'Solar Energy', TRUE),
(2, 'Coal', FALSE),
(2, 'Oil', FALSE),
(3, 'Dog', TRUE),
(3, 'Eagle', FALSE),
(3, 'Shark', FALSE),
(4, 'Pumping blood', TRUE),
(4, 'Digesting food', FALSE),
(4, 'Producing oxygen', FALSE);
INSERT INTO
tru_false (lesson_id, statement, is_true)
VALUES
(1, 'The Earth revolves around the Sun.', TRUE),
(1, 'The Earth revolves around the Sun.', TRUE),
(2, 'All squares are rectangles.', TRUE),
(3, 'Water boils at 50°C at sea level.', FALSE);
INSERT INTO
dropdown (lesson_id, question, correct_answer)
VALUES
(
1,
'Select the correct preposition: " I am going ___ the store." ',
'to'
),
(
1,
'Choose the correct option: " The cat is ___ the table."',
'under'
);
INSERT INTO
fill_in_the_blank (lesson_id, sentence, correct_answer)
VALUES
(
1,
'The quick brown ___ jumps over the lazy dog.',
'fox'
),
(1, '___ is the capital city of Japan.', 'Tokyo');
INSERT INTO
matching (lesson_id, left_side, right_side)
VALUES
(1, 'Apple', 'Fruit'),
(1, 'Carrot', 'Vegetable'),
(1, 'Dog', 'Animal'),
(2, 'Python', 'Programming Language'),
(3, 'HTML', 'Markup Language');
INSERT INTO
questions (lesson_id, question_text)
VALUES
(
1,
"On 21 January 2023, I bought an Artel 4K Smart TV for $299.95 from your Tashkent Mall branch. I have attached a copy of my receipt for your reference. When I returned home and unpacked the TV, I (1) _____ that it was faulty and could not display 4K content properly. I returned to the Tashkent Mall branch and the sales assistant, who was very unhelpful, told me that you no longer (2) _____ the Artel 4K Smart TV. I explained to the assistant that I didn’t want to incur extra costs for another model, and I would rather (3) _____ a reimbursement for the faulty product. I believe I am (4) _____ to a full refund for this defective product, as it is not functioning as promised. Please contact me (5) _____ the next two weeks to arrange a convenient time for me to return the appliance and collect my refund. I can be (6) _____ at home on the phone number above or at 2461 8032 (7) _____ business hours. I look forward to hearing from you if you wish to (8) _____ this issue further. Yours (9) _____."
);
INSERT INTO
answers (question_id, answer_text)
VALUES
(1, 'noticed'),
(1, 'realized'),
(1, 'discovered'),
(1, 'observed'),
(1, 'found'),
(1, 'detected'),
(1, 'saw'),
(1, 'perceived'),
(1, 'recognized')