-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinsert_data.sql
252 lines (219 loc) · 6.76 KB
/
insert_data.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
INSERT INTO address (postal_code, street_name, street_number)
VALUES
('11212','Grimauld Place','12'),
('20010','The Burrow','1'),
('34444','Privet Drive','4'),
('43377','Hogwarts','77'),
('55555','Patil Residence','11'),
('66666','Malfoys Manor','1'),
('77777','Grandmother Street','17'),
('88888', 'Indian Garden', '99');
INSERT INTO person (ssn,first_name,last_name,address_id,phone_no,email)
VALUES
('195911031337', 'Sirius', 'Black', 1,'0803331100', '[email protected]'),
('198003015555','Ron','Weasley',2,'0735554444','[email protected]'),
('198108118888','Ginny','Weasley',2,'0737778888','[email protected]'),
('198007317777','Harry','Potter',3,'0776669999','[email protected]'),
('194910301234','Molly','Weasley',2,'0737778888',NULL),
('193510041111','Minerva','McGonagall',4,'073777449','[email protected]'),
('196001096666','Severus','Snape',3,'0766666666','[email protected]'),
('197608221111', 'Percy', 'Weasley', 2, '071234567', '[email protected]'),
('198007302222', 'Neville', 'Longbottom', 7, '0736665055', '[email protected]'),
('197911053333', 'Padma', 'Patil',8,'0709801532', '[email protected]'),
('197911053334', 'Parvati', 'Patil', 8, '0709801327', '[email protected]'),
('194612121212', 'Augusta', 'Longbottom', 7, NULL, '[email protected]'),
('188108261111','Albus','Dumbledore',4,'073772141','[email protected]'),
('196303096666','Sybill','Trelawney',4,'0766663422','[email protected]'),
('197605151111', 'Pomona', 'Sprout', 4, '071231123', '[email protected]'),
('189003282222', 'Horace', 'Slughorn', 7, '0736669802', '[email protected]'),
('196401263333', 'Gilderoy', 'Lockhart',4,'0709804423', '[email protected]')
;
INSERT INTO instrument_type (name)
VALUES
('Guitar'),
('Flute'),
('Piano'),
('Drums'),
('Harp');
INSERT INTO instruments (brand, fee, instrument_type_id)
VALUES
('ITK', 200, 1),
('ITK', 200, 1),
('ITK', 300, 1),
('ITK', 300, 1),
('Qmisk', 150, 1),
('Tmeit', 250, 2),
('Tmeit', 250, 2),
('Tmeit', 200, 2),
('ITK', 320, 3),
('ITK', 320, 3),
('Qmisk', 280, 3),
('Qmisk', 280, 3),
('Qmisk', 280, 3),
('Qmisk', 630, 4),
('Tmeit', 200, 4),
('Tmeit', 200, 4),
('Tmeit', 200, 4),
('ITK', 500, 5),
('ITK', 550, 5),
('Fender', 700, 1),
('Fender', 700, 1),
('Fender', 700, 1)
;
INSERT INTO lesson_pricing (type, level, price, discount)
VALUES
('individual','beginner',350, 10),
('individual','intermediate',350, 10),
('individual','advanced',450, 10),
('Group','beginner',300, 5),
('Group','intermediate',300, 5),
('Group','advanced',400, 5),
('Ensemble','beginner',250, 15),
('Ensemble','intermediate',250, 15),
('Ensemble','advanced',350, 15);
INSERT INTO student (person_id, contact_id)
VALUES
(2, 5),
(3, 5),
(4, 1),
(8, 5),
(9, 12),
(10,6),
(11,6)
;
INSERT INTO sibling_relation (student_id_1, student_id_2)
VALUES
(2,3),
(2,8),
(3,8),
(10,11)
;
INSERT INTO instructor (person_id, ensemble_teacher)
VALUES
(6, 'No'),
(7, 'Yes'), --Snape
(13, 'Yes'), --Dumbledore
(14, 'No'),
(15, 'Yes'), --Sprout
(16, 'No'),
(17, 'No');
INSERT INTO instructor_proficiencies (instructor_id, instrument_id)
VALUES
(6, 1),
(6, 3),
(6, 5),
(7, 1),
(7, 2),
(7, 4),
(13, 1),
(13, 2),
(13, 4),
(14, 3),
(14, 2),
(15, 3),
(15, 1),
(15, 5),
(17, 4);
INSERT INTO instrument_lease (lease_start, student_id, instruments_id)
VALUES
('2022-11-30', 2, 6),
('2022-10-05', 3, 10),
('2022-09-20', 2, 1),
('2022-08-17', 4, 5);
INSERT INTO schedule_time (time, date, instructor_id)
VALUES
('10:00', '2022-11-30', 6),
('13:00', '2022-11-30', 13),
('15:00', '2022-11-30', 15),
('09:00', '2022-12-01', 17),
('10:00', '2022-12-02', 6),
('10:00', '2022-12-02', 7),
('10:00', '2022-10-02', 13),
('13:00', '2022-10-08', 15),
('15:00', '2022-10-25', 17),
('10:00', '2021-11-30', 6),
('13:00', '2021-11-30', 13),
('15:00', '2021-11-30', 15),
('09:00', '2021-12-01', 16),
('10:00', '2021-12-02', 6),
('10:00', '2021-12-02', 7),
('10:00', '2021-10-02', 13),
('13:00', '2021-10-08', 16),
('15:00', '2021-10-25', 17),
('10:00', '2022-12-08', 13),
('12:00', '2022-12-08', 13),
('12:00', '2022-12-09', 13),
('16:00', '2022-12-12', 13),
('10:00', '2022-12-13', 15),
('12:00', '2022-12-13', 15),
('12:00', '2022-12-15', 15),
('16:00', '2022-12-15', 15)
;
INSERT INTO lesson (lesson_pricing_id, place, schedule_time_id)
VALUES
(1,'Ka-301', 1), --individual, beginner, instructor 6
(1,'Ka-301', 3), --individual, beginner, instructor 6
(4,'Ka-303', 2), --group, beginner, instructor 7
(4,'Ka-301', 4), --group, beginner, instructor 7
(8,'Ka-303', 6), --ensemble, intermediate, instructor 7
(1,'Ka-301', 14), --individual, beginner, instructor 6
(1,'Ka-301', 7), --individual, beginner, instructor 13
(4,'Ka-303', 13), --group, beginner, instructor 16
(4,'Ka-301', 16), --group, beginner, instructor 13
(8,'Ka-303', 12), --ensemble, intermediate, instructor 15
(7, 'The Great Hall', 19), --instr13
(9, 'Ka-208', 20), --instr13
(7, 'The Great Hall', 21), --instr13
(9, 'Ka-205', 22), --instr13
(7, 'The Great Hall', 23), --instr15
(9, 'Ka-208', 24), --instr15
(8, 'Ka-301', 25), --instr15
(8, 'Ka-301', 26) --instr15
;
INSERT INTO individual_lesson (lesson_id, instrument_type_id)
VALUES
(1, 1), --instructor 6, guitar
(2, 3), --instructor 6, piano
(6, 5), --instructor 6, harp
(7, 2); --instructor 13, piano
INSERT INTO group_lesson (lesson_id, max_num_students, min_num_students, instrument_type_id)
VALUES
(3,15,2,2), --flute
(4,15,2,2), --flute
(8,20,3,1), --guitar
(9,10,2,4); --drums
INSERT INTO ensemble_lesson (lesson_id, max_num_students, min_num_students, genre)
VALUES
(5,20,2,'Heavy Metal'),
(10,16,3,'Pop'),
(11, 2, 1, 'Punk'),
(12, 2, 1, 'Rock'),
(13, 1, 1, 'Jazz'),
(14, 10, 1, 'Ghost'),
(15, 1, 1, 'Choir'),
(16, 10, 1, 'Ghost'),
(17, 1, 1, 'Choir'),
(18, 2, 1, 'Rock')
;
INSERT INTO booking (student_id, lesson_id, time_of_booking)
VALUES
(2,1,now()),
(3,2,now()),
(3,3,now()),
(4,3,now()),
(3,4,now()),
(4,4,now()),
(2,5,now()),
(3,5,now()),
(2,6,now()),
(3,7,now()),
(3,8,now()),
(4,8,now()),
(3,9,now()),
(4,9,now()),
(2,10,now()),
(3,10,now()),
(11, 13, now()),
(9, 15, now()),
(10, 17,now())
;