forked from JamesWicks01/SolentBoats_Database_Extended
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.psql
1393 lines (922 loc) · 41.3 KB
/
main.psql
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
--CREATES
DROP DATABASE IF EXISTS grp21_solent; -- RESET DATABASE
CREATE DATABASE grp21_solent; -- CREATE
\c grp21_solent;
-- ENUMS
CREATE TYPE FUEL AS ENUM(
'PETROL',
'DIESEL',
'HYBRID'
);
CREATE TYPE "DESC" AS ENUM(
'SERVICE',
'CHECKUP',
'REPAIR',
'OTHER'
);
CREATE TYPE HISTORY_TYPE AS ENUM(
'BOOKED',
'ONGOING',
'COMPLETE'
);
CREATE TYPE CATEGORY_TYPE AS ENUM(
'MINOR',
'SERIOUS',
'DANGEROUS'
);
-- TABLES
-- THERE ARE 18 TABLES ENSURE THIS IS CORRECT
-- CREATE THE TABLES, PK, FKS, CONSTRAINTS
CREATE TABLE country(
country_id SERIAL PRIMARY KEY,
country_name VARCHAR(54) UNIQUE NOT NULL
);
CREATE TABLE city(
city_id SERIAL PRIMARY KEY,
country_id INT NOT NULL,
city_name VARCHAR(34) NOT NULL, -- UNIQUE SHOULD NOT BE HERE AMERICA AND UK SHARE CITIES
FOREIGN KEY (country_id) REFERENCES country(country_id)
);
CREATE TABLE "address"(
address_id SERIAL PRIMARY KEY,
city_id INT NOT NULL,
address_postcode VARCHAR(8) NOT NULL,
address_one VARCHAR(50) NOT NULL,
address_two VARCHAR(50),
FOREIGN KEY (city_id) REFERENCES city(city_id)
);
CREATE TABLE facilities(
facilities_id SERIAL PRIMARY KEY,
facilities_name VARCHAR(24)
);
CREATE TABLE yard(
yard_id SERIAL PRIMARY KEY,
address_id INT NOT NULL,
yard_size INT NOT NULL,
yard_name VARCHAR(64) NOT NULL,
yard_tel VARCHAR(20) NOT NULL,
FOREIGN KEY (address_id) REFERENCES "address"(address_id)
);
CREATE TABLE yard_facilities(
yard_id INT NOT NULL,
facilities_id INT NOT NULL,
PRIMARY KEY (yard_id, facilities_id),
FOREIGN KEY (yard_id) REFERENCES yard(yard_id),
FOREIGN KEY (facilities_id) REFERENCES facilities(facilities_id)
);
CREATE TABLE customer(
customer_id SERIAL PRIMARY KEY,
address_id INT NOT NULL,
customer_fname VARCHAR(64) NOT NULL,
customer_mname VARCHAR(64),
customer_lname VARCHAR(64) NOT NULL,
customer_tel1 VARCHAR(20) UNIQUE NOT NULL,
customer_tel2 VARCHAR(20),
customer_email1 VARCHAR(50) UNIQUE NOT NULL,
customer_email2 VARCHAR(50),
customer_priv BOOLEAN DEFAULT 'F',
customer_represent_company VARCHAR(64),
FOREIGN KEY (address_id) REFERENCES "address"(address_id)
);
CREATE TABLE staff(
staff_id SERIAL PRIMARY KEY,
address_id INT NOT NULL,
staff_fname VARCHAR(64) NOT NULL,
staff_mname VARCHAR(64),
staff_lname VARCHAR(64) NOT NULL,
staff_tel VARCHAR(20) UNIQUE NOT NULL,
staff_email VARCHAR(50) UNIQUE NOT NULL,
FOREIGN KEY (address_id) REFERENCES "address"(address_id)
);
CREATE TABLE "role"(
role_id SERIAL PRIMARY KEY,
role_name VARCHAR(32) NOT NULL
);
CREATE TABLE staff_role(
staff_id INT NOT NULL,
role_id INT NOT NULL,
PRIMARY KEY (staff_id, role_id),
FOREIGN KEY (staff_id) REFERENCES staff(staff_id),
FOREIGN KEY (role_id) REFERENCES "role"(role_id)
);
CREATE TABLE staff_yard(
staff_id INT NOT NULL,
yard_id INT NOT NULL,
PRIMARY KEY (staff_id, yard_id),
FOREIGN KEY (staff_id) REFERENCES staff(staff_id),
FOREIGN KEY (yard_id) REFERENCES yard(yard_id)
);
CREATE TABLE manufacture(
manufacture_id SERIAL PRIMARY KEY,
manufacture_name VARCHAR(128) UNIQUE NOT NULL,
manufacture_model VARCHAR(64) NOT NULL,
manufacture_height DECIMAL(10, 2) NOT NULL,
manufacture_length DECIMAL(10, 2) NOT NULL,
manufacture_width DECIMAL(10, 2) NOT NULL,
manufacture_fuel FUEL NOT NULL,
manufacture_engine VARCHAR(32) NOT NULL,
manufacture_bhp SMALLINT NOT NULL,
manufacture_hull VARCHAR(64) NOT NULL,
manufacture_capacity SMALLINT NOT NULL,
manufacture_email VARCHAR(64) UNIQUE NOT NULL,
manufacture_phone VARCHAR(20) UNIQUE NOT NULL
);
CREATE TABLE boat(
boat_id SERIAL PRIMARY KEY,
customer_id INT NOT NULL,
manufacture_id INT NOT NULL,
country_id INT NOT NULL,
boat_mic VARCHAR(50) UNIQUE NOT NULL,
boat_built DATE NOT NULL,
boat_oem BOOLEAN NOT NULL,
boat_registration DATE NOT NULL,
FOREIGN KEY (customer_id) REFERENCES customer(customer_id),
FOREIGN KEY (manufacture_id) REFERENCES manufacture(manufacture_id),
FOREIGN KEY (country_id) REFERENCES country(country_id)
);
CREATE TABLE "service"(
service_id SERIAL PRIMARY KEY,
boat_id INT NOT NULL,
yard_id INT NOT NULL,
service_cost DECIMAL(10, 2),
service_type "DESC" NOT NULL,
service_note VARCHAR(254),
FOREIGN KEY (boat_id) REFERENCES boat(boat_id),
FOREIGN KEY (yard_id) REFERENCES yard(yard_id)
);
CREATE TABLE staff_service(
staff_id INT NOT NULL,
service_id INT NOT NULL,
PRIMARY KEY (staff_id, service_id),
FOREIGN KEY (staff_id) REFERENCES staff(staff_id),
FOREIGN KEY (service_id) REFERENCES "service"(service_id)
);
CREATE TABLE fault(
fault_id SERIAL PRIMARY KEY,
fault_cat CATEGORY_TYPE NOT NULL,
fault_name VARCHAR(64)
);
CREATE TABLE service_fault(
service_id INT NOT NULL,
fault_id INT NOT NULL,
PRIMARY KEY (service_id, fault_id),
FOREIGN KEY (service_id) REFERENCES "service"(service_id),
FOREIGN KEY (fault_id) REFERENCES fault(fault_id)
);
CREATE TABLE history(
history_id SERIAL PRIMARY KEY,
service_id INT NOT NULL,
history_type HISTORY_TYPE NOT NULL,
history_date DATE NOT NULL,
FOREIGN KEY (service_id) REFERENCES "service"(service_id)
);
-- Currency
-- SET lc_monetary = 'en_GB'; does not work on VM
-- Indexes
CREATE INDEX address_postcode_idx ON "address" (address_postcode);
CREATE INDEX country_name_idx ON country (country_name);
CREATE INDEX city_name_idx ON city (city_name);
CREATE INDEX customer_id_idx ON boat (customer_id);
CREATE INDEX boat_mic_idx ON boat (boat_mic);
CREATE INDEX service_boat_id_idx ON "service" (boat_id);
CREATE INDEX service_type_idx ON "service" (service_type);
CREATE INDEX yard_name_idx ON yard (yard_name);
CREATE INDEX customer_tel_idx ON customer (customer_tel1);
CREATE INDEX customer_email_idx ON customer (customer_email1);
CREATE INDEX customer_represent_company_idx ON customer (customer_represent_company);
CREATE INDEX staff_tel_idx ON staff (staff_tel);
CREATE INDEX staff_email_idx ON staff (staff_email);
CREATE INDEX history_type_idx ON history (history_type) WHERE history_type = 'COMPLETE';
CREATE INDEX manufacture_name_idx ON manufacture (manufacture_name);
CREATE INDEX manufacture_email_idx ON manufacture (manufacture_email);
CREATE INDEX manufacture_phone_idx ON manufacture (manufacture_phone);
-- \d
-- \d
INSERT INTO country(country_name)
VALUES ('England');
INSERT INTO country(country_name)
VALUES ('Wales');
INSERT INTO country(country_name)
VALUES ('Scotland');
INSERT INTO country(country_name)
VALUES ('Ireland');
INSERT INTO country(country_name)
VALUES ('Northern Ireland');
INSERT INTO city(country_id, city_name)
VALUES (1, 'London');
INSERT INTO city(country_id, city_name)
VALUES (2, 'Cardiff');
INSERT INTO city(country_id, city_name)
VALUES (3, 'Edinburgh');
INSERT INTO city(country_id, city_name)
VALUES (4, 'Dublin');
INSERT INTO city(country_id, city_name)
VALUES (5, 'Belfast');
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (1, 'XR65 4CU', '77511 Forest Run Street', 'Room 450');
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (1, 'MT57 5JD', '7986 Pankratz Hill', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (1, 'GP98 6JH', '8 David Terrace', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (1, 'OF52 9UH', '5625 High Crossing Center', 'Suite 96');
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (1, 'GJ47 8WQ', '60 Maywood Alley', 'PO Box 3802');
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (2, 'AK07 2MZ', '2 Vidon Hill', 'Suite 44');
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (2, 'SK71 6UC', '097 Nevada Junction', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (2, 'ZG15 6KE', '3016 Carioca Hill', 'PO Box 94254');
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (2, 'WE10 6NB', '3867 Fremont Place', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (2, 'LS89 7JF', '035 Meadow Ridge Hill', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (3, 'GQ17 0IX', '197 Bartillon Point', 'Room 914');
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (3, 'OI19 2NP', '38828 Morrow Road', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (3, 'NI19 7ON', '85062 Vermont Center', 'Suite 7');
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (3, 'JE40 4MX', '66367 Carberry Hill', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (3, 'CS40 7EN', '191 Eggendart Trail', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (4, 'NE66 0HO', '24217 Charing Cross Park', 'Suite 65');
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (4, 'ME39 1DN', '41041 Schlimgen Pass', 'Room 1423');
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (4, 'YK00 0EX', '42 Lotheville Crossing', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (4, 'EP49 0EX', '04341 Corscot Plaza', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (4, 'VI09 0DB', '33004 Colorado Street', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (1, 'XR21 5TF', '819 Lighthouse Bay Circle', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (2, 'LE65 0FT', '64889 Dorton Road', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (3, 'OV67 8VH', '21376 Burning Wood Way', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (4, 'YW97 2OB', '64092 Novick Center', NULL);
INSERT INTO "address" (city_id,
address_postcode,
address_one,
address_two)
VALUES (5, 'DU48 7AN', '2526 Farragut Avenue', NULL);
INSERT INTO facilities(facilities_name)
VALUES ('Warehouse');
INSERT INTO facilities(facilities_name)
VALUES ('Dry Dock');
INSERT INTO facilities(facilities_name)
VALUES ('Wet Slip');
INSERT INTO facilities(facilities_name)
VALUES ('Maintenance');
INSERT INTO facilities(facilities_name)
VALUES ('Sail Repair');
INSERT INTO facilities(facilities_name)
VALUES ('Fuel Station');
INSERT INTO facilities(facilities_name)
VALUES ('Hoist');
INSERT INTO facilities(facilities_name)
VALUES ('Office');
INSERT INTO facilities(facilities_name)
VALUES ('Electrical');
INSERT INTO facilities(facilities_name)
VALUES ('Painting');
INSERT INTO yard(address_id, yard_size, yard_name, yard_tel)
VALUES (21, 50000, 'Yard 1', '01278 24444');
INSERT INTO yard(address_id, yard_size, yard_name, yard_tel)
VALUES (22, 25000, 'Yard 2', '01278 12345');
INSERT INTO yard(address_id, yard_size, yard_name, yard_tel)
VALUES (23, 65000, 'Yard 3', '01278 98765');
INSERT INTO yard(address_id, yard_size, yard_name, yard_tel)
VALUES (24, 20000, 'Yard 4', '01278 45810');
INSERT INTO yard(address_id, yard_size, yard_name, yard_tel)
VALUES (25, 75000, 'Yard 5', '01278 14741');
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (1, 1);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (1, 3);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (1, 4);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (1, 5);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (1, 9);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (2, 1);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (2, 2);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (2, 3);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (2, 4);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (2, 5);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (3, 1);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (3, 2);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (3, 3);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (3, 4);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (3, 5);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (3, 6);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (3, 7);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (4, 1);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (4, 8);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (4, 9);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (5, 1);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (5, 2);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (5, 3);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (5, 4);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (5, 5);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (5, 6);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (5, 7);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (5, 8);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (5, 9);
INSERT INTO yard_facilities(yard_id, facilities_id)
VALUES (5, 10);
INSERT INTO customer (address_id, customer_fname, customer_mname, customer_lname, customer_tel1, customer_tel2, customer_email1, customer_email2, customer_priv, customer_represent_company)
VALUES (1, 'Jermaine', NULL, 'Belli', '314-107-7002', '169-167-7418', '[email protected]', '[email protected]', TRUE, 'Brakus and Sons');
INSERT INTO customer (address_id, customer_fname, customer_mname, customer_lname, customer_tel1, customer_tel2, customer_email1, customer_email2, customer_priv, customer_represent_company)
VALUES (2, 'Bria', 'Pearline', 'Esberger', '502-242-3055', '754-816-0289', '[email protected]', NULL, FALSE, NULL);
INSERT INTO customer (address_id, customer_fname, customer_mname, customer_lname, customer_tel1, customer_tel2, customer_email1, customer_email2, customer_priv, customer_represent_company)
VALUES (3, 'Eustacia', NULL, 'Colthurst', '396-142-6471', NULL, '[email protected]', '[email protected]', FALSE, NULL);
INSERT INTO customer (address_id, customer_fname, customer_mname, customer_lname, customer_tel1, customer_tel2, customer_email1, customer_email2, customer_priv, customer_represent_company)
VALUES (4, 'Claudina', 'Wally', 'Sisneros', '949-593-0595', '843-468-8971', '[email protected]', NULL, FALSE, NULL);
INSERT INTO customer (address_id, customer_fname, customer_mname, customer_lname, customer_tel1, customer_tel2, customer_email1, customer_email2, customer_priv, customer_represent_company)
VALUES (5, 'Darn', NULL, 'Aronsohn', '944-508-0133', NULL, '[email protected]', '[email protected]', FALSE, NULL);
INSERT INTO customer (address_id, customer_fname, customer_mname, customer_lname, customer_tel1, customer_tel2, customer_email1, customer_email2, customer_priv, customer_represent_company)
VALUES (6, 'Barrie', NULL, 'Claypool', '953-284-4314', NULL, '[email protected]', NULL, TRUE, 'Marquardt Inc');
INSERT INTO customer (address_id, customer_fname, customer_mname, customer_lname, customer_tel1, customer_tel2, customer_email1, customer_email2, customer_priv, customer_represent_company)
VALUES (7, 'Dania', 'Phineas', 'Leamon', '115-150-2084', '415-994-6869', '[email protected]', NULL, FALSE, NULL);
INSERT INTO customer (address_id, customer_fname, customer_mname, customer_lname, customer_tel1, customer_tel2, customer_email1, customer_email2, customer_priv, customer_represent_company)
VALUES (8, 'Fair', 'Tedd', 'Blick', '712-313-4917', NULL, '[email protected]', NULL, FALSE, NULL);
INSERT INTO customer (address_id, customer_fname, customer_mname, customer_lname, customer_tel1, customer_tel2, customer_email1, customer_email2, customer_priv, customer_represent_company)
VALUES (9, 'Nelly', 'Maren', 'Baunton', '555-178-1885', '679-848-2165', '[email protected]', '[email protected]', TRUE, 'Zboncak-Schulist');
INSERT INTO customer (address_id, customer_fname, customer_mname, customer_lname, customer_tel1, customer_tel2, customer_email1, customer_email2, customer_priv, customer_represent_company)
VALUES (10, 'Norene', NULL, 'Jopling', '936-179-5211', '331-106-6422', '[email protected]', '[email protected]', FALSE, NULL);
INSERT INTO staff (address_id, staff_fname, staff_mname, staff_lname, staff_tel, staff_email)
VALUES (11, 'Kylie', NULL, 'Leyzell', '220-677-1576', '[email protected]');
INSERT INTO staff (address_id, staff_fname, staff_mname, staff_lname, staff_tel, staff_email)
VALUES (12, 'Clemmy', NULL, 'Berryann', '878-753-8536', '[email protected]');
INSERT INTO staff (address_id, staff_fname, staff_mname, staff_lname, staff_tel, staff_email)
VALUES (13, 'Glynis', NULL, 'Cropper', '359-461-4372', '[email protected]');
INSERT INTO staff (address_id, staff_fname, staff_mname, staff_lname, staff_tel, staff_email)
VALUES (14, 'Boris', NULL, 'Davley', '671-331-8527', '[email protected]');
INSERT INTO staff (address_id, staff_fname, staff_mname, staff_lname, staff_tel, staff_email)
VALUES (15, 'Jehanna', NULL, 'Romeuf', '446-904-4406', '[email protected]');
INSERT INTO staff (address_id, staff_fname, staff_mname, staff_lname, staff_tel, staff_email)
VALUES (16, 'Ogdan', NULL, 'O''Heffernan', '986-848-1846', '[email protected]');
INSERT INTO staff (address_id, staff_fname, staff_mname, staff_lname, staff_tel, staff_email)
VALUES (17, 'Anselm', NULL, 'Dimmock', '738-642-6496', '[email protected]');
INSERT INTO staff (address_id, staff_fname, staff_mname, staff_lname, staff_tel, staff_email)
VALUES (18, 'Shawn', NULL, 'Scorah', '588-384-5299', '[email protected]');
INSERT INTO staff (address_id, staff_fname, staff_mname, staff_lname, staff_tel, staff_email)
VALUES (19, 'Mariele', 'Chloe', 'Cuddon', '199-722-6273', '[email protected]');
INSERT INTO staff (address_id, staff_fname, staff_mname, staff_lname, staff_tel, staff_email)
VALUES (20, 'Florri', 'Tamar', 'Stretton', '710-211-9533', '[email protected]');
INSERT INTO role(role_name)
VALUES ('MANAGER');
INSERT INTO role(role_name)
VALUES ('GLASS FIBRE SPECIALIST');
INSERT INTO role(role_name)
VALUES ('ENGINE TECHNICIAN');
INSERT INTO role(role_name)
VALUES ('GENERAL');
INSERT INTO role(role_name)
VALUES ('ELECTRICIAN');
INSERT INTO role(role_name)
VALUES ('TECHNICIAN');
INSERT INTO role(role_name)
VALUES ('HULL SPECIALIST');
INSERT INTO role(role_name)
VALUES ('CRANE OPERATOR');
INSERT INTO staff_role(staff_id, role_id)
VALUES (1, 1);
INSERT INTO staff_role(staff_id, role_id)
VALUES (1, 2);
INSERT INTO staff_role(staff_id, role_id)
VALUES (1, 3);
INSERT INTO staff_role(staff_id, role_id)
VALUES (2, 8);
INSERT INTO staff_role(staff_id, role_id)
VALUES (2, 7);
INSERT INTO staff_role(staff_id, role_id)
VALUES (2, 2);
INSERT INTO staff_role(staff_id, role_id)
VALUES (3, 4);
INSERT INTO staff_role(staff_id, role_id)
VALUES (4, 6);
INSERT INTO staff_role(staff_id, role_id)
VALUES (5, 4);
INSERT INTO staff_role(staff_id, role_id)
VALUES (5, 7);
INSERT INTO staff_role(staff_id, role_id)
VALUES (6, 2);
INSERT INTO staff_role(staff_id, role_id)
VALUES (7, 5);
INSERT INTO staff_role(staff_id, role_id)
VALUES (8, 7);
INSERT INTO staff_role(staff_id, role_id)
VALUES (8, 2);
INSERT INTO staff_role(staff_id, role_id)
VALUES (9, 3);
INSERT INTO staff_role(staff_id, role_id)
VALUES (10, 4);
INSERT INTO staff_role(staff_id, role_id)
VALUES (10, 5);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (1, 1);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (1, 2);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (2, 1);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (3, 5);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (4, 4);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (5, 5);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (5, 1);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (6, 4);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (7, 1);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (8, 5);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (8, 1);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (9, 1);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (9, 2);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (9, 3);
INSERT INTO staff_yard(staff_id, yard_id)
VALUES (10, 1);
INSERT INTO manufacture (manufacture_name, manufacture_model, manufacture_height, manufacture_length, manufacture_width, manufacture_fuel, manufacture_engine, manufacture_bhp, manufacture_hull, manufacture_capacity, manufacture_email, manufacture_phone)
VALUES ('Von and Sons', 'Fabaceae', 10.69, 5.76, 18.18, 'PETROL', 'XML', 179, 'V-SHAPED', 7, '[email protected]', '754-488-9881');
INSERT INTO manufacture (manufacture_name, manufacture_model, manufacture_height, manufacture_length, manufacture_width, manufacture_fuel, manufacture_engine, manufacture_bhp, manufacture_hull, manufacture_capacity, manufacture_email, manufacture_phone)
VALUES ('Klein and Sons', 'Sparganiaceae', 5.37, 18.81, 17.43, 'HYBRID', 'IWA', 106, 'FLAT-BOTTOM', 17, '[email protected]', '177-351-3312');
INSERT INTO manufacture (manufacture_name, manufacture_model, manufacture_height, manufacture_length, manufacture_width, manufacture_fuel, manufacture_engine, manufacture_bhp, manufacture_hull, manufacture_capacity, manufacture_email, manufacture_phone)
VALUES ('Torp, Fisher and Murazik', 'Primulaceae', 17.82, 12.52, 11.68, 'DIESEL', 'LTG', 129, 'MULTI', 19, '[email protected]', '798-955-1699');
INSERT INTO manufacture (manufacture_name, manufacture_model, manufacture_height, manufacture_length, manufacture_width, manufacture_fuel, manufacture_engine, manufacture_bhp, manufacture_hull, manufacture_capacity, manufacture_email, manufacture_phone)
VALUES ('Bauch, Murphy and Erdman', 'Crassulaceae', 9.23, 11.99, 17.06, 'PETROL', 'SWN', 18, 'MULTI', 3, '[email protected]', '634-379-8871');
INSERT INTO manufacture (manufacture_name, manufacture_model, manufacture_height, manufacture_length, manufacture_width, manufacture_fuel, manufacture_engine, manufacture_bhp, manufacture_hull, manufacture_capacity, manufacture_email, manufacture_phone)
VALUES ('MacGyver and Sons', 'Parmeliaceae', 19.14, 17.42, 10.75, 'HYBRID', 'MXE', 171, 'ROUND-BOTTOM', 5, '[email protected]', '288-803-9864');
INSERT INTO manufacture (manufacture_name, manufacture_model, manufacture_height, manufacture_length, manufacture_width, manufacture_fuel, manufacture_engine, manufacture_bhp, manufacture_hull, manufacture_capacity, manufacture_email, manufacture_phone)
VALUES ('Christiansen, Torphy and Lang', 'Fabaceae', 5.62, 7.52, 17.5, 'PETROL', 'TOJ', 191, 'MULTI', 4, '[email protected]', '760-897-1749');
INSERT INTO manufacture (manufacture_name, manufacture_model, manufacture_height, manufacture_length, manufacture_width, manufacture_fuel, manufacture_engine, manufacture_bhp, manufacture_hull, manufacture_capacity, manufacture_email, manufacture_phone)
VALUES ('Rodriguez-Kirlin', 'Myrtaceae', 11.77, 22.45, 14.71, 'PETROL', 'KMW', 133, 'V-SHAPED', 3, '[email protected]', '942-508-5552');
INSERT INTO manufacture (manufacture_name, manufacture_model, manufacture_height, manufacture_length, manufacture_width, manufacture_fuel, manufacture_engine, manufacture_bhp, manufacture_hull, manufacture_capacity, manufacture_email, manufacture_phone)
VALUES ('Sauer Inc', 'Onagraceae', 15.37, 8.89, 19.8, 'DIESEL', 'KTE', 195, 'V-SHAPED', 9, '[email protected]', '849-908-5176');
INSERT INTO manufacture (manufacture_name, manufacture_model, manufacture_height, manufacture_length, manufacture_width, manufacture_fuel, manufacture_engine, manufacture_bhp, manufacture_hull, manufacture_capacity, manufacture_email, manufacture_phone)
VALUES ('Feest, Boehm and Schultz', 'Poaceae', 14.67, 20.02, 15.69, 'PETROL', 'TAW', 28, 'MULTI', 4, '[email protected]', '189-470-4431');
INSERT INTO manufacture (manufacture_name, manufacture_model, manufacture_height, manufacture_length, manufacture_width, manufacture_fuel, manufacture_engine, manufacture_bhp, manufacture_hull, manufacture_capacity, manufacture_email, manufacture_phone)
VALUES ('Yost LLC', 'Casuarinaceae', 13.38, 6.36, 13.74, 'HYBRID', 'BDA', 50, 'FLAT-BOTTOM', 15, '[email protected]', '397-854-7352');
INSERT INTO boat (customer_id, manufacture_id, country_id, boat_mic, boat_built, boat_oem, boat_registration)
VALUES (1, 1, 2, 'WAULFAFH-9DN475697', '2005-08-10', TRUE, '2021-11-01');
INSERT INTO boat (customer_id, manufacture_id, country_id, boat_mic, boat_built, boat_oem, boat_registration)
VALUES (2, 2, 1, '3VWC17AU-6FM469990', '1991-11-13', FALSE, '2021-12-01');
INSERT INTO boat (customer_id, manufacture_id, country_id, boat_mic, boat_built, boat_oem, boat_registration)
VALUES (3, 3, 2, '1FTSW3B5-6AE752725', '2001-12-08', FALSE, '2022-01-01');
INSERT INTO boat (customer_id, manufacture_id, country_id, boat_mic, boat_built, boat_oem, boat_registration)
VALUES (4, 4, 3, 'WBAGL635-35D202019', '1988-06-11', TRUE, '2022-02-01');
INSERT INTO boat (customer_id, manufacture_id, country_id, boat_mic, boat_built, boat_oem, boat_registration)
VALUES (5, 5, 3, '1GD22ZCG-3CZ329528', '2001-09-22', FALSE, '2022-03-01');
INSERT INTO boat (customer_id, manufacture_id, country_id, boat_mic, boat_built, boat_oem, boat_registration)
VALUES (6, 6, 2, '4T1BD1EB-4EU973939', '2004-11-12', TRUE, '2022-04-01');
INSERT INTO boat (customer_id, manufacture_id, country_id, boat_mic, boat_built, boat_oem, boat_registration)
VALUES (7, 7, 1, '1FTEW1CW-9AK364012', '2008-10-16', TRUE, '2022-05-01');
INSERT INTO boat (customer_id, manufacture_id, country_id, boat_mic, boat_built, boat_oem, boat_registration)
VALUES (8, 8, 3, '1FAHP3HN-3AW561264', '2019-05-17', FALSE, '2022-06-01');
INSERT INTO boat (customer_id, manufacture_id, country_id, boat_mic, boat_built, boat_oem, boat_registration)
VALUES (9, 9, 2, '5UXFG2C5-0E0036379', '1996-04-14', TRUE, '2022-07-01');
INSERT INTO boat (customer_id, manufacture_id, country_id, boat_mic, boat_built, boat_oem, boat_registration)
VALUES (10, 10, 1, '3N1CN7AP-3EK123345', '2008-12-07', FALSE, '2022-08-01');
INSERT INTO service (boat_id, yard_id, service_cost, service_type)
VALUES (1, 1, 67988, 'CHECKUP');
INSERT INTO service (boat_id, yard_id, service_cost, service_type)
VALUES (2, 1, 2361, 'SERVICE');
INSERT INTO service (boat_id, yard_id, service_cost, service_type)
VALUES (3, 1, 70794, 'REPAIR');
INSERT INTO service (boat_id, yard_id, service_cost, service_type)
VALUES (4, 2, 98810, 'OTHER');
INSERT INTO service (boat_id, yard_id, service_cost, service_type)
VALUES (5, 2, 86405, 'REPAIR');
INSERT INTO service (boat_id, yard_id, service_cost, service_type)
VALUES (6, 3, 95640, 'CHECKUP');
INSERT INTO service (boat_id, yard_id, service_cost, service_type)
VALUES (7, 4, NULL, 'SERVICE');
INSERT INTO service (boat_id, yard_id, service_cost, service_type)
VALUES (8, 5, 41240, 'REPAIR');
INSERT INTO service (boat_id, yard_id, service_cost, service_type)
VALUES (9, 1, 25807, 'REPAIR');
INSERT INTO service (boat_id, yard_id, service_cost, service_type)
VALUES (10, 1, 84374, 'OTHER');
INSERT INTO staff_service (staff_id, service_id)
VALUES (2, 1);
INSERT INTO staff_service (staff_id, service_id)
VALUES (1, 1);
INSERT INTO staff_service (staff_id, service_id)
VALUES (4, 4);
INSERT INTO staff_service (staff_id, service_id)
VALUES(1, 4);
INSERT INTO staff_service (staff_id, service_id)
VALUES (3, 1);