-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sql
More file actions
102 lines (78 loc) · 3.17 KB
/
test.sql
File metadata and controls
102 lines (78 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
INSERT INTO "user"
("login", "password")
VALUES
('ivan123', 'password123'),
('petr456', 'password456'),
('sid789', 'password789');
INSERT INTO "client"
("user_id", "email", "first_name", "second_name", "surname", "phone")
VALUES
(1, 'ivan@example.com', 'Иванов', 'Иван', 'Иваныч', '+1234567890'),
(2, 'petr@example.com', 'Петров', 'Петр', 'Петрович', '+9876543210'),
(3, 'sid@example.com', 'Сидрова', 'Сидора', NULL, '+5555555555');
INSERT INTO "service"
("name", "alias", "description", "cost")
VALUES
('Чистка лица', 'cleaning', NULL, 85),
('Уход Options', 'care_options', NULL, 98);
('Уход So delicate', 'care_so_delicate', NULL, 95);
INSERT INTO "staff"
("user_id", "first_name", "second_name", "email", "position", "phone")
VALUES
(1, 'John', 'Doe', 'john.doe@example.com', 'Stylist', '+1234567890'),
(2, 'Jane', 'Smith', 'jane.smith@example.com', 'Manicurist', '+9876543210');
INSERT INTO "schedule"
("client_id", "service_id", "staff_id", "start_date", "duration", "notes")
VALUES
(1, 1, 1, '2023-10-05 10:00:00', 1.5, 'Notes for the appointment'),
(2, 2, 2, '2023-10-06 15:30:00', 2, NULL);
INSERT INTO "schedule"
("client_id", "service_id", "staff_id", "start_date", "duration", "notes")
VALUES
(1, 1, 1, '2023-10-05 10:00:00', 1.5, 'Notes for the appointment'),
(2, 2, 1, '2023-10-06 15:30:00', 2, NULL);
INSERT INTO "schedule"
("client_id", "service_id", "staff_id", "start_date", "duration", "notes")
VALUES
(3, 1, 1, '2023-10-05 10:00:00', 1.5, 'Notes for the appointment'),
(3, 2, 1, '2023-10-06 15:30:00', 2, NULL);
INSERT INTO "schedule"
("client_id", "service_id", "staff_id", "start_date", "duration", "notes")
VALUES
(2, 1, 1, '2023-10-05 10:00:00', 1.5, 'Notes for the appointment');
INSERT INTO "admin"
("user_id", "unique_id")
VALUES
(1, 'admin123'),
(2, 'admin456');
INSERT INTO "product"
("name", "alias", "quantity", "supply_date", "client_cost", "supply_cost", "cost_diff")
VALUES
('Молочко', 'milk', 50, '2023-10-01 08:00:00', 99, 80.99, 18.01),
('Тоник', 'tonic', 100, '2023-10-02 14:00:00', 5.99, 3.99, 2);
('Крем для лица', 'cream', 100, '2023-10-02 14:00:00', 5.99, 3.99, 2);
INSERT INTO "sale"
("client_id", "product_id", "quantity", "sale_date")
VALUES
(1, 1, 2, '2023-10-03 09:30:00'),
(2, 2, 1, '2023-10-04 16:45:00');
INSERT INTO "review"
("schedule_id", "client_id", "rating", "comment")
VALUES
(1, 1, 4, 'Great service!'),
(2, 2, 5, 'Highly recommend!');
INSERT INTO "finance"
("type", "sum", "date", "sale_id", "schedule_id", "supply_id", "notes")
VALUES
('income', 50, '2023-10-03 10:00:00', 1, NULL, NULL, 'Payment for haircut'),
('expense', 10, '2023-10-04 17:00:00', NULL, 2, NULL, 'Payment for manicure');
INSERT INTO "supply"
("product_id", "type", "quantity", "sum")
VALUES
(1, 1, 50, 399.50),
(2, 2, 100, 299.00);
INSERT INTO "log"
("date", "client_id", "info")
VALUES
('2023-10-03 10:30:00', 1, 'Appointment booked'),
('2023-10-04 17:30:00', 2, 'Appointment cancelled');