-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjet2SQL
More file actions
1318 lines (1076 loc) · 39.4 KB
/
jet2SQL
File metadata and controls
1318 lines (1076 loc) · 39.4 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
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
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 07, 2022 at 10:07 PM
-- Server version: 10.4.24-MariaDB
-- PHP Version: 7.4.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `jet2 holiday database replication`
--
-- --------------------------------------------------------
--
-- Table structure for table `address`
--
CREATE TABLE `address` (
`address_id` int(11) NOT NULL,
`building_num` int(11) NOT NULL,
`building_name` varchar(255) NOT NULL,
`address_line_1` varchar(255) NOT NULL,
`address_line_2` varchar(255) NOT NULL,
`postcode` varchar(255) NOT NULL,
`gps_lat` decimal(10,8) NOT NULL,
`gps_long` decimal(11,8) NOT NULL,
`city_id` int(11) NOT NULL,
`country_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `address`
--
INSERT INTO `address` (`address_id`, `building_num`, `building_name`, `address_line_1`, `address_line_2`, `postcode`, `gps_lat`, `gps_long`, `city_id`, `country_id`) VALUES
(3, 0, 'Belfast International Airport', 'Airport Rd', 'Crumlin', 'BT29 4AB', '54.65750000', '-6.21583300', 1, 4),
(4, 0, 'São Rafael Atlântico', 'R. dos Corais', '8200-613 ', '', '37.07758200', '-8.28151800', 7, 2),
(5, 3, '', 'Rossnareen Avenue', '', 'BT12 4PY', '54.57719800', '-6.00281200', 1, 4),
(6, 0, 'Faro Airport', '8006-901', '', '', '37.01444400', '-7.96583300', 9, 2),
(7, 0, 'Albuferia Hotel 2', '123 Bier Road ', 'La Canza', '', '99.99999999', '-6.21583300', 7, 2),
(8, 0, 'Albuferia Hotel 3', '567 Hilltop', 'La Beach ', '', '37.07755400', '-6.21587700', 7, 2);
-- --------------------------------------------------------
--
-- Table structure for table `airport`
--
CREATE TABLE `airport` (
`airport_id` int(11) NOT NULL,
`airport_code` varchar(255) NOT NULL,
`airport_name` varchar(255) NOT NULL,
`address_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `airport`
--
INSERT INTO `airport` (`airport_id`, `airport_code`, `airport_name`, `address_id`) VALUES
(1, 'FAO', 'Faro Airport ', 6),
(2, 'BFS', 'Belfast International Airport', 3);
-- --------------------------------------------------------
--
-- Table structure for table `board`
--
CREATE TABLE `board` (
`board_id` int(11) NOT NULL,
`hotel_board_name` varchar(255) NOT NULL,
`hotel_board_description` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `board`
--
INSERT INTO `board` (`board_id`, `hotel_board_name`, `hotel_board_description`) VALUES
(3, 'All Inclusive', 'Opt for All Inclusive and your breakfast, lunch and evening meals, along with snacks and locally branded drinks, are included in the price. That means you can relax knowing you don’t need to worry about mealtimes. Before you book, read the full offering of each hotel, as it can vary and sometimes include activities.'),
(4, 'Full Board', 'Your breakfast, lunch and evening meal are included in the price of a Full Board holiday. That means all you’ve got to worry about are the drinks! It\'s perfect if you’re on a family holiday, as you don’t have to think about where to go and making sure everyone gets what they want. Fancy a little bit more included? Go for Full Board Plus. With this board basis, you’ll enjoy a few extras, as well as your three meals a day. Check with your hotel to see what additional services they’ll offer with Full Board Plus.'),
(5, 'Half Board', 'With Half Board, both your breakfast and evening meal are already paid for in the price of your holiday, so all the big meals are taken care of! So each morning and night, all you need to worry about is relaxing and tucking into delicious dishes. What’s more, it’s the best of both worlds! At lunch, you get the chance to head out and discover the local cuisine around your resort. Take things up a notch with Half Board Plus. Typically, you can expect some extra services, but it all depends on the hotel you book.'),
(6, 'Bed and Breakfast', 'With this board option, your breakfast is included in the price of your holiday. Usually, this consists of a continental buffet catering to a range of nationalities, however it may change depending on the accommodation. For any foodies, this is a fantastic choice. It means you can load up in the morning before venturing out of your hotel and sampling the local cuisine.\r\n\r\n'),
(7, 'Self Catering', 'As with Room Only, you don’t have any meals included in the price of your holiday when you pick Self Catering, however you’ll be provided with some catering facilities in your room. Equipment will differ depending on the accommodation. If you’re on a budget or simply love whipping up light meals, this could be the perfect option for you!'),
(8, 'Room Only', 'As the name might suggest, only the room is included when you choose this option. That means no meals are included in the price you’ve paid for your holiday. This gives you the freedom to dine out as and when you like, so if you’re a food fanatic, then it might be the perfect option for you.');
-- --------------------------------------------------------
--
-- Table structure for table `booking`
--
CREATE TABLE `booking` (
`booking_id` int(11) NOT NULL,
`booking_made_datetime` datetime NOT NULL DEFAULT current_timestamp(),
`booking_dep_date` date NOT NULL,
`booking_duration_days` int(11) NOT NULL,
`booking_timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
`booking_reference` int(11) NOT NULL,
`booking_total_cost` int(11) NOT NULL,
`customer_id` int(11) NOT NULL,
`dep_flight_id` int(11) NOT NULL,
`ret_flight_id` int(11) NOT NULL,
`room_booking_id` int(11) NOT NULL,
`booking_detail_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `booking_detail`
--
CREATE TABLE `booking_detail` (
`booking_detail_id` int(11) NOT NULL,
`item_name` varchar(255) NOT NULL,
`item_description` varchar(255) NOT NULL,
`price_paid` int(11) NOT NULL,
`booking_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `card_type`
--
CREATE TABLE `card_type` (
`card_type_id` int(11) NOT NULL,
`card_type_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `card_type`
--
INSERT INTO `card_type` (`card_type_id`, `card_type_name`) VALUES
(1, 'Visa'),
(2, 'Visa Debit'),
(3, 'Mastercard'),
(4, 'American Express');
-- --------------------------------------------------------
--
-- Table structure for table `city`
--
CREATE TABLE `city` (
`city_id` int(11) NOT NULL,
`city_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `city`
--
INSERT INTO `city` (`city_id`, `city_name`) VALUES
(1, 'Belfast'),
(2, 'Dublin'),
(3, 'Alicante'),
(4, 'Barcelona '),
(5, 'Lisbon'),
(6, 'Porto'),
(7, 'Albufeira'),
(8, 'Benidorm'),
(9, 'Faro');
-- --------------------------------------------------------
--
-- Table structure for table `country`
--
CREATE TABLE `country` (
`country_id` int(11) NOT NULL,
`country_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `country`
--
INSERT INTO `country` (`country_id`, `country_name`) VALUES
(1, 'Spain'),
(2, 'Portugal '),
(3, 'Malta'),
(4, 'Northern Ireland'),
(5, 'Ireland '),
(6, 'France ');
-- --------------------------------------------------------
--
-- Table structure for table `customer`
--
CREATE TABLE `customer` (
`customer_id` int(11) NOT NULL,
`is_passenger` tinyint(1) NOT NULL,
`first_name` varchar(255) NOT NULL,
`last_name` varchar(255) NOT NULL,
`telephone_type` varchar(255) NOT NULL,
`telephone_number` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`title_id` int(11) NOT NULL,
`address_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `customer`
--
INSERT INTO `customer` (`customer_id`, `is_passenger`, `first_name`, `last_name`, `telephone_type`, `telephone_number`, `email`, `title_id`, `address_id`) VALUES
(1, 1, 'Conall', 'Murphy', 'Mobile', '+447522680606', 'conall@live.co.uk', 1, 5);
-- --------------------------------------------------------
--
-- Table structure for table `flight`
--
CREATE TABLE `flight` (
`flight_id` int(11) NOT NULL,
`dep_date_time` datetime NOT NULL,
`arr_date_time` datetime NOT NULL,
`route_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `flight`
--
INSERT INTO `flight` (`flight_id`, `dep_date_time`, `arr_date_time`, `route_id`) VALUES
(1, '2023-06-20 13:00:00', '2023-06-20 16:35:00', 1),
(2, '2023-06-20 06:45:00', '2023-06-20 10:10:00', 1),
(3, '2023-06-20 15:15:00', '2023-06-20 20:50:00', 1),
(4, '2023-06-27 11:00:00', '2022-10-30 14:35:00', 2),
(5, '2023-06-20 20:20:00', '2023-06-20 20:35:00', 2);
-- --------------------------------------------------------
--
-- Table structure for table `flight_price`
--
CREATE TABLE `flight_price` (
`flight_price_id` int(11) NOT NULL,
`price` int(11) NOT NULL,
`passenger_type_id` int(11) NOT NULL,
`flight_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `flight_price`
--
INSERT INTO `flight_price` (`flight_price_id`, `price`, `passenger_type_id`, `flight_id`) VALUES
(1, 135, 1, 1),
(2, 100, 1, 2),
(3, 115, 1, 3),
(4, 120, 1, 4),
(5, 100, 1, 5),
(6, 70, 2, 1),
(7, 50, 2, 2),
(8, 60, 2, 3),
(9, 60, 2, 4),
(10, 50, 2, 5);
-- --------------------------------------------------------
--
-- Table structure for table `hotel`
--
CREATE TABLE `hotel` (
`hotel_id` int(11) NOT NULL,
`hotel_name` varchar(255) NOT NULL,
`hotel_star_rating` int(5) NOT NULL,
`hotel_tripadvisor_rating` int(5) NOT NULL,
`address_id` int(11) NOT NULL,
`resort_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `hotel`
--
INSERT INTO `hotel` (`hotel_id`, `hotel_name`, `hotel_star_rating`, `hotel_tripadvisor_rating`, `address_id`, `resort_id`) VALUES
(1, 'Sao Rafael Atlantico', 5, 4, 4, 1),
(2, 'Albuferia Hotel 2', 2, 2, 7, 1),
(3, 'Albuferia Hotel 3 ', 3, 3, 8, 1);
-- --------------------------------------------------------
--
-- Table structure for table `hotel_board`
--
CREATE TABLE `hotel_board` (
`hotel_board_id` int(11) NOT NULL,
`hotel_id` int(11) NOT NULL,
`board_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `hotel_board`
--
INSERT INTO `hotel_board` (`hotel_board_id`, `hotel_id`, `board_id`) VALUES
(1, 1, 6),
(2, 1, 5);
-- --------------------------------------------------------
--
-- Table structure for table `hotel_features`
--
CREATE TABLE `hotel_features` (
`hotel_features_id` int(11) NOT NULL,
`hotel_id` int(11) NOT NULL,
`hotel_features_list_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `hotel_features`
--
INSERT INTO `hotel_features` (`hotel_features_id`, `hotel_id`, `hotel_features_list_id`) VALUES
(6, 1, 15),
(7, 1, 1),
(8, 1, 13),
(9, 1, 7),
(10, 1, 11),
(11, 1, 10);
-- --------------------------------------------------------
--
-- Table structure for table `hotel_features_list`
--
CREATE TABLE `hotel_features_list` (
`hotel_features_list_id` int(11) NOT NULL,
`hotel_features_name` varchar(255) NOT NULL,
`hotel_features_description` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `hotel_features_list`
--
INSERT INTO `hotel_features_list` (`hotel_features_list_id`, `hotel_features_name`, `hotel_features_description`) VALUES
(1, 'Children\'s Pool', 'Pool that is suitable for children ages 0-12. Children must be supervised at all times by an adult.'),
(2, 'Indoor Pool', 'Indoor pool that can be used in all weather conditions.'),
(3, 'Gym', 'Gym that features state of the art facilities with cardio fitness training equipment, free weights area and fixed strength equipment.'),
(4, 'Golf Course', 'Golf course with off-site clubhouse.* Reservation required.'),
(5, 'Daily Evening Entertainment', 'Daily evening entertainment (available between 01 Jun and 31 Oct) including live music.'),
(6, 'Occasional Evening Entertainment ', 'Occasional evening entertainment (available between 01 Mar and 31 May) including live music.'),
(7, 'Babysitting Service', 'Babysitting service* (subject to availability and advance booking at reception)'),
(8, 'Sauna ', 'Hot Coal Sauna '),
(9, 'Steam Room ', 'Hot Steam Room to clear the airways.'),
(10, 'Massage Treatments', 'Professional masseuse service with a variety of specialised treatments. (Open between 01 Jan and 31 Dec, between 10.00am and 6.30pm, depending on occupancy).'),
(11, 'In-door Bar ', 'Alcoholic & soft drinks served.'),
(12, 'Pool-side Bar ', 'Alcoholic & soft drinks served at pool.'),
(13, 'Buffet Restaurant ', 'Serves breakfast and dinner. Show cooking at breakfast. Highchairs available. Please note that the hotel requests that beach wear is not worn.'),
(14, 'A la carte Restaurant ', 'Serves a range of international and local cuisine for dinner. Please note that the hotel requests that beach wear is not worn.'),
(15, 'Outdoor Pool ', 'Outdoor freshwater pool. Sunbathing area with sunbeds and parasols. Free towels.');
-- --------------------------------------------------------
--
-- Table structure for table `hotel_room`
--
CREATE TABLE `hotel_room` (
`hotel_room_id` int(11) NOT NULL,
`room_name` varchar(255) NOT NULL,
`room_max_adults` int(11) NOT NULL,
`room_min_adults` int(11) NOT NULL,
`room_max_child` int(11) NOT NULL,
`room_min_child` int(11) NOT NULL,
`room_max_infant` int(11) NOT NULL,
`room_min_infant` int(11) NOT NULL,
`hotel_id` int(11) NOT NULL,
`room_type_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `hotel_room`
--
INSERT INTO `hotel_room` (`hotel_room_id`, `room_name`, `room_max_adults`, `room_min_adults`, `room_max_child`, `room_min_child`, `room_max_infant`, `room_min_infant`, `hotel_id`, `room_type_id`) VALUES
(1, 'Family Room ', 2, 1, 1, 0, 1, 0, 1, 3),
(2, 'Luxury Room ', 6, 2, 2, 0, 4, 0, 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `images`
--
CREATE TABLE `images` (
`image_id` int(11) NOT NULL,
`image_name` varchar(255) NOT NULL,
`image_alt_desc` varchar(255) NOT NULL,
`image_url` varchar(255) NOT NULL,
`hotel_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `passenger`
--
CREATE TABLE `passenger` (
`passenger_id` int(11) NOT NULL,
`first_name` varchar(255) NOT NULL,
`last_name` varchar(255) NOT NULL,
`date_of_birth` date NOT NULL,
`is_lead_passenger` tinyint(1) NOT NULL,
`passenger_type_id` int(11) NOT NULL,
`passenger_passport` int(11) NOT NULL,
`title_id` int(11) NOT NULL,
`booking_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `passenger_passport`
--
CREATE TABLE `passenger_passport` (
`passenger_passport_id` int(11) NOT NULL,
`passport_number` varchar(8) NOT NULL,
`passport_expiry_date` date NOT NULL,
`country_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `passenger_passport`
--
INSERT INTO `passenger_passport` (`passenger_passport_id`, `passport_number`, `passport_expiry_date`, `country_id`) VALUES
(1, '78654789', '2027-10-01', 5),
(2, '12345678', '2023-03-10', 5),
(3, '11365895', '2027-04-01', 4),
(4, '78651254', '2026-05-08', 5),
(5, '80021453', '2022-06-07', 4);
-- --------------------------------------------------------
--
-- Table structure for table `passenger_type`
--
CREATE TABLE `passenger_type` (
`passenger_type_id` int(11) NOT NULL,
`passenger_type` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `passenger_type`
--
INSERT INTO `passenger_type` (`passenger_type_id`, `passenger_type`) VALUES
(1, 'Adult'),
(2, 'Child'),
(3, 'Infant');
-- --------------------------------------------------------
--
-- Table structure for table `payment`
--
CREATE TABLE `payment` (
`payment_id` int(11) NOT NULL,
`amount` int(11) NOT NULL,
`payment_date` date NOT NULL,
`payment_card_id` int(11) NOT NULL,
`booking_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `payment_card`
--
CREATE TABLE `payment_card` (
`payment_card_id` int(11) NOT NULL,
`cardholder_name` varchar(255) NOT NULL,
`card_long_number` varbinary(255) NOT NULL,
`security_code` varbinary(255) NOT NULL,
`card_start_date` date NOT NULL,
`card_end_date` date NOT NULL,
`card_type_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `resort`
--
CREATE TABLE `resort` (
`resort_id` int(11) NOT NULL,
`resort_name` varchar(255) NOT NULL,
`resort_description` text NOT NULL,
`resort_region` int(11) NOT NULL,
`resort_country_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `resort`
--
INSERT INTO `resort` (`resort_id`, `resort_name`, `resort_description`, `resort_region`, `resort_country_id`) VALUES
(1, 'Albuferia ', 'Albufeira has more than 25 stunning beaches to explore. Many of these gems are Blue Flag winners, offering huge stretches of sweeping golden sands and turquoise waters. Whether you’re looking for a quiet cove or a lively beach scene, you’re sure to find it here. As for the water sports, there are loads on offer. Or you can opt for a boat trip along the coast to spot dolphins or see caves.', 1, 2),
(2, 'San Antonio', 'San Antonio is in touch with its bars, clubs and after-dark nature and it doesn’t let up. With some of the best nightlife in the world here, get ready to party non-stop in this vibrant island resort. But you’ll find chic dining spots and remote beaches for a bit of respite while on holiday in Ibiza too.\r\n\r\n', 2, 1),
(3, 'Alvor', 'Alvor is a picturesque town close to Portimão in the Algarve. This beautiful and charming town conserves most of its Moorish historic roots due to the fact that the whole region was under Moorish occupation for many centuries.', 1, 2),
(4, 'Almancil', 'Almancil (Portuguese pronunciation: [aɫmɐ̃ˈsiɫ]) is a town and freguesia in the Loulé Municipality, in the affluent Golden Triangle region of the Algarve of southern Portugal. Almancil is known for its three Michelin star restaurants, the most of any town in the Algarve.', 1, 2);
-- --------------------------------------------------------
--
-- Table structure for table `resort_details`
--
CREATE TABLE `resort_details` (
`resort_details_id` int(11) NOT NULL,
`resort_id` int(11) NOT NULL,
`resort_details_list_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `resort_details_list`
--
CREATE TABLE `resort_details_list` (
`resort_details_list_id` int(11) NOT NULL,
`resort_details_name` varchar(255) NOT NULL,
`resort_details_description` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `resort_details_list`
--
INSERT INTO `resort_details_list` (`resort_details_list_id`, `resort_details_name`, `resort_details_description`) VALUES
(1, 'Faro City ', 'Faro is the capital of southern Portugal’s Algarve region. The city’s neoclassical Arco da Vila is on the site of a gate that was part of the original Moorish wall. The monumental archway leads to the old town, with its cobbled streets. Nearby is Faro Cat');
-- --------------------------------------------------------
--
-- Table structure for table `resort_region`
--
CREATE TABLE `resort_region` (
`resort_region_id` int(11) NOT NULL,
`resort_region_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `resort_region`
--
INSERT INTO `resort_region` (`resort_region_id`, `resort_region_name`) VALUES
(1, 'The Algarve'),
(2, 'Ibiza'),
(3, 'Malta and Gozo');
-- --------------------------------------------------------
--
-- Table structure for table `room_booking`
--
CREATE TABLE `room_booking` (
`room_booking_id` int(11) NOT NULL,
`hotel_room_id` int(11) NOT NULL,
`booking_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `room_booking`
--
INSERT INTO `room_booking` (`room_booking_id`, `hotel_room_id`, `booking_id`) VALUES
(1, 1, 1),
(6, 1, 1),
(7, 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `room_facility`
--
CREATE TABLE `room_facility` (
`room_facility_id` int(11) NOT NULL,
`hotel_room_id` int(11) NOT NULL,
`room_facility_list_d` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `room_facility_list`
--
CREATE TABLE `room_facility_list` (
`room_facility_list_id` int(11) NOT NULL,
`facility_name` varchar(255) NOT NULL,
`facility_description` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `room_price`
--
CREATE TABLE `room_price` (
`room_price_id` int(11) NOT NULL,
`room_price` int(11) NOT NULL,
`valid_from_date` date NOT NULL,
`valid_to_date` date NOT NULL,
`hotel_room_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `room_price`
--
INSERT INTO `room_price` (`room_price_id`, `room_price`, `valid_from_date`, `valid_to_date`, `hotel_room_id`) VALUES
(1, 115, '2022-12-31', '2023-06-30', 1);
-- --------------------------------------------------------
--
-- Table structure for table `room_type`
--
CREATE TABLE `room_type` (
`room_type_id` int(11) NOT NULL,
`room_type_name` varchar(255) NOT NULL,
`room_type_description` varchar(255) NOT NULL,
`room_type_img_url` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `room_type`
--
INSERT INTO `room_type` (`room_type_id`, `room_type_name`, `room_type_description`, `room_type_img_url`) VALUES
(1, 'Suite ', 'Luxurious suite that sleeps two people, designed for those who need space & luxury during their stay with us! ', '/HotelImages/Web/FAO_70674_Sao_Rafael_Atlantico_0819_01.jpg'),
(2, 'Double Room with Sea View ', 'A spacious Double Room that has a view of the sea right from your own balcony! ', '/HotelImages/Web/FAO_70674_Sao_Rafael_Atlantico_0819_11.jpg'),
(3, 'Double Room with Pool View ', 'A spacious room that sleeps 3 people that also has a view from the hotel\'s pool from the balcony! ', '/HotelImages/Web/FAO_70674_Sao_Rafael_Atlantico_0819_05.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `route`
--
CREATE TABLE `route` (
`route_id` int(11) NOT NULL,
`route_name` varchar(255) NOT NULL,
`dep_airport` int(11) NOT NULL,
`arr_airport` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `route`
--
INSERT INTO `route` (`route_id`, `route_name`, `dep_airport`, `arr_airport`) VALUES
(1, 'Belfast - Faro ', 2, 1),
(2, 'Faro - Belfast ', 1, 2);
-- --------------------------------------------------------
--
-- Table structure for table `title`
--
CREATE TABLE `title` (
`title_id` int(11) NOT NULL,
`title_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `title`
--
INSERT INTO `title` (`title_id`, `title_name`) VALUES
(1, 'Mr.'),
(2, 'Miss.'),
(3, 'Ms.'),
(4, 'Mrs.');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `address`
--
ALTER TABLE `address`
ADD PRIMARY KEY (`address_id`),
ADD KEY `FK_city_id` (`city_id`),
ADD KEY `FK_country_id` (`country_id`);
--
-- Indexes for table `airport`
--
ALTER TABLE `airport`
ADD PRIMARY KEY (`airport_id`),
ADD KEY `FK_address_id` (`address_id`);
--
-- Indexes for table `board`
--
ALTER TABLE `board`
ADD PRIMARY KEY (`board_id`);
--
-- Indexes for table `booking`
--
ALTER TABLE `booking`
ADD PRIMARY KEY (`booking_id`),
ADD KEY `FK_customer` (`customer_id`),
ADD KEY `dep_flight_id` (`dep_flight_id`),
ADD KEY `arr_flight_id` (`ret_flight_id`),
ADD KEY `FK_room_booking_id` (`room_booking_id`),
ADD KEY `FK_booking_detail` (`booking_detail_id`);
--
-- Indexes for table `booking_detail`
--
ALTER TABLE `booking_detail`
ADD PRIMARY KEY (`booking_detail_id`);
--
-- Indexes for table `card_type`
--
ALTER TABLE `card_type`
ADD PRIMARY KEY (`card_type_id`);
--
-- Indexes for table `city`
--
ALTER TABLE `city`
ADD PRIMARY KEY (`city_id`);
--
-- Indexes for table `country`
--
ALTER TABLE `country`
ADD PRIMARY KEY (`country_id`);
--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
ADD PRIMARY KEY (`customer_id`),
ADD KEY `FK_title_2` (`title_id`),
ADD KEY `address_id` (`address_id`);
--
-- Indexes for table `flight`
--
ALTER TABLE `flight`
ADD PRIMARY KEY (`flight_id`),
ADD KEY `FK_route_id` (`route_id`);
--
-- Indexes for table `flight_price`
--
ALTER TABLE `flight_price`
ADD PRIMARY KEY (`flight_price_id`),
ADD KEY `FK_passenger_type_id` (`passenger_type_id`),
ADD KEY `FK_flight_id` (`flight_id`);
--
-- Indexes for table `hotel`
--
ALTER TABLE `hotel`
ADD PRIMARY KEY (`hotel_id`),
ADD KEY `FK_address_2` (`address_id`),
ADD KEY `FK_resort_2` (`resort_id`);
--
-- Indexes for table `hotel_board`
--
ALTER TABLE `hotel_board`
ADD PRIMARY KEY (`hotel_board_id`),
ADD KEY `FK_hotel_3` (`hotel_id`),
ADD KEY `FK_board_id` (`board_id`);
--
-- Indexes for table `hotel_features`
--
ALTER TABLE `hotel_features`
ADD PRIMARY KEY (`hotel_features_id`),
ADD KEY `FK_hotel_4` (`hotel_id`),
ADD KEY `FK_hotel_features_list` (`hotel_features_list_id`);
--
-- Indexes for table `hotel_features_list`
--
ALTER TABLE `hotel_features_list`
ADD PRIMARY KEY (`hotel_features_list_id`);
--
-- Indexes for table `hotel_room`
--
ALTER TABLE `hotel_room`
ADD PRIMARY KEY (`hotel_room_id`),
ADD KEY `FK_room_type` (`room_type_id`),
ADD KEY `FK_hotel` (`hotel_id`);
--
-- Indexes for table `images`
--
ALTER TABLE `images`
ADD PRIMARY KEY (`image_id`),
ADD KEY `FK_hotel_2` (`hotel_id`);
--
-- Indexes for table `passenger`
--
ALTER TABLE `passenger`
ADD PRIMARY KEY (`passenger_id`),
ADD KEY `FK_passenger_type_id_2` (`passenger_type_id`),
ADD KEY `FK_passenger_passport` (`passenger_passport`),
ADD KEY `FK_title` (`title_id`),
ADD KEY `booking_id` (`booking_id`);
--
-- Indexes for table `passenger_passport`
--
ALTER TABLE `passenger_passport`
ADD PRIMARY KEY (`passenger_passport_id`),
ADD KEY `FK_country` (`country_id`);
--
-- Indexes for table `passenger_type`
--
ALTER TABLE `passenger_type`
ADD PRIMARY KEY (`passenger_type_id`);
--
-- Indexes for table `payment`
--
ALTER TABLE `payment`
ADD PRIMARY KEY (`payment_id`),
ADD KEY `FK_booking_2` (`booking_id`),
ADD KEY `FK_payment_card` (`payment_card_id`);
--
-- Indexes for table `payment_card`
--
ALTER TABLE `payment_card`
ADD PRIMARY KEY (`payment_card_id`),
ADD KEY `FK_card_type` (`card_type_id`);
--
-- Indexes for table `resort`
--
ALTER TABLE `resort`
ADD PRIMARY KEY (`resort_id`),
ADD KEY `FK_resort_country` (`resort_country_id`),
ADD KEY `FK_resort_region` (`resort_region`);
--
-- Indexes for table `resort_details`
--
ALTER TABLE `resort_details`
ADD PRIMARY KEY (`resort_details_id`),
ADD KEY `FK_resort_details_list` (`resort_details_list_id`),
ADD KEY `FK_resort` (`resort_id`);
--
-- Indexes for table `resort_details_list`
--
ALTER TABLE `resort_details_list`
ADD PRIMARY KEY (`resort_details_list_id`);
--
-- Indexes for table `resort_region`
--
ALTER TABLE `resort_region`
ADD PRIMARY KEY (`resort_region_id`);
--
-- Indexes for table `room_booking`
--
ALTER TABLE `room_booking`
ADD PRIMARY KEY (`room_booking_id`),
ADD KEY `FK_hotel_room` (`hotel_room_id`);
--
-- Indexes for table `room_facility`
--
ALTER TABLE `room_facility`
ADD PRIMARY KEY (`room_facility_id`),
ADD KEY `FK_room_facility_list` (`room_facility_list_d`),
ADD KEY `FK_hotel_room_id` (`hotel_room_id`);
--
-- Indexes for table `room_facility_list`
--
ALTER TABLE `room_facility_list`
ADD PRIMARY KEY (`room_facility_list_id`);
--
-- Indexes for table `room_price`
--
ALTER TABLE `room_price`
ADD PRIMARY KEY (`room_price_id`),
ADD KEY `FK_hotel_room_price` (`hotel_room_id`);
--
-- Indexes for table `room_type`
--
ALTER TABLE `room_type`
ADD PRIMARY KEY (`room_type_id`);
--
-- Indexes for table `route`
--
ALTER TABLE `route`
ADD PRIMARY KEY (`route_id`),
ADD KEY `FK_dep_airport` (`dep_airport`),
ADD KEY `FK_arr_airport` (`arr_airport`);
--
-- Indexes for table `title`
--
ALTER TABLE `title`
ADD PRIMARY KEY (`title_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `address`
--
ALTER TABLE `address`
MODIFY `address_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `airport`
--
ALTER TABLE `airport`
MODIFY `airport_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `board`
--
ALTER TABLE `board`
MODIFY `board_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `booking`
--
ALTER TABLE `booking`
MODIFY `booking_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `booking_detail`
--
ALTER TABLE `booking_detail`
MODIFY `booking_detail_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `card_type`
--