-
Notifications
You must be signed in to change notification settings - Fork 0
/
insert.sql
341 lines (234 loc) · 9.84 KB
/
insert.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
/* Department */
INSERT INTO Departments(department_abbreviation, department_name)
VALUES ('SSY', 'SignalerSystem');
INSERT INTO Departments(department_abbreviation, department_name)
VALUES('IT', 'Informationsteknik');
INSERT INTO Departments(department_abbreviation, department_name)
VALUES('CSE', 'Datainstitutionen');
/* Programme */
INSERT INTO Programmes(programme_abbreviation, programme_name)
VALUES('IT', 'IT-programmet');
INSERT INTO Programmes(programme_abbreviation, programme_name)
VALUES('M', 'Maskin-programmet');
INSERT INTO Programmes(programme_abbreviation, programme_name)
VALUES('D', 'D-programmet');
INSERT INTO Programmes(programme_abbreviation, programme_name)
VALUES('A', 'A-programmet');
/* Branch */
INSERT INTO Branches(branch, programme_abbreviation)
VALUES('CSN', 'D');
INSERT INTO Branches(branch, programme_abbreviation)
VALUES('CSALL', 'D');
INSERT INTO Branches(branch, programme_abbreviation)
VALUES('CSALL', 'IT');
INSERT INTO Branches(branch, programme_abbreviation)
VALUES('MPSOF', 'IT');
INSERT INTO Branches(branch, programme_abbreviation)
VALUES('MPSOF', 'D');
INSERT INTO Branches(branch, programme_abbreviation)
VALUES('RLHK', 'A');
INSERT INTO Branches(branch, programme_abbreviation)
VALUES('Production', 'M');
/* Student */
INSERT INTO Students(student_id, student_name, branch, programme_abbreviation)
VALUES(9303240890, 'Johan Angséus', 'CSN', 'D');
INSERT INTO Students(student_id, student_name, branch, programme_abbreviation)
VALUES(9303240891, 'Johan Persson', 'CSALL', 'IT');
INSERT INTO Students(student_id, student_name, branch, programme_abbreviation)
VALUES(9405334444, 'Jimmy Hedström', 'CSALL', 'D');
INSERT INTO Students(student_id, student_name, branch, programme_abbreviation)
VALUES(9405223344, 'Anna Jansson', 'RLHK', 'A');
INSERT INTO Students(student_id, student_name, branch, programme_abbreviation)
VALUES(9102224455, 'Borat Jansson', 'CSN', 'D');
INSERT INTO Students(student_id, student_name, branch, programme_abbreviation)
VALUES(9102224454, 'Jenny Jansson', 'CSN', 'D');
INSERT INTO Students(student_id, student_name, branch, programme_abbreviation)
VALUES(9102224433, 'Herman Nilsson', 'CSN', 'D');
INSERT INTO Students(student_id, student_name, branch, programme_abbreviation)
VALUES(1234567890, 'Klara Klar', 'CSN', 'D');
INSERT INTO Students(student_id, student_name, branch, programme_abbreviation)
VALUES(1111222244, 'Jimmy Götte', 'CSN', 'D');
/* Course */
INSERT INTO Courses(code, course_name, credit)
VALUES('TDA357', 'Databases', 7.5);
INSERT INTO Courses(code, course_name, credit)
VALUES('DAT290', 'Projektkurs', 4.5);
INSERT INTO Courses(code, course_name, credit)
VALUES('MCA222', 'Maskiner och varuhantering', 7.5);
INSERT INTO Courses(code, course_name, credit)
VALUES('TIF850', 'Fysik', 7.5);
INSERT INTO Courses(code, course_name, credit)
VALUES('EDM250', 'Inledande matematik', 3);
INSERT INTO Courses(code, course_name, credit)
VALUES('TDA222', 'Paralell programmering', 7.5);
INSERT INTO Courses(code, course_name, credit)
VALUES('MKV123', 'Trattkunskap', 2.5);
INSERT INTO Courses(code, course_name, credit)
VALUES('KEK253', 'Kellera', 7.5);
INSERT INTO Courses(code, course_name, credit)
VALUES('TDE123', 'Tjenixen', 7.5);
INSERT INTO Courses(code, course_name, credit)
VALUES('MAT122', 'Matematik för alla', 20);
INSERT INTO Courses(code, course_name, credit)
VALUES('KLA111', 'Klara kan inte vinna', 10);
INSERT INTO Courses(code, course_name, credit)
VALUES('FFF111', 'Full kurs 101', 7);
INSERT INTO Courses(code, course_name, credit)
VALUES('FFF222', 'Full kurs 102', 7);
/* RestrictedCourse */
INSERT INTO RestrictedCourses(code, attendees)
VALUES('TDA357', 10);
INSERT INTO RestrictedCourses(code, attendees)
VALUES('FFF111', 2);
INSERT INTO RestrictedCourses(code, attendees)
VALUES('FFF222', 2);
/* Classification */
INSERT INTO Classifications(classification)
VALUES('Math');
INSERT INTO Classifications(classification)
VALUES('Research');
INSERT INTO Classifications(classification)
VALUES('Seminar');
/* isHosting */
INSERT INTO isHosting(department_abbreviation, programme_abbreviation)
VALUES('CSE', 'D');
INSERT INTO isHosting(department_abbreviation, programme_abbreviation)
VALUES('IT', 'IT');
INSERT INTO isHosting(department_abbreviation, programme_abbreviation)
VALUES('SSY', 'M');
INSERT INTO isHosting(department_abbreviation, programme_abbreviation)
VALUES('CSE', 'A');
/* attendsTo */
INSERT INTO attendsTo(student_id, programme_abbreviation, branch)
VALUES(9303240890, 'D', 'CSN');
INSERT INTO attendsTo(student_id, programme_abbreviation, branch)
VALUES(9303240891, 'IT', 'CSALL');
INSERT INTO attendsTo(student_id, programme_abbreviation, branch)
VALUES(9405334444, 'A', 'RLHK');
INSERT INTO attendsTo(student_id, programme_abbreviation, branch)
VALUES(9405223344, 'M', 'Production');
INSERT INTO attendsTo(student_id, programme_abbreviation, branch)
VALUES(9102224433, 'D', 'CSN');
/* hasCompleted */
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(9303240890, 'TDA357', 'U');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(9303240891, 'EDM250', '3');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(9303240890, 'DAT290', '4');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(9405334444, 'TIF850', '4');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(9405223344, 'MKV123', '5');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(9102224455, 'TDA222', '5');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(9102224454, 'TDA222', '4');
/* Student who completed all courses */
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(1234567890, 'TDA357', '5');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(1234567890, 'DAT290', '5');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(1234567890, 'MCA222', '5');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(1234567890, 'TIF850', '5');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(1234567890, 'EDM250', '5');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(1234567890, 'TDA222', '5');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(1234567890, 'MKV123', '5');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(1234567890, 'KEK253', '5');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(1234567890, 'TDE123', '5');
INSERT INTO hasCompleted(student_id, code, grade)
VALUES(1234567890, 'MAT122', '5');
/* hasRegistered */
INSERT INTO hasRegistered(student_id, code)
VALUES(9303240890, 'EDM250');
INSERT INTO hasRegistered(student_id, code)
VALUES(9405334444, 'TDA357');
INSERT INTO hasRegistered(student_id, code)
VALUES(9405223344, 'EDM250');
INSERT INTO hasRegistered(student_id, code)
VALUES(1234567890, 'KLA111');
INSERT INTO hasRegistered(student_id, code)
VALUES(9405223344, 'FFF111');
INSERT INTO hasRegistered(student_id, code)
VALUES(9405334444, 'FFF111');
INSERT INTO hasRegistered(student_id, code)
VALUES(9405223344, 'FFF222');
INSERT INTO hasRegistered(student_id, code)
VALUES(1234567890, 'FFF222');
INSERT INTO hasRegistered(student_id, code)
VALUES(1111222244, 'FFF222');
INSERT INTO hasRegistered(student_id, code)
VALUES(9405334444, 'FFF222');
/* recommendedCourse */
INSERT INTO recommendedCourse(code, programme_abbreviation, branch)
VALUES('TDA357', 'D', 'CSN');
INSERT INTO recommendedCourse(code, programme_abbreviation, branch)
VALUES('TIF850', 'IT', 'CSALL');
INSERT INTO recommendedCourse(code, programme_abbreviation, branch)
VALUES('MKV123', 'M', 'Production');
INSERT INTO recommendedCourse(code, programme_abbreviation, branch)
VALUES('EDM250', 'A', 'RLHK');
/* branchMandatory */
INSERT INTO branchMandatory(code, programme_abbreviation,branch)
VALUES('TDA357', 'D', 'CSN');
INSERT INTO branchMandatory(code, programme_abbreviation,branch)
VALUES('TDA222', 'D', 'CSN');
/* programmeMandatory */
INSERT INTO programmeMandatory(code, programme_abbreviation)
VALUES('MCA222', 'M');
INSERT INTO programmeMandatory(code, programme_abbreviation)
VALUES('TDE123', 'D');
/* belongsTo */
INSERT INTO belongsTo(branch, programme_abbreviation)
VALUES('CSN', 'D');
INSERT INTO belongsTo(branch, programme_abbreviation)
VALUES('CSALL', 'D');
INSERT INTO belongsTo(branch, programme_abbreviation)
VALUES('CSALL', 'IT');
INSERT INTO belongsTo(branch, programme_abbreviation)
VALUES('MPSOF', 'D');
INSERT INTO belongsTo(branch, programme_abbreviation)
VALUES('MPSOF', 'IT');
INSERT INTO belongsTo(branch, programme_abbreviation)
VALUES('RLHK', 'A');
INSERT INTO belongsTo(branch, programme_abbreviation)
VALUES('Production', 'M');
/* isGiven */
INSERT INTO isGiven(code, department_abbreviation)
VALUES('TDA357', 'CSE');
INSERT INTO isGiven(code, department_abbreviation)
VALUES('DAT290', 'CSE');
INSERT INTO isGiven(code, department_abbreviation)
VALUES('TDA222', 'IT');
INSERT INTO isGiven(code, department_abbreviation)
VALUES('TIF850', 'SSY');
/* hasClassifications */
INSERT INTO hasClassifications(code, classification)
VALUES('TIF850', 'Math');
INSERT INTO hasClassifications(code, classification)
VALUES('TDA222', 'Seminar');
INSERT INTO hasClassifications(code, classification)
VALUES('DAT290', 'Research');
INSERT INTO hasClassifications(code, classification)
VALUES('MAT122', 'Math');
INSERT INTO hasClassifications(code, classification)
VALUES('TDA357', 'Research');
/* prerequisites */
INSERT INTO prerequisites(code1, code2)
VALUES('TDA357', 'DAT290');
INSERT INTO prerequisites(code1, code2)
VALUES('MKV123', 'TDA222');
/* isWaiting */
INSERT INTO isWaiting(code, student_id, placeInQueue)
VALUES('TDA357', '9102224455', 1);
INSERT INTO isWaiting(code, student_id, placeInQueue)
VALUES('TDA357', '9102224433', 2);
INSERT INTO isWaiting(code, student_id, placeInQueue)
VALUES('FFF111', '1234567890', 1);