-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `airline`
--

-- --------------------------------------------------------

--
-- Table structure for table `AddOn`
--

CREATE TABLE `AddOn` (
  `AddOnID` int(3) NOT NULL,
  `AddOnName` text NOT NULL,
  `AddOnPrice` float NOT NULL,
  `Description` text NOT NULL,
  `ClassName` varchar(8) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `AddOn`
--

INSERT INTO `AddOn` (`AddOnID`, `AddOnName`, `AddOnPrice`, `Description`, `ClassName`) VALUES
(1, 'FirstClass_Flex', 10000, 'Checked baggage: 20 kg,Cabin baggage: 2x7 kg,Seat Selection: Complimentary,Refund fee: Allow', 'First'),
(2, 'FirstClass_ExtraFlex', 15000, 'Checked baggage: 25 kg,Cabin baggage: 2x7 kg,Seat Selection: Complimentary,Refund fee: Allow', 'First'),
(3, 'Business_Flex', 5000, 'Checked baggage: 10 kg,Cabin baggage: 2x7 kg,Seat Selection: Complimentary,Refund fee: Allow', 'Business'),
(4, 'Business_ExtraFlex', 7500, 'Checked baggage: 15 kg,Cabin baggage: 2x7 kg,Seat Selection: Complimentary,Refund fee: Allow', 'Business'),
(5, 'Economy_Flex', 250, 'Checked baggage: 5 kg,Cabin baggage: 2x7 kg,Seat Selection: Complimentary,Refund fee: Allow', 'Economy'),
(6, 'Economy_ExtraFlex', 400, 'Checked baggage: 7 kg,Cabin baggage: 2x7 kg,Seat Selection: Complimentary,Refund fee: Allow', 'Economy');

-- --------------------------------------------------------

--
-- Table structure for table `Airplane`
--

CREATE TABLE `Airplane` (
  `AirplaneID` int(6) NOT NULL,
  `RegisterDate` date NOT NULL,
  `PayLoad` float NOT NULL,
  `Status` enum('N','A') NOT NULL,
  `ModelNo` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Airplane`
--

INSERT INTO `Airplane` (`AirplaneID`, `RegisterDate`, `PayLoad`, `Status`, `ModelNo`) VALUES
(1, '2018-10-01', 10000, 'A', 'Boeing 777-300ER'),
(2, '2019-02-01', 10000, 'A', 'Boeing 777-300ER\r\n'),
(3, '2018-10-03', 10000, 'A', 'Boeing 777-300ER\r\n');

-- --------------------------------------------------------

--
-- Table structure for table `AirplaneSeat`
--

CREATE TABLE `AirplaneSeat` (
  `Row` varchar(5) NOT NULL,
  `AirplaneID` int(6) NOT NULL,
  `ClassName` varchar(8) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `AirplaneSeat`
--

INSERT INTO `AirplaneSeat` (`Row`, `AirplaneID`, `ClassName`) VALUES
('03-04', 1, 'Business'),
('03-04', 2, 'Business'),
('03-04', 3, 'Business'),
('05-08', 1, 'Economy'),
('05-08', 2, 'Economy'),
('05-08', 3, 'Economy'),
('01-02', 1, 'First'),
('01-02', 2, 'First'),
('01-02', 3, 'First');

-- --------------------------------------------------------

--
-- Table structure for table `Airport`
--

CREATE TABLE `Airport` (
  `AirportID` varchar(3) NOT NULL,
  `AirportName` text NOT NULL,
  `Address` text NOT NULL,
  `AirportTax` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Airport`
--

INSERT INTO `Airport` (`AirportID`, `AirportName`, `Address`, `AirportTax`) VALUES
('AKL', 'Auckland Airport', 'Auckland,New Zealand', 450),
('AMS', 'Amsterdam Airport Schiphol', 'Amsterdam,Netherlands', 600),
('ARN', 'Stockholm-Arlanda Airport', 'Stockholm,Sweden', 500),
('ATH', 'Athens International Airport', 'Athens,Greece', 650),
('AUH', 'Abu Dhabi International Airport', 'Abu Dhabi,United Arab Emirates', 700),
('BKK', 'Suvarnabhumi Airport', 'Bangkok,Thailand', 450),
('BOG', 'El Dorado International Airport', 'Bogota,Columbia', 550),
('BRU', 'Brussels Airport', 'Brussels,Belgium', 660),
('CDG', 'Charles de Gaulle Airport', 'Paris,France', 470),
('CGK', 'Soekarno Hatta International Airport', 'Jakarta,Indonesia', 440),
('CPH', 'Copenhagen Airport', 'Copenhagen,Denmark', 400),
('DEL', 'Indira Gandhi International Airport', 'Delhi,India', 500),
('DME', 'Domodedovo International Airport', 'Moscow,Russia', 450),
('DOH', 'Hamad International Airport', 'Doha,Qatar', 580),
('DUB', 'Dublin Airport', 'Dublin,Ireland', 400),
('FCO', 'Leonardo da Vinci-Fiumicino Airport', 'Rome,Italy', 500),
('GRU', 'Sao Paulo-Guarulhos International Airport', 'Sao Paulo,Brazil', 400),
('HKG', 'Hong Kong International Airport', 'Hong Kong,Hong Kong', 420),
('ICN', 'Incheon International Airport', 'Incheon,South Korea', 460),
('JFK', 'John F. Kennedy International Airport', 'New York City,USA', 500),
('JNB', 'OR Tambo International Airport', 'Johannesburg,South Africa', 500),
('KUL', 'Kuala Lumpur International Airport', 'Kuala Lumpur,Malaysia', 400),
('LAX', 'Los Angeles International Airport', 'Los Angeles,USA', 600),
('MAD', 'Mad-Barajas Airport', 'Madrid,Spain', 560),
('MAN', 'Manchester Airport', 'Manchester,UK', 500),
('MEX', 'Mexico City International Airport', 'Mexico City,Mexico', 450),
('MNL', 'Ninoy Aquino International Airport', 'Manila,Philippines', 500),
('MUC', 'Munich Airport', 'Munich,Germany', 560),
('NRT', 'Narita International Airport', 'Tokyo\\Yokohama,Japan', 600),
('OSL', 'Oslo Airport-Gardermoen', 'Oslo,Norway', 690),
('PEK', 'Beijing Capital International Airport', 'Beijing,China', 470),
('RUH', 'King Khalid International Airport', 'Riyadh,Saudi Arabia', 750),
('SAW', 'Sabiha Gokken International Airport', 'Istanbul,Turkey', 530),
('SGN', 'Tan Son Nhat International Airport', 'Ho Chi Minh City,Vietnam', 570),
('SIN', 'Singapore Changi Airport', 'Singapore,Singapore', 550),
('SYD', 'Sydney Airport', 'Sydney,Australia', 500),
('TPE', 'Taiwan Taoyuan International Airport', 'Taoyuan,Taiwan', 400),
('VIE', 'Vienna International Airport', 'Vienna,Austria', 500),
('YVR', 'Vancouver International Airport', 'Vancouver,Canada', 550),
('ZRH', 'Zurich Airport', 'Zurich,Switzerland', 560);

-- --------------------------------------------------------

--
-- Table structure for table `Billing`
--

CREATE TABLE `Billing` (
  `BillingID` int(10) NOT NULL,
  `CardNo` varchar(16) NOT NULL,
  `MemberID` int(6) DEFAULT NULL,
  `MemberPromotionID` int(6) DEFAULT NULL,
  `PromotionCode` int(8) DEFAULT NULL,
  `PayDate` date NOT NULL,
  `AmountPaid` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Billing`
--

INSERT INTO `Billing` (`BillingID`, `CardNo`, `MemberID`, `MemberPromotionID`, `PromotionCode`, `PayDate`, `AmountPaid`) VALUES
(1, '1234567890', 1, NULL, NULL, '2019-05-28', 10817.9),
(2, '7382930475869047', 12, NULL, NULL, '2019-05-28', 18527.9),
(3, '0198546738267456', 12, NULL, NULL, '2019-05-28', 42027.9),
(4, '1234', 12, NULL, NULL, '2019-05-28', 23527.9);

-- --------------------------------------------------------

--
-- Table structure for table `Booking`
--

CREATE TABLE `Booking` (
  `BookingID` int(6) NOT NULL,
  `FlightID` int(6) NOT NULL,
  `PassengerID` int(8) NOT NULL,
  `BillingID` int(10) NOT NULL,
  `SeatID` varchar(4) NOT NULL,
  `AddOnID` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Booking`
--

INSERT INTO `Booking` (`BookingID`, `FlightID`, `PassengerID`, `BillingID`, `SeatID`, `AddOnID`) VALUES
(1, 3, 1, 1, '06_A', 5),
(2, 16, 3, 2, '04_C', 3),
(3, 22, 4, 3, '01_G', 2),
(4, 16, 5, 4, '01_F', 1);

-- --------------------------------------------------------

--
-- Table structure for table `Class`
--

CREATE TABLE `Class` (
  `ClassName` varchar(8) NOT NULL,
  `ServiceDescription` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Class`
--

INSERT INTO `Class` (`ClassName`, `ServiceDescription`) VALUES
('Business', ''),
('Economy', ''),
('First', '');

-- --------------------------------------------------------

--
-- Table structure for table `Flight`
--

CREATE TABLE `Flight` (
  `FlightID` int(6) NOT NULL,
  `DepartureDate` datetime NOT NULL,
  `ArrivalDate` datetime NOT NULL,
  `RouteID` int(7) NOT NULL,
  `AirplaneID` int(6) NOT NULL,
  `Gate` varchar(3) NOT NULL,
  `Status` enum('N','A') NOT NULL,
  `Price` float NOT NULL,
  `Seat` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Flight`
--

INSERT INTO `Flight` (`FlightID`, `DepartureDate`, `ArrivalDate`, `RouteID`, `AirplaneID`, `Gate`, `Status`, `Price`, `Seat`) VALUES
(3, '2019-05-27 09:35:00', '2019-05-27 10:35:00', 23, 1, 'G22', 'A', 9890, '\"06_A\",\"05_A\"'),
(6, '2019-05-03 08:00:00', '2019-05-04 11:00:00', 19, 1, 'A33', 'A', 45000, ''),
(7, '2019-05-28 01:25:00', '2019-05-28 05:25:00', 13, 1, 'G11', 'A', 34700, ''),
(16, '2019-05-28 00:00:00', '2019-05-28 06:00:00', 3, 2, 'G09', 'A', 13000, '\"04_C\",\"01_F\"'),
(17, '2019-05-28 07:00:00', '2019-05-28 13:00:00', 38, 2, 'G01', 'A', 13000, ''),
(18, '2019-05-28 13:47:00', '2019-05-29 03:41:00', 4, 2, 'B12', 'A', 17000, ''),
(19, '2019-05-28 04:15:00', '2019-05-28 16:20:00', 9, 3, 'C12', 'A', 25000, ''),
(20, '2019-05-28 17:00:00', '2019-05-29 04:15:00', 28, 3, 'D10', 'A', 29800, ''),
(21, '2019-01-09 20:15:00', '2019-01-10 03:20:00', 25, 1, 'D36', 'A', 24500, ''),
(22, '2019-01-14 01:00:00', '2019-01-14 01:00:00', 1, 2, 'A10', 'A', 26500, '\"01_G\"'),
(23, '2019-01-21 12:35:00', '2019-01-22 01:35:00', 5, 3, 'S13', 'A', 32000, ''),
(24, '2019-01-22 04:30:00', '2019-01-22 14:20:00', 33, 3, 'A05', 'A', 26800, ''),
(25, '2019-02-01 09:50:00', '2019-02-02 03:50:00', 6, 2, 'B04', 'A', 27800, ''),
(26, '2019-02-03 10:20:00', '2019-02-03 15:20:00', 31, 2, 'B07', 'A', 15600, ''),
(27, '2019-01-01 15:20:00', '2019-01-01 21:20:00', 3, 3, 'A17', 'A', 13000, ''),
(28, '2019-02-03 14:00:00', '2019-02-03 20:00:00', 3, 3, 'A14', 'A', 13000, ''),
(29, '2019-03-11 02:30:00', '2019-03-11 06:30:00', 3, 1, 'A01', 'A', 13000, ''),
(30, '2019-04-22 23:30:00', '2019-04-23 05:40:00', 3, 1, 'A21', 'A', 13000, ''),
(31, '2019-03-14 02:10:00', '2019-03-15 06:20:00', 22, 2, 'C14', 'A', 38700, '');

-- --------------------------------------------------------

--
-- Table structure for table `MemberPromotion`
--

CREATE TABLE `MemberPromotion` (
  `MemberID` int(6) DEFAULT NULL,
  `MemberPromotionID` int(6) NOT NULL,
  `MemberPromotionDescription` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `Passenger`
--

CREATE TABLE `Passenger` (
  `PassengerID` int(8) NOT NULL,
  `Sex` varchar(1) NOT NULL,
  `FirstName` varchar(50) NOT NULL,
  `LastName` varchar(50) NOT NULL,
  `DOB` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Passenger`
--

INSERT INTO `Passenger` (`PassengerID`, `Sex`, `FirstName`, `LastName`, `DOB`) VALUES
(1, 'M', 'Namjoon', 'Kim', '1999-10-31'),
(2, 'M', 'Namjoon', 'Kim', '1999-10-31'),
(3, 'M', 'someone', 'somename', '1999-09-11'),
(4, 'F', 'Hello', 'World', '1986-10-20'),
(5, 'F', 'Namjoon', 'Kim', '2019-05-01');

-- --------------------------------------------------------

--
-- Table structure for table `Promotion`
--

CREATE TABLE `Promotion` (
  `PromotionCode` int(8) NOT NULL,
  `PromotionDescription` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `Route`
--

CREATE TABLE `Route` (
  `RouteID` int(7) NOT NULL,
  `Origin` varchar(3) NOT NULL,
  `Destination` varchar(3) NOT NULL,
  `Miles` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Route`
--

INSERT INTO `Route` (`RouteID`, `Origin`, `Destination`, `Miles`) VALUES
(1, 'BKK', 'LAX', 8275),
(3, 'BKK', 'NRT', 2898),
(4, 'BKK', 'MUC', 5472),
(5, 'NRT', 'AUH', 5041),
(6, 'BRU', 'CGK', 7103),
(7, 'PEK', 'CDG', 5111),
(8, 'MEX', 'CPH', 5915),
(9, 'JFK', 'DME', 4672),
(11, 'FCO', 'GRU', 5894),
(12, 'JNB', 'KUL', 5313),
(13, 'MAN', 'SYD', 10573),
(14, 'MNL', 'OSL', 6026),
(15, 'SAW', 'VIE', 793),
(16, 'TPE', 'HKG', 505),
(17, 'ZRH', 'YVR', 5169),
(18, 'MAD', 'MAN', 906),
(19, 'GRU', 'BKK', 10200),
(20, 'DOH', 'JNB', 3891),
(21, 'ARN', 'CPH', 325),
(22, 'ATH', 'AKL', 10865),
(23, 'AMS', 'MAN', 307),
(24, 'JFK', 'ICN', 6875),
(25, 'PEK', 'DEL', 2349),
(26, 'DUB', 'MUC', 857),
(27, 'RUH', 'DME', 2198),
(28, 'DME', 'SGN', 857),
(29, 'BOG', 'JFK', 2497),
(30, 'SIN', 'NRT', 3340),
(31, 'CGK', 'SGN', 1872),
(32, 'JFK', 'DUB', 3182),
(33, 'AUH', 'CGK', 4121),
(34, 'TPE', 'ARN', 5193),
(35, 'VIE', 'SYD', 9938),
(36, 'SYD', 'HKG', 4586),
(37, 'NRT', 'LAX', 5051),
(38, 'NRT', 'BKK', 2898);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `AddOn`
--
ALTER TABLE `AddOn`
  ADD PRIMARY KEY (`AddOnID`),
  ADD KEY `ClassName` (`ClassName`);

--
-- Indexes for table `Airplane`
--
ALTER TABLE `Airplane`
  ADD PRIMARY KEY (`AirplaneID`);

--
-- Indexes for table `AirplaneSeat`
--
ALTER TABLE `AirplaneSeat`
  ADD PRIMARY KEY (`Row`,`AirplaneID`),
  ADD KEY `AirplaneID` (`AirplaneID`),
  ADD KEY `ClassName` (`ClassName`);

--
-- Indexes for table `Airport`
--
ALTER TABLE `Airport`
  ADD PRIMARY KEY (`AirportID`);

--
-- Indexes for table `Billing`
--
ALTER TABLE `Billing`
  ADD PRIMARY KEY (`BillingID`),
  ADD KEY `CardNo` (`CardNo`),
  ADD KEY `MemberID` (`MemberID`),
  ADD KEY `MemberPromotionID` (`MemberPromotionID`),
  ADD KEY `PromotionCode` (`PromotionCode`);

--
-- Indexes for table `Booking`
--
ALTER TABLE `Booking`
  ADD PRIMARY KEY (`BookingID`),
  ADD KEY `BillingID` (`BillingID`),
  ADD KEY `FlightID` (`FlightID`),
  ADD KEY `PassengerID` (`PassengerID`),
  ADD KEY `SeatID` (`SeatID`),
  ADD KEY `AddOnID` (`AddOnID`);

--
-- Indexes for table `Class`
--
ALTER TABLE `Class`
  ADD PRIMARY KEY (`ClassName`);

--
-- Indexes for table `Flight`
--
ALTER TABLE `Flight`
  ADD PRIMARY KEY (`FlightID`),
  ADD KEY `AirplaneID` (`AirplaneID`),
  ADD KEY `RouteID` (`RouteID`);

--
-- Indexes for table `MemberPromotion`
--
ALTER TABLE `MemberPromotion`
  ADD PRIMARY KEY (`MemberPromotionID`),
  ADD KEY `MemberID` (`MemberID`);

--
-- Indexes for table `Passenger`
--
ALTER TABLE `Passenger`
  ADD PRIMARY KEY (`PassengerID`);

--
-- Indexes for table `Promotion`
--
ALTER TABLE `Promotion`
  ADD PRIMARY KEY (`PromotionCode`);

--
-- Indexes for table `Route`
--
ALTER TABLE `Route`
  ADD PRIMARY KEY (`RouteID`),
  ADD KEY `Origin` (`Origin`),
  ADD KEY `Destination` (`Destination`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `AddOn`
--
ALTER TABLE `AddOn`
  MODIFY `AddOnID` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `Airplane`
--
ALTER TABLE `Airplane`
  MODIFY `AirplaneID` int(6) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `Billing`
--
ALTER TABLE `Billing`
  MODIFY `BillingID` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `Booking`
--
ALTER TABLE `Booking`
  MODIFY `BookingID` int(6) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `Flight`
--
ALTER TABLE `Flight`
  MODIFY `FlightID` int(6) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;

--
-- AUTO_INCREMENT for table `Passenger`
--
ALTER TABLE `Passenger`
  MODIFY `PassengerID` int(8) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `Route`
--
ALTER TABLE `Route`
  MODIFY `RouteID` int(7) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `AddOn`
--
ALTER TABLE `AddOn`
  ADD CONSTRAINT `addon_ibfk_1` FOREIGN KEY (`ClassName`) REFERENCES `Class` (`ClassName`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `AirplaneSeat`
--
ALTER TABLE `AirplaneSeat`
  ADD CONSTRAINT `airplaneseat_ibfk_1` FOREIGN KEY (`AirplaneID`) REFERENCES `Airplane` (`AirplaneID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `airplaneseat_ibfk_2` FOREIGN KEY (`ClassName`) REFERENCES `Class` (`ClassName`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `Billing`
--
ALTER TABLE `Billing`
  ADD CONSTRAINT `billing_ibfk_1` FOREIGN KEY (`CardNo`) REFERENCES `PaymentMethod` (`CardNo`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `billing_ibfk_2` FOREIGN KEY (`MemberID`) REFERENCES `Member` (`MemberID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `billing_ibfk_3` FOREIGN KEY (`MemberPromotionID`) REFERENCES `MemberPromotion` (`MemberPromotionID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `billing_ibfk_4` FOREIGN KEY (`PromotionCode`) REFERENCES `Promotion` (`PromotionCode`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `Booking`
--
ALTER TABLE `Booking`
  ADD CONSTRAINT `booking_ibfk_1` FOREIGN KEY (`BillingID`) REFERENCES `Billing` (`BillingID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `booking_ibfk_2` FOREIGN KEY (`FlightID`) REFERENCES `Flight` (`FlightID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `booking_ibfk_3` FOREIGN KEY (`PassengerID`) REFERENCES `Passenger` (`PassengerID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `booking_ibfk_4` FOREIGN KEY (`AddOnID`) REFERENCES `AddOn` (`AddOnID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `Flight`
--
ALTER TABLE `Flight`
  ADD CONSTRAINT `flight_ibfk_2` FOREIGN KEY (`AirplaneID`) REFERENCES `Airplane` (`AirplaneID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `flight_ibfk_3` FOREIGN KEY (`RouteID`) REFERENCES `Route` (`RouteID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `MemberPromotion`
--
ALTER TABLE `MemberPromotion`
  ADD CONSTRAINT `memberpromotion_ibfk_1` FOREIGN KEY (`MemberID`) REFERENCES `Member` (`MemberID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `Route`
--
ALTER TABLE `Route`
  ADD CONSTRAINT `route_ibfk_1` FOREIGN KEY (`Origin`) REFERENCES `Airport` (`AirportID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `route_ibfk_2` FOREIGN KEY (`Destination`) REFERENCES `Airport` (`AirportID`);
COMMIT;

