RelationalDesign: sql insert script.sql

File sql insert script.sql, 3.4 KB (added by 201087, 2 years ago)
Line 
1insert into appuser(ime,prezime,pass,phone_number,city_of_residency,datumragj)
2values ('Filip','Trajkovski','ft12','111-111-111','Skopje',TO_DATE('15/04/2001', 'DD/MM/YYYY')),
3 ('Blagoja','Nikolovski','bn12','111-111-111','Skopje',TO_DATE('01/01/2001', 'DD/MM/YYYY')),
4 ('Darko','Nikolov','dn23','123-234-444','Ohrid',TO_DATE('02/06/1979', 'DD/MM/YYYY')),
5 ('Aleksandar','Aleksandrov','aa23','222-222-222','Veles',TO_DATE('05/05/1994', 'DD/MM/YYYY')),
6 ('Ana','Ristova','ar23','444-222-111','Bitola',TO_DATE('11/12/1989', 'DD/MM/YYYY'));
7
8insert into apartment_owner(ownerid)
9values (11),
10 (12),
11 (13);
12
13insert into administrator(adminid,adminrole)
14values (9,'mod'),
15 (10,'mod');
16
17insert into city(cityname)
18values ('Skopje'),
19 ('Veles'),
20 ('Ohrid'),
21 ('Kumanovo'),
22 ('Stip');
23
24insert into building(cityname,building_adress)
25values ('Skopje','Blaze Koneski 10'),
26 ('Skopje','Gologanov 24'),
27 ('Ohrid', 'Rade Koncar 1'),
28 ('Kumanovo', 'Gologanov 3'),
29 ('Stip', 'Kiro Gligorov 3');
30
31insert into faculty(cityname,fname)
32values ('Skopje','FINKI'),
33 ('Skopje','FEIT'),
34 ('Ohrid','FTU');
35
36insert into student(studentid,facultyid,age,gender)
37values (9,1,21,'male'),
38 (10,1,21,'male');
39
40
41insert into apartment(buildingid,ownerid,apartment_adress,apartment_size)
42values (1,11,'Vlez 4 Stan 3','60m2'),
43 (2,12,'Vlez 1 Stan 12','55m2'),
44 (3,13,'Vlez 3 Stan 6','70m2');
45insert into apartment_agreement(apartmentid,ownerid,studentid,date_signed,date_expires,apartment_rent)
46values (4,11,9,TO_DATE('10/09/2022', 'DD/MM/YYYY'),TO_DATE('30/06/2023', 'DD/MM/YYYY'),250),
47 (5,12,10,TO_DATE('10/09/2022', 'DD/MM/YYYY'),TO_DATE('30/06/2023', 'DD/MM/YYYY'),300);
48insert into apartment_agreement(apartmentid,ownerid,studentid,date_signed,date_expires,apartment_rent)
49values (4,11,10,TO_DATE('10/09/2022', 'DD/MM/YYYY'),TO_DATE('30/06/2023', 'DD/MM/YYYY'),250);
50
51insert into student_signs(studentid,agreementid)
52values (9,3),
53 (10,3)
54
55insert into student_signs(studentid,agreementid)
56values (10,4),
57 (10,5);
58
59insert into post(cityname,number_of_roommates,price,date_posted,description)
60values ('Skopje',2,250,TO_DATE('10/09/2022', 'DD/MM/YYYY'),'baram cimer'),
61 ('Skopje',2,300,TO_DATE('10/09/2022', 'DD/MM/YYYY'),'izdavam stan'),
62 ('Skopje',2,300,TO_DATE('10/09/2022', 'DD/MM/YYYY'),'izdavam stan'),
63 ('Skopje',2,300,TO_DATE('10/09/2022', 'DD/MM/YYYY'),'baram cimer');
64
65
66
67insert into post(cityname,number_of_roommates,price,date_posted,description)
68values ('Skopje',3,250,TO_DATE('10/09/2022', 'DD/MM/YYYY'),'baram cimeri');
69insert into post(cityname,number_of_roommates,price,date_posted,description)
70values ('Ohrid',4,400,TO_DATE('10/09/2022', 'DD/MM/YYYY'),'izdavam stan');
71
72insert into apartment_photos(photosurl)
73values ('link1'),
74 ('link2'),
75 ('link3');
76insert into apartment_photos(photosurl)
77values ('link4');
78
79insert into owner_post(owner_postid,apartmentid,ownerid,apartment_photos)
80values (2,4,11,1),
81 (3,5,12,2);
82insert into owner_post(owner_postid,apartmentid,ownerid,apartment_photos)
83values (6,6,11,4)
84
85insert into student_post(student_postid,studentid)
86values (1,9),
87 (4,10);
88insert into student_post(student_postid,studentid)
89values (5,9);
90
91insert into moderates_posts_for(cityname,adminid)
92values ('Skopje',9),
93 ('Skopje',10),
94 ('Stip',9),
95 ('Veles',10);
96
97
98
99
100