1 | SET FOREIGN_KEY_CHECKS = 0;
|
---|
2 | DELETE FROM Objekt;
|
---|
3 | DELETE FROM Vo_Izgradba;
|
---|
4 | DELETE FROM Gotov;
|
---|
5 | DELETE FROM Nadzor;
|
---|
6 | DELETE FROM Podizveduvac;
|
---|
7 | DELETE FROM Rabotnik;
|
---|
8 | DELETE FROM Dobavuvac;
|
---|
9 | DELETE FROM Nabavka;
|
---|
10 | DELETE FROM Korisnik;
|
---|
11 | DELETE FROM Sopstvenik;
|
---|
12 | DELETE FROM Raboti_Na;
|
---|
13 | DELETE FROM Raboti_Za;
|
---|
14 | DELETE FROM Nadgleduva;
|
---|
15 | DELETE FROM Pobaruva;
|
---|
16 | DELETE FROM Nameneta_Za;
|
---|
17 | DELETE FROM Odobruva;
|
---|
18 | DELETE FROM Oddrzuva;
|
---|
19 | DELETE FROM Ispolnuva;
|
---|
20 |
|
---|
21 |
|
---|
22 | -- Insert data into Korisnik
|
---|
23 | INSERT INTO Korisnik (UID, Username, Password, Privilegii) VALUES
|
---|
24 | (1, 'admin', 'Nectar7-Awry2-Tapioca6-Cycle4-Yapping9', 0),
|
---|
25 | (2, 'upravitel', 'Nectar7-Awry2-Tapioca6-Cycle4-Yapping9', 0),
|
---|
26 | (3, 'mile', 'Poncho6-Geologist6-Dropkick6-Haiku8-Blabber4', 1),
|
---|
27 | (4, 'sasha', 'passwordabc', 1),
|
---|
28 | (5, 'vlatko', '19781212vlatkovlatko', 1),
|
---|
29 | (6, 'magi', 'hudawlsd8987897', 1),
|
---|
30 | (7, 'akvaterm', 'passworq-pwefh-awddef', 2),
|
---|
31 | (8, 'betaelektrik', 'cnqe0w9uhcvaosudhjbcvoq', 2),
|
---|
32 | (9, 'dzidarprom', '0q823794tygrhfbaku', 2),
|
---|
33 | (10, 'fasadaplus', '123123pasvord', 2),
|
---|
34 | (11, 'primakrov', 'passworddef', 2),
|
---|
35 | (12, 'dvornikenz', 'asdasdasd123123', 2),
|
---|
36 | (13, 'rolokraft', '131313kuchemache', 2),
|
---|
37 | (14, 'megaenterier', 'testtest123123', 2),
|
---|
38 | (15, 'fullconstruct', 'bsjFvS235Fhk', 2);
|
---|
39 |
|
---|
40 | -- Insert data into Sopstvenik
|
---|
41 | INSERT INTO Sopstvenik (UID) VALUES
|
---|
42 | (1);
|
---|
43 |
|
---|
44 | -- Insert data into Nadzor
|
---|
45 | INSERT INTO Nadzor (Nadzor_Ime, Plata, Kvalifikacii, Firma, UID) VALUES
|
---|
46 | ('Mile Kolevski', 50000, 'Civil Engineer', 'Domashen', 2),
|
---|
47 | ('Sasha Ketic', 60000, 'Structural Engineer', 'ArchiCore', 3),
|
---|
48 | ('Vlatko Senkov', 55000, 'Project Manager', 'BuildCorp', 4),
|
---|
49 | ('Magdalena Filipova', 58000, 'Architect', 'DesignWorks', 5);
|
---|
50 |
|
---|
51 | -- Insert data into Podizveduvac
|
---|
52 | INSERT INTO Podizveduvac (Podizveduvac_Ime, Struka, Br_vraboteni, Saatnica, UID) VALUES
|
---|
53 | ('Akva Term', 'Plumbing', 3, 40.0, 7),
|
---|
54 | ('Beta Elektrik', 'Electrical', 2, 45.0, 8),
|
---|
55 | ('Dzidar Prom', 'Construction', 5, 30.0, 9),
|
---|
56 | ('Fasada Plus', 'Construction', 4, 40.0, 10),
|
---|
57 | ('Prima Krov', 'Roofing', 3, 35.0, 11),
|
---|
58 | ('Dvornik Enzinering', 'Landscaping', 2, 25.0, 12),
|
---|
59 | ('RoloKraft', 'Doors/Windows', 2, 35.0, 13),
|
---|
60 | ('Mega Enterier', 'Interior', 4, 40.0, 14),
|
---|
61 | ('FullConstruct', 'Hybrid', 7, 45.0, 15);
|
---|
62 |
|
---|
63 | -- Insert data into Rabotnik
|
---|
64 | INSERT INTO Rabotnik (Maticen_br, Ime, Seniornost) VALUES
|
---|
65 | (1508198501234, 'Aleksandar', 'Senior'),
|
---|
66 | (2307199005678, 'Dimitar', 'Associate'),
|
---|
67 | (0502198802345, 'Stefan', 'Assistant'),
|
---|
68 | (1803199204567, 'Vladimir', 'Senior'),
|
---|
69 | (1012199707890, 'Nikola', 'Assistant'),
|
---|
70 | (0708198501234, 'Petar', 'Associate'),
|
---|
71 | (2203199105678, 'Igor', 'Senior'),
|
---|
72 | (0304198902345, 'Goran', 'Assistant'),
|
---|
73 | (2606199504567, 'Filip', 'Associate'),
|
---|
74 | (1207199307890, 'Mihail', 'Assistant'),
|
---|
75 | (0405198501234, 'Marko', 'Senior'),
|
---|
76 | (2306198805678, 'Dragan', 'Assistant'),
|
---|
77 | (0902199202345, 'Dejan', 'Associate'),
|
---|
78 | (1508199404567, 'Zoran', 'Senior'),
|
---|
79 | (2104199107890, 'Nenad', 'Assistant'),
|
---|
80 | (1905198701234, 'Slavko', 'Associate'),
|
---|
81 | (0802198905678, 'Milan', 'Senior'),
|
---|
82 | (2403199502345, 'Bojan', 'Assistant'),
|
---|
83 | (1706199304567, 'Mladen', 'Associate'),
|
---|
84 | (0110199107890, 'Saša', 'Assistant'),
|
---|
85 | (2601199201234, 'Arben', 'Senior'),
|
---|
86 | (1406199405678, 'Adnan', 'Associate'),
|
---|
87 | (2003199702345, 'Besnik', 'Assistant'),
|
---|
88 | (0507199004567, 'Elvir', 'Senior'),
|
---|
89 | (0704199307890, 'Agron', 'Assistant'),
|
---|
90 | (1011199101234, 'Lirim', 'Associate'),
|
---|
91 | (1806199505678, 'Alban', 'Senior'),
|
---|
92 | (3008199602345, 'Fatmir', 'Assistant'),
|
---|
93 | (1705199104567, 'Ilir', 'Associate'),
|
---|
94 | (2202199007890, 'Gazmend', 'Assistant'),
|
---|
95 | (2409198801234, 'Kristijan', 'Assistant'),
|
---|
96 | (0212199005678, 'Tome', 'Associate');
|
---|
97 |
|
---|
98 | -- Insert data into Dobavuvac
|
---|
99 | INSERT INTO Dobavuvac (Dobavuvac_Ime, Klasa, Tip, Poteklo) VALUES
|
---|
100 | ('MegaPlast', 'A', 'Materijal', 'Domestic'),
|
---|
101 | ('GlobalSupplies', 'B', 'Oprema', 'International'),
|
---|
102 | ('MetroMaterial', 'A', 'Materijal', 'Domestic'),
|
---|
103 | ('UrbanTools', 'C', 'Alat', 'International'),
|
---|
104 | ('CraftEquip', 'B', 'Materijal', 'International');
|
---|
105 |
|
---|
106 | -- Insert data into Nabavka
|
---|
107 | INSERT INTO Nabavka (Nabavka_ID, Datum, Cena, Kolicina, Predmet) VALUES
|
---|
108 | (1, '2025-01-01', 1000.0, 50, 'Cement'),
|
---|
109 | (2, '2025-01-02', 500.0, 20, 'Steel Rods'),
|
---|
110 | (3, '2025-01-03', 300.0, 100, 'Brick'),
|
---|
111 | (4, '2025-01-04', 200.0, 10, 'Paint'),
|
---|
112 | (5, '2025-01-05', 400.0, 30, 'Wood'),
|
---|
113 | (6, '2025-01-06', 300.0, 100, 'Brick'),
|
---|
114 | (7, '2025-01-07', 800.0, 40, 'Cement'),
|
---|
115 | (8, '2025-01-08', 600.0, 25, 'Steel Rods'),
|
---|
116 | (9, '2025-01-09', 450.0, 15, 'Tiles'),
|
---|
117 | (10, '2025-01-10', 200.0, 10, 'Paint'),
|
---|
118 | (11, '2025-01-11', 350.0, 20, 'Wood'),
|
---|
119 | (12, '2025-01-12', 700.0, 35, 'Cement'),
|
---|
120 | (13, '2025-01-13', 250.0, 50, 'Brick'),
|
---|
121 | (14, '2025-01-14', 150.0, 8, 'Paint'),
|
---|
122 | (15, '2025-01-15', 500.0, 25, 'Steel Rods'),
|
---|
123 | (16, '2025-01-16', 400.0, 20, 'Plaster'),
|
---|
124 | (17, '2025-01-17', 1000.0, 30, 'Ceramics'),
|
---|
125 | (18, '2025-01-18', 300.0, 15, 'Tiles'),
|
---|
126 | (19, '2025-01-19', 200.0, 10, 'Paint'),
|
---|
127 | (20, '2025-01-20', 400.0, 50, 'Brick'),
|
---|
128 | (21, '2025-01-21', 350.0, 25, 'Cement'),
|
---|
129 | (22, '2025-01-22', 300.0, 15, 'Wood'),
|
---|
130 | (23, '2025-01-23', 600.0, 30, 'Steel Rods'),
|
---|
131 | (24, '2025-01-24', 250.0, 12, 'Tiles'),
|
---|
132 | (25, '2025-01-25', 500.0, 50, 'Brick'),
|
---|
133 | (26, '2025-01-26', 150.0, 8, 'Paint'),
|
---|
134 | (27, '2025-01-27', 700.0, 40, 'Cement'),
|
---|
135 | (28, '2025-01-28', 400.0, 20, 'Plaster'),
|
---|
136 | (29, '2025-01-29', 1000.0, 25, 'Fire Extinguishers'),
|
---|
137 | (30, '2025-01-29', 1000.0, 25, 'General Tools'),
|
---|
138 | (31, '2025-01-30', 450.0, 30, 'Safety Equipment');
|
---|
139 |
|
---|
140 |
|
---|
141 | -- Insert data into Objekt
|
---|
142 | INSERT INTO Objekt (Objekt_ID, Tip, Adresa) VALUES
|
---|
143 | (1, 'Commercial', 'Ulica ulicovska br. 6 Skopje'),
|
---|
144 | (2, 'Commercial', 'Ulica 23 br. 4 Skopje'),
|
---|
145 | (3, 'Commercial', 'Ulica Ruzveltova br. 8 Valandovo'),
|
---|
146 | (4, 'Mixed-Use', 'Ulica 4 br. 7 Veles'),
|
---|
147 | (5, 'Commercial', 'Ulica 17 br 2 Shtip');
|
---|
148 |
|
---|
149 | -- Insert data into Vo_Izgradba
|
---|
150 | INSERT INTO Vo_Izgradba (Objekt_ID, Budzet) VALUES
|
---|
151 | (1, 500000.0),
|
---|
152 | (3, 750000.0);
|
---|
153 |
|
---|
154 | -- Insert data into Gotov
|
---|
155 | INSERT INTO Gotov (Objekt_ID) VALUES
|
---|
156 | (2),
|
---|
157 | (4),
|
---|
158 | (5);
|
---|
159 |
|
---|
160 | -- Insert data into Raboti_Na
|
---|
161 | INSERT INTO Raboti_Na (Objekt_ID, Podizveduvac_Ime, Saati) VALUES
|
---|
162 | (1, 'Akva Term', 45),
|
---|
163 | (1, 'Beta Elektrik', 56),
|
---|
164 | (1, 'Dzidar Prom', 54),
|
---|
165 | (1, 'Fasada Plus', 74),
|
---|
166 | (1, 'Prima Krov', 43),
|
---|
167 | (1, 'Dvornik Enzinering', 54),
|
---|
168 | (1, 'RoloKraft', 55),
|
---|
169 | (1, 'Mega Enterier', 38),
|
---|
170 | (1, 'FullConstruct', 68),
|
---|
171 | (2, 'Akva Term', 27),
|
---|
172 | (2, 'Beta Elektrik', 53),
|
---|
173 | (2, 'Dzidar Prom', 77),
|
---|
174 | (2, 'Fasada Plus', 44),
|
---|
175 | (2, 'Prima Krov', 37),
|
---|
176 | (2, 'Dvornik Enzinering', 43),
|
---|
177 | (2, 'RoloKraft', 16),
|
---|
178 | (2, 'Mega Enterier', 23),
|
---|
179 | (2, 'FullConstruct', 29);
|
---|
180 |
|
---|
181 | -- Mapping Rabotnik to Podizveduvac based on Br_vraboteni
|
---|
182 | INSERT INTO Raboti_Za (Maticen_br, Podizveduvac_Ime) VALUES
|
---|
183 | (1508198501234, 'Akva Term'),
|
---|
184 | (2307199005678, 'Akva Term'),
|
---|
185 | (0502198802345, 'Akva Term'),
|
---|
186 | (1803199204567, 'Beta Elektrik'),
|
---|
187 | (1012199707890, 'Beta Elektrik'),
|
---|
188 | (0708198501234, 'Dzidar Prom'),
|
---|
189 | (2203199105678, 'Dzidar Prom'),
|
---|
190 | (0304198902345, 'Dzidar Prom'),
|
---|
191 | (2606199504567, 'Dzidar Prom'),
|
---|
192 | (1207199307890, 'Dzidar Prom'),
|
---|
193 | (0405198501234, 'Fasada Plus'),
|
---|
194 | (2306198805678, 'Fasada Plus'),
|
---|
195 | (0902199202345, 'Fasada Plus'),
|
---|
196 | (1508199404567, 'Fasada Plus'),
|
---|
197 | (2104199107890, 'Prima Krov'),
|
---|
198 | (1905198701234, 'Prima Krov'),
|
---|
199 | (0802198905678, 'Prima Krov'),
|
---|
200 | (2403199502345, 'Dvornik Enzinering'),
|
---|
201 | (1706199304567, 'Dvornik Enzinering'),
|
---|
202 | (0110199107890, 'RoloKraft'),
|
---|
203 | (2601199201234, 'RoloKraft'),
|
---|
204 | (1406199405678, 'Mega Enterier'),
|
---|
205 | (2003199702345, 'Mega Enterier'),
|
---|
206 | (0507199004567, 'Mega Enterier'),
|
---|
207 | (0704199307890, 'Mega Enterier'),
|
---|
208 | (1011199101234, 'FullConstruct'),
|
---|
209 | (1806199505678, 'FullConstruct'),
|
---|
210 | (3008199602345, 'FullConstruct'),
|
---|
211 | (1705199104567, 'FullConstruct'),
|
---|
212 | (2202199007890, 'FullConstruct'),
|
---|
213 | (2409198801234, 'FullConstruct'),
|
---|
214 | (0212199005678, 'FullConstruct');
|
---|
215 |
|
---|
216 | -- Insert data into Nadgleduva
|
---|
217 | INSERT INTO Nadgleduva (Objekt_ID, Nadzor_Ime) VALUES
|
---|
218 | (1, 'Sasha Ketic'),
|
---|
219 | (3, 'Magdalena Filipova');
|
---|
220 |
|
---|
221 | -- Insert data into Pobaruva
|
---|
222 | INSERT INTO Pobaruva (Nabavka_ID, Podizveduvac_Ime) VALUES
|
---|
223 | (1, 'Akva Term'),
|
---|
224 | (2, 'Beta Elektrik'),
|
---|
225 | (3, 'Dzidar Prom'),
|
---|
226 | (4, 'Fasada Plus'),
|
---|
227 | (5, 'Prima Krov'),
|
---|
228 | (6, 'Akva Term'),
|
---|
229 | (7, 'Beta Elektrik'),
|
---|
230 | (8, 'Dzidar Prom'),
|
---|
231 | (9, 'Fasada Plus'),
|
---|
232 | (10, 'Prima Krov'),
|
---|
233 | (11, 'Akva Term'),
|
---|
234 | (12, 'Beta Elektrik'),
|
---|
235 | (13, 'Dzidar Prom'),
|
---|
236 | (14, 'Fasada Plus'),
|
---|
237 | (15, 'Prima Krov'),
|
---|
238 | (16, 'Akva Term'),
|
---|
239 | (17, 'Beta Elektrik'),
|
---|
240 | (18, 'Dzidar Prom'),
|
---|
241 | (19, 'Fasada Plus'),
|
---|
242 | (20, 'Prima Krov'),
|
---|
243 | (21, 'Akva Term'),
|
---|
244 | (22, 'Beta Elektrik'),
|
---|
245 | (23, 'Dzidar Prom'),
|
---|
246 | (24, 'Fasada Plus'),
|
---|
247 | (25, 'Prima Krov'),
|
---|
248 | (26, 'Akva Term'),
|
---|
249 | (27, 'Beta Elektrik'),
|
---|
250 | (28, 'Dzidar Prom'),
|
---|
251 | (29, 'Fasada Plus'),
|
---|
252 | (30, 'Prima Krov'),
|
---|
253 | (31, 'FullConstruct');
|
---|
254 |
|
---|
255 | -- Insert data into Odobruva
|
---|
256 | INSERT INTO Odobruva (Nabavka_ID, Nadzor_Ime) VALUES
|
---|
257 | (1, 'Sasha Ketic'),
|
---|
258 | (2, 'Magdalena Filipova'),
|
---|
259 | (3, 'Magdalena Filipova'),
|
---|
260 | (4, 'Sasha Ketic'),
|
---|
261 | (5, 'Magdalena Filipova'),
|
---|
262 | (6, 'Magdalena Filipova'),
|
---|
263 | (7, 'Magdalena Filipova'),
|
---|
264 | (8, 'Magdalena Filipova'),
|
---|
265 | (9, 'Sasha Ketic'),
|
---|
266 | (10, 'Sasha Ketic'),
|
---|
267 | (11, 'Magdalena Filipova'),
|
---|
268 | (12, 'Magdalena Filipova'),
|
---|
269 | (13, 'Magdalena Filipova'),
|
---|
270 | (14, 'Magdalena Filipova'),
|
---|
271 | (15, 'Magdalena Filipova'),
|
---|
272 | (16, 'Sasha Ketic'),
|
---|
273 | (17, 'Sasha Ketic'),
|
---|
274 | (18, 'Magdalena Filipova'),
|
---|
275 | (19, 'Sasha Ketic'),
|
---|
276 | (20, 'Magdalena Filipova'),
|
---|
277 | (21, 'Magdalena Filipova'),
|
---|
278 | (22, 'Magdalena Filipova'),
|
---|
279 | (23, 'Magdalena Filipova'),
|
---|
280 | (24, 'Sasha Ketic'),
|
---|
281 | (25, 'Magdalena Filipova'),
|
---|
282 | (26, 'Magdalena Filipova'),
|
---|
283 | (27, 'Sasha Ketic'),
|
---|
284 | (28, 'Sasha Ketic'),
|
---|
285 | (29, 'Sasha Ketic'),
|
---|
286 | (30, 'Sasha Ketic'),
|
---|
287 | (31, 'Magdalena Filipova');
|
---|
288 |
|
---|
289 | -- Insert data into Nameneta_Za
|
---|
290 | INSERT INTO Nameneta_Za (Nabavka_ID, Objekt_ID) VALUES
|
---|
291 | (1, '3'),
|
---|
292 | (2, '1'),
|
---|
293 | (3, '1'),
|
---|
294 | (4, '1'),
|
---|
295 | (5, '3'),
|
---|
296 | (6, '3'),
|
---|
297 | (7, '3'),
|
---|
298 | (8, '3'),
|
---|
299 | (9, '1'),
|
---|
300 | (10, '1'),
|
---|
301 | (11, '3'),
|
---|
302 | (12, '3'),
|
---|
303 | (13, '3'),
|
---|
304 | (14, '3'),
|
---|
305 | (15, '3'),
|
---|
306 | (16, '1'),
|
---|
307 | (17, '1'),
|
---|
308 | (18, '3'),
|
---|
309 | (19, '1'),
|
---|
310 | (20, '3'),
|
---|
311 | (21, '3'),
|
---|
312 | (22, '3'),
|
---|
313 | (23, '3'),
|
---|
314 | (24, '1'),
|
---|
315 | (25, '3'),
|
---|
316 | (26, '3'),
|
---|
317 | (27, '1'),
|
---|
318 | (28, '1'),
|
---|
319 | (29, '1'),
|
---|
320 | (30, '1'),
|
---|
321 | (31, '3');
|
---|
322 |
|
---|
323 | -- Insert data into Ispolnuva
|
---|
324 | INSERT INTO Ispolnuva (Nabavka_ID, Dobavuvac_Ime) VALUES
|
---|
325 | (1, 'GlobalSupplies'),
|
---|
326 | (2, 'MegaPlast'),
|
---|
327 | (3, 'GlobalSupplies'),
|
---|
328 | (4, 'UrbanTools'),
|
---|
329 | (5, 'MegaPlast'),
|
---|
330 | (6, 'UrbanTools'),
|
---|
331 | (7, 'CraftEquip'),
|
---|
332 | (8, 'CraftEquip'),
|
---|
333 | (9, 'UrbanTools'),
|
---|
334 | (10, 'GlobalSupplies'),
|
---|
335 | (11, 'CraftEquip'),
|
---|
336 | (12, 'GlobalSupplies'),
|
---|
337 | (13, 'UrbanTools'),
|
---|
338 | (14, 'MegaPlast'),
|
---|
339 | (15, 'GlobalSupplies'),
|
---|
340 | (16, 'UrbanTools'),
|
---|
341 | (17, 'UrbanTools'),
|
---|
342 | (18, 'GlobalSupplies'),
|
---|
343 | (19, 'MetroMaterial'),
|
---|
344 | (20, 'CraftEquip'),
|
---|
345 | (21, 'GlobalSupplies'),
|
---|
346 | (22, 'MetroMaterial'),
|
---|
347 | (23, 'MetroMaterial'),
|
---|
348 | (24, 'GlobalSupplies'),
|
---|
349 | (25, 'CraftEquip'),
|
---|
350 | (26, 'MetroMaterial'),
|
---|
351 | (27, 'MegaPlast'),
|
---|
352 | (28, 'GlobalSupplies'),
|
---|
353 | (29, 'GlobalSupplies'),
|
---|
354 | (30, 'MetroMaterial'),
|
---|
355 | (31, 'UrbanTools');
|
---|
356 |
|
---|
357 | -- Insert data into Oddrzuva
|
---|
358 | INSERT INTO Oddrzuva (Objekt_ID, Podizveduvac_Ime, Saati) VALUES
|
---|
359 | (2, 'FullConstruct', 25),
|
---|
360 | (4, 'FullConstruct', 20),
|
---|
361 | (4, 'Akva Term', 43),
|
---|
362 | (5, 'FullConstruct', 12);
|
---|
363 |
|
---|
364 | -- Enable foreign key checks
|
---|
365 | SET FOREIGN_KEY_CHECKS = 1;
|
---|