source: DB/polnenje.sql@ e96d444

Last change on this file since e96d444 was 5e4f0d7, checked in by Anita Terziska <63020646+Nit4e@…>, 2 years ago

DB folder containig DDL and DML scripts added

  • Property mode set to 100644
File size: 9.5 KB
RevLine 
[5e4f0d7]1delete from bolnica;
2delete from bolnica_telefonski_broevi;
3delete from covek;
4delete from doktor;
5delete from lekovi;
6delete from oddel;
7delete from pacient;
8delete from pregled;
9delete from recepta;
10delete from rezervacija;
11delete from specijalnost;
12delete from telefonski_broevi;
13delete from termin;
14delete from transakcija;
15delete from upat;
16
17
18
19insert into covek (covek_id, email, pass, ime, prezime, embg) values (1, 'petar.petrov@gmail.com', 'password1', 'Petar', 'Petrov', '1010995495005');
20insert into covek (covek_id, email, pass, ime, prezime, embg) values (2, 'marija.aleksovska@gmail.com', 'password2', 'Marija', 'Aleksovska', '0101991490001');
21insert into covek (covek_id, email, pass, ime, prezime, embg) values (4, 'stojan.gavrilov@gmail.com', 'password3', 'Stojan', 'Gavrilov', '0301000490111');
22insert into covek (covek_id, email, pass, ime, prezime, embg) values (5, 'nikola.nikolovski@gmail.com', 'password4', 'Nikola', 'Nikolovski', '1512999450015');
23insert into covek (covek_id, email, pass, ime, prezime, embg) values (6, 'elena.stojanovska@gmail.com', 'password5', 'Elena', 'Stojanovska', '1906987495017');
24insert into covek (covek_id, email, pass, ime, prezime, embg) values (7, 'ivan.tasev@gmail.com', 'password6', 'Ivan', 'Tasev', '0301000491300');
25insert into covek (covek_id, email, pass, ime, prezime, embg) values (8, 'gligor.petkov@gmail.com', 'password7', 'Gligor', 'Petkov', '0402987891891');
26insert into covek (covek_id, email, pass, ime, prezime, embg) values (9, 'igor.milchev@gmail.com', 'password8', 'Igor', 'Milchev', '2009987123321');
27insert into covek (covek_id, email, pass, ime, prezime, embg) values (10, 'janko.petkov@gmail.com', 'password9', 'Janko', 'Petkov', '3112002121212');
28insert into covek (covek_id, email, pass, ime, prezime, embg) values (11, 'petar.stoev@gmail.com', 'password10', 'Petar', 'Stoev', '2104003490008');
29
30
31
32insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (1, '070-552-111');
33insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (2, '070-552-222');
34insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (2, '070-552-333');
35insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (4, '070-552-444');
36insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (5, '070-552-555');
37insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (6, '070-552-666');
38insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (7, '070-552-777');
39insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (8, '070-552-888');
40insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (9, '070-552-999');
41insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (10, '070-552-121');
42insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (11, '070-552-122');
43insert into telefonski_broevi (covek_broj_id, telefonski_broj) values (2, '070-552-123');
44
45
46
47insert into specijalnost (spec_id, naziv) values (1, 'Otorinolaringologija');
48insert into specijalnost (spec_id, naziv) values (2, 'Dermatovenerologija');
49insert into specijalnost (spec_id, naziv) values (3, 'Oftalmologija');
50insert into specijalnost (spec_id, naziv) values (4, 'Ortopedija');
51insert into specijalnost (spec_id, naziv) values (5, 'Interna medicina');
52insert into specijalnost (spec_id, naziv) values (6, 'Kardiologija');
53insert into specijalnost (spec_id, naziv) values (7, 'Ginekologija');
54insert into specijalnost (spec_id, naziv) values (8, 'Pedijatrija');
55insert into specijalnost (spec_id, naziv) values (9, 'Gastroenterohepatologija');
56insert into specijalnost (spec_id, naziv) values (10, 'Semeen lekar');
57
58
59
60insert into bolnica (bolnica_id, naziv, grad, broj, ulica, smetka_bolnica) values
61 (1, 'Градска Општа болница „8 Септември"', 'Skopje', 3, 'Bledski Dogovor', '123456789'),
62 (2, 'Ј.З.У Специјална болница по гинекологија и акушерство „Мајка Тереза“', 'Skopje', 17, 'Majka Tereza', '213456789'),
63 (3, 'Универзитетската Клиника за Радиотерапија и Онкологија', 'Skopje', 17, 'Majka Tereza', '312456789'),
64 (4, 'ЈЗУ Универзитетски кардиолошки клинички центар', 'Skopje', 17, 'Majka Tereza', '412356789'),
65 (5, 'Градска Општа болница', 'Skopje', 10, '11 Oktomvri', '512346789');
66
67
68
69insert into bolnica_telefonski_broevi (bolnica_id, telefonski_br_bolnica) values
70 (1, '02 3087 400'),
71 (1, '02 3072 125'),
72 (2, '02 4323 132'),
73 (2, '02 3087 133'),
74 (3, '02 3087 405'),
75 (3, '02 3087 311'),
76 (4, '02 3087 500'),
77 (5, '02 3087 522');
78
79
80
81insert into oddel (bolnica_id, oddel_id, naziv, spec_id) values (1, 100, 'Pedijatrija', 8);
82insert into oddel (bolnica_id, oddel_id, naziv, spec_id) values (2, 101, 'Ginekologija', 7);
83insert into oddel (bolnica_id, oddel_id, naziv, spec_id) values (3, 102, 'Interna medicina', 5);
84insert into oddel (bolnica_id, oddel_id, naziv, spec_id) values (4, 103, 'Kardiologija', 6);
85insert into oddel (bolnica_id, oddel_id, naziv, spec_id) values (5, 104, 'Ortopedija', 4);
86insert into oddel (bolnica_id, oddel_id, naziv, spec_id) values (5, 105, 'Otorinolaringologija', 1);
87insert into oddel (bolnica_id, oddel_id, naziv, spec_id) values (1, 106, 'Dermatovenerologija', 2);
88insert into oddel (bolnica_id, oddel_id, naziv, spec_id) values (5, 107, 'Oftalmologija', 3);
89insert into oddel (bolnica_id, oddel_id, naziv, spec_id) values (5, 108, 'Gastroenterohepatologija', 9);
90insert into oddel (bolnica_id, oddel_id, naziv, spec_id) values (1, 109, 'Opsta medicina', 10);
91
92
93
94insert into doktor (doktor_id, br_licenca, opis, spec_id, oddel_id, bolnica_id) values (2, 201, 'Specijalist', 1, 105, 5);
95insert into doktor (doktor_id, br_licenca, opis, spec_id, oddel_id, bolnica_id) values (4, 202, 'Maticen', 10, 109, 1);
96insert into doktor (doktor_id, br_licenca, opis, spec_id, oddel_id, bolnica_id) values (5, 203, 'Specijalist', 2, 106, 1);
97insert into doktor (doktor_id, br_licenca, opis, spec_id, oddel_id, bolnica_id) values (6, 204, 'Specijalist', 6, 103, 4);
98insert into doktor (doktor_id, br_licenca, opis, spec_id, oddel_id, bolnica_id) values (7, 205, 'Specijalist', 4, 104, 5);
99
100
101
102insert into Termin (termin_id, doktor_id, vreme) values (301, 2, now() + interval '3 days');
103insert into Termin (termin_id, doktor_id, vreme) values (302, 2, now() + interval '4 days');
104insert into Termin (termin_id, doktor_id, vreme) values (303, 2, now() + interval '3 days');
105insert into Termin (termin_id, doktor_id, vreme) values (304, 6, now() + interval '5 days');
106insert into Termin (termin_id, doktor_id, vreme) values (305, 6, now() + interval '5 days');
107insert into Termin (termin_id, doktor_id, vreme) values (306, 5, now() + interval '6 days');
108insert into Termin (termin_id, doktor_id, vreme) values (307, 5, now() + interval '10 days');
109insert into Termin (termin_id, doktor_id, vreme) values (308, 7, now() + interval '2 days');
110insert into Termin (termin_id, doktor_id, vreme) values (309, 7, now() + interval '8 days');
111insert into Termin (termin_id, doktor_id, vreme) values (310, 7, ('2021-12-28 08:00')::timestamp);
112insert into Termin (termin_id, doktor_id, vreme) values (311, 5, ('2021-12-25 12:00')::timestamp);
113
114
115
116insert into pacient (covek_pacient_id, pacient_id) values (1, 1001), (8, 1002), (9, 1003), (10, 1004), (11, 1005);
117
118
119
120insert into pregled (pregled_id, vreme, doktor_id, covek_pacient_id) values (1, now(), 2, 1), (2, now(), 4, 8), (3, now(), 5, 9), (4, now(), 6, 10), (5, now(), 7, 1);
121
122
123
124insert into upat (upat_id, dijagnoza, covek_pacient_id, pregled_id, bolnica_id, oddel_id) values (1, 'Bolki vo gradniot kos', 10, 4, 4, 103);
125insert into upat (upat_id, dijagnoza, covek_pacient_id, pregled_id, bolnica_id, oddel_id) values (2, 'Crvenilo na kozata', 9, 3, 1, 106);
126insert into upat (upat_id, dijagnoza, covek_pacient_id, pregled_id, bolnica_id, oddel_id) values (3, 'Bolki vo kolenoto', 1, 5, 5, 104);
127
128
129
130insert into rezervacija (rezervacija_id, upat_id, termin_id, doktor_id) values (500, 1, 304, 6), (501, 2, 306, 5), (502, 3, 309, 7);
131
132
133
134insert into transakcija (tran_id, suma, smetka_bolnica, rezervacija_id) values
135 (600, 50, '512346789', 502), (601, 20, '123456789', 501), (602, 20, '412356789', 500);
136
137
138
139insert into lekovi (lek_id, ime_lek, genericko_ime) values (800, 'Zantac', 'Ranitidine');
140insert into lekovi (lek_id, ime_lek, genericko_ime) values (801, 'Glucophage', 'Metformin');
141insert into lekovi (lek_id, ime_lek, genericko_ime) values (802, 'Prandin', 'Repaglinide');
142insert into lekovi (lek_id, ime_lek, genericko_ime) values (803, 'Ticlid', 'Ticlopidine');
143insert into lekovi (lek_id, ime_lek, genericko_ime) values (804, 'Nitroglycerin', 'Glyceryl trinitrate');
144insert into lekovi (lek_id, ime_lek, genericko_ime) values (805, 'Cardura', 'Doxazosin');
145insert into lekovi (lek_id, ime_lek, genericko_ime) values (806, 'Amoksiklav', 'Amoxicillin');
146
147
148
149insert into recepta (recepta_id, datum_izdavanje, datum_vaznost, datum_kupuvanje, pregled_id, lek_id, doktor_id, covek_pacient_id) values
150 (900, now(), now()+interval '10 days', now()+interval '1 days', 1, 800, 2, 1),
151 (901, now(), now()+interval '10 days', now()+interval '8 days', 2, 801, 4, 8);
152
153
154
155insert into recepta (recepta_id, datum_izdavanje, datum_vaznost, pregled_id, lek_id, doktor_id, covek_pacient_id) values
156 (902, now(), now()+interval '10 days', 3, 806, 5, 9);
157
158
Note: See TracBrowser for help on using the repository browser.