RelationalDesign2: polnenje.sql

File polnenje.sql, 2.3 KB (added by 175012, 6 days ago)
Line 
1
2set search_path = "project";
3
4
5delete from "project".customer;
6
7delete from "project".package;
8delete from "project"."policy";
9delete from "project".pol_dog;
10delete from "project".auto_pol;
11delete from "project".travel_pol;
12delete from "project".pol_osi;
13delete from "project".vehicle;
14delete from "project".covers;
15delete from "project".payment;
16delete from "project".property_pol;
17delete from "project".property;
18
19
20-- type = 1 administrator, type=2 customer
21insert into project.customer (c_id, name,email,"password","type") values
22(1,'Administrator', 'a@trustshield.com', 'aa321','0'),
23(2,'Ardit', 'ardit@gmail.com', 'aaa2456','1'),
24(3,'Dragana', 'dragana@hotmail.com', 'sss8989','1');
25
26
27
28insert into project.package (code, title, total, valuet) values
29(1, 'Package Gold', 15000, 'Den'),
30(2, 'Package Gold1', 18000, 'Den'),
31(3, 'Package Gold2', 25000, 'Den');
32
33
34insert into project."policy" (p_id,sdate,edate,package) values
35(1, '20231221','20241220',1),
36(2, '20231212','20231220',2),
37(3, '20231205','20231210',3);
38
39
40
41insert into project.pol_dog (d_embg,c_id,"name","policy",surname,birthdate,kontakt) values
42(290699945,2,'Ardit',1,'Ameti','19990629','070926854'),
43(290699900,3,'Dragana',2,'Stojanovic','20000105','070852654'),
44(290699942,2,'Ardit',3,'Ameti','19990629','070926854');
45
46
47insert into project.auto_pol (a_id,pol_id) values
48(1,1),
49(2,3);
50
51
52insert into project.travel_pol (tr_id, pol_id) values
53(1,2);
54
55
56insert into project.pol_osi (o_embg ,"policy","name",surname,birthdate,kontakt) values
57(290699900,1,'Dragana','Stojanovic','20000105','070852654');
58
59insert into project.vehicle (v_id,"policy","type",marka,model,license_plate) values
60(1,1,'avto','BMW','x1','sk0869bc'),
61(2,2,'bus','volvo','tmpx2','sk7469ap');
62
63insert into project.covers (cov_id, cov_amount, package, "cov_type") values
64(1,1000,1,'travel'),
65(2.1500,2,'vehicle'),
66(3,2000,3,'property');
67
68insert into project.payment (payment_num, "policy", p_date,p_amount,) values
69(1,1,'20241012',21000),
70(2,2,'20240911',25000),
71(3,3,'20240205',19000);
72
73insert into project.property_pol (pr_id,pol_id) values
74(1,3);
75
76insert into project.property (prop_id,"policy","address",floor,year_build,security) values
77(1,3,'Skopje,Butel 2,Rokomija 49',2,'20021001',1)
78(2,3,'Kumanovo,11 Oktomvri,Br 1',2,'20050811',0)