RelationalSchema: dml.sql

File dml.sql, 2.5 KB (added by 226030, 10 days ago)
Line 
1INSERT INTO users(id,email,password,phone_number,street,city)
2VALUES
3 (1,'test@hotmail.com','password1','070003005','Mladinska 3','Strumica'),
4 (2, 'test2@hotmail.com','password2','070001002','Marsal Tito 10','Strumica'),
5 (3,'test3@hotmail.com','password1','070003003','Mladinska 5','Strumica'),
6 (4, 'test4@hotmail.com','password2','070004004','Marsal Tito 11','Strumica'),
7 (5,'test5@hotmail.com','password1','070005005','Mladinska 12','Strumica');
8
9INSERT INTO employees(user_id,net_salary,gross_salary)
10VALUES
11 (1,30000,40000),
12 (3,50000,62000),
13 (4,35000,46000),
14 (5,28000,37000);
15
16INSERT INTO managers(employee_id)
17VALUES
18 (3);
19
20INSERT INTO staff_roles(id,name)
21VALUES
22 (1,'Server'),
23 (2,'Chef'),
24 (3,'Bartender'),
25 (4,'Hostess');
26
27INSERT INTO front_staff(employee_id,tip_percent,staff_role_id)
28VALUES
29 (1,.4,1),
30 (5,0.1,4);
31
32INSERT INTO back_staff(employee_id,staff_role_id)
33VALUES
34 (4,2);
35
36INSERT INTO customers(user_id)
37VALUES
38 (2);
39
40INSERT INTO shifts (id, date, start_time, end_time, manager_id)
41VALUES
42(1, '2025-01-05', '09:00:00', '17:00:00', 3);
43
44INSERT INTO assignments(id,clock_in_time,clock_out_time,manager_id,employee_id,shift_id)
45VALUES
46 (1,NULL,NULL,3,1,1);
47
48INSERT INTO tables(table_number,capacity)
49VALUES
50 (1,4),
51 (2,8);
52
53INSERT INTO reservations(id,customer_id,datetime,stay_length)
54VALUES
55 (1,2,now(),NULL);
56
57INSERT INTO frontstaff_managed_reservations(id,reservation_id,front_staff_id,table_number)
58VALUES
59 (1,1,5,1);
60
61INSERT INTO categories(id,name)
62VALUES
63 (1,'Drinks'),
64 (2,'Appetizers'),
65 (3,'Entrees');
66
67INSERT INTO products(id,name,price,category_id,manage_inventory)
68VALUES
69 (1,'Coca Cola',100,1,TRUE),
70 (2,'Pomfrit so sirenje',250,2,FALSE);
71
72INSERT INTO inventories(product_id,quantity)
73VALUES
74 (1,100);
75
76
77INSERT INTO orders(id,status,datetime)
78VALUES
79 (1,'PENDING','2025-01-05 10:00:00'),
80 (2,'ACCEPTED','2025-01-05 10:00:00'),
81 (3,'CONFIRMED','2025-01-05 11:00:00');
82
83INSERT INTO order_items(id,order_id,product_id,is_processed,quantity)
84VALUES
85 (1,1,1,TRUE,3),
86 (2,1,2,FALSE,1),
87 (3,3,2,FALSE,2),
88 (4,3,1,FALSE,2);
89
90
91
92INSERT INTO tab_orders(order_id,front_staff_id,table_number)
93VALUES
94 (1,1,1);
95
96INSERT INTO online_orders(order_id,delivery_address,customer_id)
97VALUES
98 (3,'Leninova 5',2);
99
100INSERT INTO payments(id,order_id,amount,timestamp)
101VALUES
102 (1,3,700,'2025-01-05 11:00:00')