-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAUTOCAREAllSQLQueries
1637 lines (1375 loc) · 36.3 KB
/
AUTOCAREAllSQLQueries
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*Creating Tables from Strongest ones*/
/*--- 1. Customers ---*/
CREATE TABLE Customers
(
CustomerID VARCHAR(15) NOT NULL UNIQUE,
CustomerName VARCHAR(100) NOT NULL,
CustomerEmail VARCHAR(100),
CustomerPassword VARCHAR(50) NOT NULL,
CustomerPhone VARCHAR(20),
CustomerAddress VARCHAR(150),
PRIMARY KEY (CustomerID),
CHECK (CustomerID LIKE ('Cus-%') AND
CustomerEmail LIKE ('%gmail.com'))
);
/*--- 2. Branches ---*/
CREATE TABLE Branches
(
BranchID VARCHAR(15) NOT NULL UNIQUE,
BranchName VARCHAR(50),
BranchLocation VARCHAR(150),
GarageSpaceCapacity TINYINT,
AvailableSpaces TINYINT,
PRIMARY KEY (BranchID),
CHECK (BranchID LIKE ('Br-%'))
);
/*--- 3. Promotions ---*/
CREATE TABLE Promotions
(
PromotionID VARCHAR(15) NOT NULL UNIQUE,
PromotionCode VARCHAR(15) NOT NULL,
MinimumCosts DECIMAL(10,2),
PromotionDiscount DECIMAL(5,2),
PromotionStartDate DATE,
PromotionEndDate DATE,
PromotionDescription VARCHAR(200),
PromotionActive VARCHAR(10),
PRIMARY KEY (PromotionID),
CHECK (PromotionID LIKE ('Promo-%') AND
PromotionActive IN ('Active','Expired'))
);
/*--- 4. ServiceTypes ---*/
CREATE TABLE ServiceTypes
(
ServiceTypeID VARCHAR(15) NOT NULL UNIQUE,
ServiceTypeName VARCHAR(30),
ServiceTypeDescription VARCHAR(200),
PRIMARY KEY (ServiceTypeID),
CHECK (ServiceTypeID LIKE ('St-%'))
);
/*--- 5. VehicleTypes ---*/
CREATE TABLE VehicleTypes
(
VehicleTypeID VARCHAR(15) NOT NULL UNIQUE,
VehicleTypeName VARCHAR(50),
VehicleTypeDescription VARCHAR(200),
PRIMARY KEY (VehicleTypeID),
CHECK (VehicleTypeID LIKE ('Vt-%'))
);
/*--- 6. Employees ---*/
CREATE TABLE Employees
(
EmployeeID VARCHAR(15) NOT NULL UNIQUE,
EmployeeName VARCHAR(100),
Gender VARCHAR(20),
BranchID VARCHAR(15) NOT NULL,
EmployeePosition VARCHAR(30),
DateOfBirth DATE,
EmployeeAddress VARCHAR(150),
EmployeePhone VARCHAR(20),
PRIMARY KEY (EmployeeID),
FOREIGN KEY (BranchID) REFERENCES Branches (BranchID) ON UPDATE CASCADE,
CHECK (EmployeeID LIKE ('Emp-%') AND
BranchID LIKE ('Br-%') AND
Gender IN ('Male' ,'Female' ,'LGBTIQ'))
);
/*--- 7. Vehicles ---*/
CREATE TABLE Vehicles
(
VehicleID VARCHAR(15) NOT NULL UNIQUE,
VehicleName VARCHAR(100),
VehicleTypeID VARCHAR(15),
VehicleModel VARCHAR(30),
VehicleLicenseNumber VARCHAR(8),
VehicleImage VARBINARY(MAX),
VehicleMainColor VARCHAR(20),
PRIMARY KEY (VehicleID),
FOREIGN KEY (VehicleTypeID) REFERENCES VehicleTypes (VehicleTypeID) ON UPDATE CASCADE,
CHECK (VehicleID LIKE ('V-%') AND
VehicleTypeID LIKE ('Vt-%'))
);
/*--- 8. Services ---*/
CREATE TABLE Services
(
ServiceID VARCHAR(15) NOT NULL UNIQUE,
ServiceName VARCHAR(50),
ServiceTypeID VARCHAR(15) NOT NULL,
VehicleTypeID VARCHAR(15),
ServiceDescription VARCHAR(200),
ServiceDuration TIME,
ServiceStatus VARCHAR(20),
ServicePrice DECIMAL(10,2),
PRIMARY KEY (ServiceID),
FOREIGN KEY (ServiceTypeID) REFERENCES ServiceTypes (ServiceTypeID) ON UPDATE CASCADE,
FOREIGN KEY (VehicleTypeID) REFERENCES VehicleTypes (VehicleTypeID) ON UPDATE CASCADE,
CHECK (ServiceID LIKE ('S-%') AND
ServiceTypeID LIKE ('St-%') AND
VehicleTypeID LIKE ('Vt-%') AND
ServiceStatus IN ('Active', 'Temporarily paused', 'Terminated'))
);
/*--- 9. VehicleTypeServices ---*/
CREATE TABLE VehicleTypeServices
(
ServiceID VARCHAR(15),
VehicleTypeID VARCHAR(15),
Primary Key (ServiceID, VehicleTypeID),
FOREIGN KEY (ServiceID) REFERENCES Services (ServiceID) ON UPDATE CASCADE,
FOREIGN KEY (VehicleTypeID) REFERENCES VehicleTypes (VehicleTypeID),
CHECK (ServiceID LIKE ('S-%') AND
VehicleTypeID LIKE ('Vt-%'))
);
/*--- 10. Ratings ---*/
CREATE TABLE Ratings
(
RatingID VARCHAR(15) NOT NULL UNIQUE,
CustomerID VARCHAR(15) NOT NULL,
ServiceID VARCHAR(15) NOT NULL,
RatingAmount TINYINT NOT NULL,
RatingDate DATE,
PRIMARY KEY (RatingID),
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID) ON UPDATE CASCADE,
FOREIGN KEY (ServiceID) REFERENCES Services (ServiceID) ON UPDATE CASCADE,
CHECK (RatingID LIKE ('Rt-%') AND
CustomerID LIKE ('Cus-%') AND
ServiceID LIKE ('S-%') AND
RatingAmount IN (1,2,3,4,5))
);
/*--- 11. GarageSpaces ---*/
CREATE TABLE GarageSpaces
(
GarageSpaceID VARCHAR(15) NOT NULL UNIQUE,
BranchID VARCHAR(15) NOT NULL,
GarageSpaceNumber VARCHAR(10), /*change to varchar*/
GarageSpaceStatus VARCHAR(15),
PRIMARY KEY (GarageSpaceID),
FOREIGN KEY (BranchID) REFERENCES Branches (BranchID) ON UPDATE CASCADE,
CHECK (GarageSpaceID LIKE ('Gs-%') AND
BranchID LIKE ('Br-%') AND
GarageSpaceStatus IN ('Free', 'Taken', 'Disabled'))
);
/*--- 12. Bookings ---*/
CREATE TABLE Bookings
(
BookingID VARCHAR(15) NOT NULL UNIQUE,
CustomerID VARCHAR(15) NOT NULL,
BookingDate DATE,
ServedLocation VARCHAR(15),
GarageSpaceID VARCHAR(15),
BookingStartTime TIME, /*Domain*/
BookingEndTime TIME,
BookingStatus VARCHAR(20),
CancellationReason VARCHAR(150),
TotalCosts DECIMAL(10,2),
PromotionID VARCHAR(15),
PromotionDiscountAmount DECIMAL(10,2),
NetCosts DECIMAL(10,2),
PaymentDueDate DATE,
RemainingAmount DECIMAL(10,2),
PaymentStatus VARCHAR(20),
PRIMARY KEY (BookingID),
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID) ON UPDATE CASCADE,
FOREIGN KEY (GarageSpaceID) REFERENCES GarageSpaces (GarageSpaceID) ON UPDATE CASCADE,
FOREIGN KEY (PromotionID) REFERENCES Promotions (PromotionID) ON UPDATE CASCADE,
CHECK (BookingID LIKE ('Bk-%') AND
CustomerID LIKE ('Cus-%') AND
GarageSpaceID LIKE ('Gs-%') AND
PromotionID LIKE ('Promo-%') AND
ServedLocation IN ('Home', 'Garage') AND
BookingStatus IN ('Pending', 'Accepted', 'Cancelled', 'On The Way', 'Work In Progress', 'Final Checked', 'All Finished') AND
PaymentStatus IN ('Fully Paid', 'Partially Paid', 'No Payment Made', 'Refunded'))
);
/*--- 13. BookedServices ---*/
CREATE TABLE BookedServices
(
BookingID VARCHAR(15) NOT NULL,
ServiceID VARCHAR(15) NOT NULL,
PRIMARY KEY (BookingID, ServiceID),
FOREIGN KEY (BookingID) REFERENCES Bookings (BookingID) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (ServiceID) REFERENCES Services (ServiceID) ON UPDATE CASCADE,
CHECK (BookingID LIKE ('Bk-%') AND
ServiceID LIKE ('S-%'))
);
/*--- 14. Comments ---*/
CREATE TABLE Comments
(
CommentID VARCHAR(15) NOT NULL UNIQUE,
BookingID VARCHAR(15) NOT NULL,
CommentText VARCHAR(200),
CommentTimestamp DATETIME,
PRIMARY KEY (CommentID),
FOREIGN KEY (BookingID) REFERENCES Bookings (BookingID) ON UPDATE CASCADE,
CHECK (CommentID LIKE ('Cmt-%') AND
BookingID LIKE ('Bk-%'))
);
/*--- 15. Payments ---*/
CREATE TABLE Payments
(
PaymentID VARCHAR(15) NOT NULL UNIQUE,
BookingID VARCHAR(15) NOT NULL,
PaymentDate DATE,
PaymentType VARCHAR(10),
PaymentMethod VARCHAR(15),
PaymentAmount DECIMAL(10,2),
PRIMARY KEY (PaymentID),
FOREIGN KEY (BookingID) REFERENCES Bookings (BookingID) ON UPDATE CASCADE,
CHECK (PaymentID LIKE ('Pay-%') AND
BookingID LIKE ('Bk-%') AND
PaymentType IN ('Full', 'Partial') AND
PaymentMethod IN ('Cash', 'CB Pay', 'KBZ Pay', 'Wave Pay', 'JCB MPU'))
);
/*--- 16. AdminReplies ---*/
CREATE TABLE AdminReplies
(
ReplyID VARCHAR(15) NOT NULL UNIQUE,
CommentID VARCHAR(15) NOT NULL,
EmployeeID VARCHAR(15) NOT NULL,
ReplyText VARCHAR(200),
ReplyTimestamp DATETIME,
PRIMARY KEY (ReplyID),
FOREIGN KEY (CommentID) REFERENCES Comments (CommentID) ON UPDATE CASCADE,
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
CHECK (ReplyID LIKE ('Rp-%') AND
CommentID LIKE ('Cmt-%') AND
EmployeeID LIKE ('Emp-%'))
);
/*Insert into/ Create new rows into Tables*/
/* 1. Customers */
INSERT INTO Customers
(CustomerID,
CustomerName,
CustomerEmail,
CustomerPassword,
CustomerPhone,
CustomerAddress)
VALUES ('Cus-001',
'CiCi289',
'cici289',
'09798457867',
'No.15/201, ATP street, MGTN Township, Yangon.'),
('Cus-002',
'U Aung Aung',
'aungaung183',
'09572426746',
'No.34/G, 124th street, MGTN Township, Yangon.'),
('Cus-003',
'Kyaw Thet',
'KyawThet123',
'09798356246',
'No.20/ 201, Sapal street, AL Township, Yangon.'),
('Cus-004',
'U Aung Min Thein',
'AungMT235',
'095188325',
'No.124/ 301, 51st street, BTH Township, Yangon.'),
('Cus-005',
'Ko Kan Kaung',
'KKKLucky!',
'09756835626',
'No.9/ 501, 140th street, TM Township, Yangon.');
SELECT * FROM Customers;
/* 2. Branches */
INSERT INTO Branches
(BranchID,
BranchName,
BranchLocation,
GarageSpaceCapacity,
AvailableSpaces)
VALUES ('Br-001',
'Pansoedan Branch',
'No.77, Upper Pansoedan Road, MGTN Township, Yangon.',
15,
14),
('Br-002',
'North Dagon Branch',
'No.269, Pyi Htaung Su Road, ND Township, Yangon.',
15,
14),
('Br-003',
'South Oakkalapa Branch',
'No.333, Thit Sar Road, SOK Township, Yangon.',
15,
14);
SELECT * FROM Branches;
/* 3. Promotions */
INSERT INTO Promotions
(PromotionID,
PromotionCode,
MinimumCosts,
PromotionDiscount,
PromotionStartDate,
PromotionEndDate,
PromotionDescription,
PromotionActive)
VALUES ('Promo-001',
'XmasAC',
30000,
0.1,
'2022-12-25',
'2022-12-26',
'Promotion event of AutoCare for Christmas. Customers with spending of 30000 and above will gain 10 percent discount within promo days.',
'Expired'),
('Promo-002',
'NYAC2023',
50000,
0.1,
'2022-12-31',
'2023-1-5',
'Promotion event of AutoCare for New Year 2023. Customers with spending of 50000 and above will gain 10 percent discount within promo days.',
'Expired'),
('Promo-003',
'CNYAC2023',
30000,
0.1,
'2023-1-22',
'2023-1-31',
'Promotion event of AutoCare for Chinese New Year. Customers with spending of 30000 and above will gain 10 percent discount within promo days.',
'Active');
SELECT * FROM Promotions;
/* 4. ServiceTypes */
INSERT INTO ServiceTypes
(ServiceTypeID,
ServiceTypeName,
ServiceTypeDescription)
VALUES ('St-001',
'In-Garage',
'A wide range of services will be offered at our branches garage, if customers chooses this In-Garage Service. Prices may vary.'),
('St-002',
'Home',
'A limited range of services will be offered in this type. We will send fleets to your home or driveway of car location and offer services. Duration may be longer and Prices may vary.'),
('St-003',
'Pick Up',
'A wide range of services will be offered. We will send fleets to your location to pick up your car.');
SELECT * FROM ServiceTypes;
/* 5. VehicleTypes */
INSERT INTO VehicleTypes
(VehicleTypeID,
VehicleTypeName,
VehicleTypeDescription)
VALUES ('Vt-001',
'Compact',
'Smallest overall dimension, Smallest engine capacity, HP'),
('Vt-002',
'Medium',
'Larger overall dimension, Similar/Larger engine capacity, HP'),
('Vt-003',
'Van/SUV',
'Larger overall dimension, Larger engine capacity, HP'),
('Vt-004',
'Compact Truck',
'Largest overall dimension, Larger engine capacity, HP with a storage container.');
SELECT * FROM VehicleTypes;
/* 6. Employees */
INSERT INTO Employees
(EmployeeID,
EmployeeName,
Gender,
BranchID,
EmployeePosition,
DateOfBirth,
EmployeeAddress,
EmployeePhone)
VALUES ('Emp-001',
'U Aung Thin',
'Male',
'Br-001',
'Manager',
'1976-10-12',
'No.23/ 201, Kant Kaw Street, YG Township, Yangon.',
'09751748673'),
('Emp-002',
'Ko Kyaw Khin',
'Male',
'Br-001',
'Technician',
'1990-9-18',
'No.213, Wutt Kyaung Street, YK Township, Yangon.',
'0951756846'),
('Emp-003',
'Ko Aung Kyaw',
'Male',
'Br-001',
'Admin',
'1995-4-25',
'No.24/ 201, 124th Street, MGTN Township, Yangon.',
'0951446643'),
('Emp-004',
'U Aung Hein',
'Male',
'Br-002',
'Admin',
'1980-5-28',
'No.102/ A, 30th Street, BTH Township, Yangon.',
'09894538673'),
('Emp-005',
'Ko Myat Tun',
'Male',
'Br-002',
'Detail Technician',
'1985-10-1',
'No.23/ 201, 150th Street, MGTN Township, Yangon.',
'09798465713'),
('Emp-006',
'Ko Tun Tun',
'Male',
'Br-002',
'Manager',
'1990-12-1',
'No.123/ 201, 132nd Street, MGTN Township, Yangon.',
'095155836'),
('Emp-007',
'Ko Jone Lwin',
'Male',
'Br-003',
'Admin',
'1995-8-16',
'No.24/ B, 31st Street, YK Township, Yangon.',
'098945862867'),
('Emp-008',
'Ma Saw Sandar',
'Female',
'Br-003',
'Manager',
'1980-12-2',
'No.50, 160th Street, TM Township, Yangon.',
'0951684867'),
('Emp-009',
'Ko Aung Thaw',
'Male',
'Br-003',
'Technician',
'1986-6-6',
'No.27/201, 90th Street, MGTN Township, Yangon.',
'09894585385');
SELECT * FROM Employees;
/* 7. Vehicles */
INSERT INTO Vehicles
(VehicleID,
VehicleName,
VehicleTypeID,
VehicleModel,
VehicleLicenseNumber,
VehicleImage,
VehicleMainColor)
VALUES ('V-001',
'Volkswagen Beetle',
'Vt-001',
'2020',
'9Q-6969',
NULL,
'Cyan'),
('V-002',
'Honda Civic',
'Vt-001',
'2019',
'5H-1122',
NULL,
'Black'),
('V-003',
'Chevrolet Silverado',
'Vt-002',
'2019',
'4M-5678',
NULL,
'Ultramarine'),
('V-004',
'Toyota Tundra',
'Vt-002',
'2020',
'5H-3264',
NULL,
'White'),
('V-005',
'Ford Ranger',
'Vt-004',
'2018',
'7F-1236',
NULL,
'Crimson Red');
SELECT * FROM Vehicles;
/* 8. Services */
INSERT INTO Services
(ServiceID,
ServiceName,
ServiceTypeID,
VehicleTypeID,
ServiceDescription,
ServiceDuration,
ServiceStatus,
ServicePrice)
VALUES ('S-001',
'Car Wash for Compacts(Garage)',
'St-001',
'Vt-001',
'Car wash service for Compact cars, Done at our branches garages.',
'00:30:00',
'Active',
5000),
('S-002',
'Car Wash for Mediums(Garage)',
'St-001',
'Vt-002',
'Car wash service for Medium cars, Done at our branches garages.',
'00:35:00',
'Active',
6000),
('S-003',
'Car Wash for Van/SUVs(Garage)',
'St-001',
'Vt-003',
'Car wash service for Van/SUVs cars, Done at our branches garages.',
'00:45:00',
'Active',
7000),
('S-004',
'Car Wash for Compact Trucks(Garage)',
'St-001',
'Vt-004',
'Car wash service for Compact Trucks, Done at our branches garages.',
'00:45:00',
'Active',
9000),
('S-005',
'Car Wash for Compacts(Home)',
'St-002',
'Vt-001',
'Car wash service for Compact cars, Done at your location. Transportation fees added.',
'00:45:00',
'Active',
7000),
('S-006',
'Car Wash for Mediums(Home)',
'St-002',
'Vt-002',
'Car wash service for Medium cars, Done at your location. Transportation fees added.',
'00:50:00',
'Active',
8000),
('S-007',
'Car Wash for Van/Suvs(Home)',
'St-002',
'Vt-003',
'Car wash service for Van/SUVs cars, Done at your location. Transportation fees added.',
'1:00:00',
'Active',
9000),
('S-008',
'Car Wash for Compact Trucks(Home)',
'St-002',
'Vt-004',
'Car wash service for Compact Trucks, Done at your location. Transportation fees added.',
'1:10:00',
'Temporarily paused',
11000),
('S-009',
'Car Polish for Compact(Garage)',
'St-001',
'Vt-001',
'Car polish service for Compact cars, Done at our branches garages.',
'1:30:00',
'Active',
13000),
('S-010',
'Car Polish for Medium(Garage)',
'St-001',
'Vt-002',
'Car polish service for Medium cars, Done at our branches garages.',
'1:35:00',
'Active',
14000),
('S-011',
'Car Polish for Van/SUVs(Garage)',
'St-001',
'Vt-003',
'Car polish service for Vans/SUVs cars, Done at our branches garages.',
'2:00:00',
'Active',
16000),
('S-012',
'Car Polish for Compact(Home)',
'St-002',
'Vt-001',
'Car Polish service for Compact cars, Done at your location. Transportation fees added.',
'1:45:00',
'Active',
15000),
('S-013',
'Car Polish for Medium(Home)',
'St-002',
'Vt-002',
'Car wash service for Medium cars, Done at your location. Transportation fees added.',
'1:50:00',
'Active',
16000),
('S-014',
'Interior Cleaning for Compact(Garage)',
'St-001',
'Vt-001',
'Interior cleaning service for Compact cars, Done at our branches garages.',
'1:15:00',
'Active',
10000),
('S-015',
'Interior Cleaning for Medium(Garage)',
'St-001',
'Vt-002',
'Interior cleaning service for Medium cars, Done at our branches garages.',
'1:15:00',
'Active',
12000),
('S-016',
'Interior Cleaning for Van/SUV(Garage)',
'St-001',
'Vt-003',
'Interior cleaning service for Van/SUVs cars, Done at our branches garages.',
'1:45:00',
'Active',
15000),
('S-017',
'3D wheel alignment for Compact(Garage)',
'St-001',
'Vt-001',
'3D wheel alignment service for Compact cars, Done at our branches garages.',
'1:00:00',
'Active',
20000),
('S-018',
'3D wheel alignment for Medium(Garage)',
'St-001',
'Vt-001',
'3D wheel alignment service for Medium cars, Done at our branches garages.',
'1:00:00',
'Active',
20000);
SELECT * FROM Services;
SELECT ServiceID, VehicleTypeID FROM Services
Order BY ServiceID;
/* 9. VehicleTypeServices */
INSERT INTO VehicleTypeServices
(ServiceID,
VehicleTypeID)
VALUES ('S-001',
'Vt-001'),
('S-002',
'Vt-002'),
('S-003',
'Vt-003'),
('S-004',
'Vt-004'),
('S-005',
'Vt-001'),
('S-006',
'Vt-002'),
('S-007',
'Vt-003'),
('S-008',
'Vt-004'),
('S-009',
'Vt-001'),
('S-010',
'Vt-002'),
('S-011',
'Vt-003'),
('S-012',
'Vt-001'),
('S-013',
'Vt-002'),
('S-014',
'Vt-001'),
('S-015',
'Vt-002'),
('S-016',
'Vt-003'),
('S-017',
'Vt-001'),
('S-018',
'Vt-002');
SELECT * FROM VehicleTypeServices;
/* 10. GarageSpaces */
INSERT INTO GarageSpaces
(GarageSpaceID,
BranchID,
GarageSpaceNumber,
GarageSpaceStatus)
VALUES ('Gs-001',
'Br-001',
'1',
'Taken'),
('Gs-002',
'Br-001',
'2',
'Free'),
('Gs-003',
'Br-001',
'3',
'Free'),
('Gs-004',
'Br-001',
'4',
'Free'),
('Gs-005',
'Br-001',
'5',
'Free'),
('Gs-006',
'Br-001',
'6',
'Free'),
('Gs-007',
'Br-001',
'7',
'Free'),
('Gs-008',
'Br-001',
'8',
'Free'),
('Gs-009',
'Br-001',
'9',
'Free'),
('Gs-010',
'Br-001',
'10',
'Free'),
('Gs-011',
'Br-001',
'11',
'Free'),
('Gs-012',
'Br-001',
'12',
'Free'),
('Gs-013',
'Br-001',
'13',
'Free'),
('Gs-014',
'Br-001',
'14',
'Free'),
('Gs-015',
'Br-001',
'15',
'Free'),
('Gs-016',
'Br-002',
'1',
'Taken'),
('Gs-017',
'Br-002',
'2',
'Free'),
('Gs-018',
'Br-002',
'3',
'Free'),
('Gs-019',
'Br-002',
'4',
'Free'),
('Gs-020',
'Br-002',
'5',
'Free'),
('Gs-021',
'Br-002',
'6',
'Free'),
('Gs-022',
'Br-002',
'7',
'Free'),
('Gs-023',
'Br-002',
'8',
'Free'),
('Gs-024',
'Br-002',
'9',
'Free'),
('Gs-025',
'Br-002',
'10',
'Free'),
('Gs-026',
'Br-002',
'11',
'Free'),
('Gs-027',
'Br-002',
'12',
'Free'),
('Gs-028',
'Br-002',
'13',
'Free'),
('Gs-029',
'Br-002',
'14',
'Free'),
('Gs-030',
'Br-002',
'15',
'Free'),
('Gs-031',
'Br-003',
'1',
'Free'),
('Gs-032',
'Br-003',
'2',
'Free'),
('Gs-033',
'Br-003',
'3',
'Free'),
('Gs-034',
'Br-003',
'4',
'Free'),
('Gs-035',
'Br-003',
'5',
'Free'),
('Gs-036',
'Br-003',
'6',
'Free'),
('Gs-037',
'Br-003',
'7',
'Free'),
('Gs-038',
'Br-003',
'8',
'Free'),