Home /
Expert Answers /
Computer Science /
3-b-create-an-airline-database-schema-based-on-the-airline-relational-database-schema-shown-in-fig-pa247
(Solved):
3.b Create an Airline database schema based on the AIRLINE relational database schema shown in Fig ...
3.b Create an Airline database schema based on the AIRLINE relational database schema shown in Figure 5.8 (see page 172 or below). For this problem, you need to implement your DDL statements using a RDBMS like your HW4 or your database project. AIRPORT Airport_code Name City State FLIGHT Flight_number Airline Weekdays FLIGHT_LEG Flight_number Leg_number Departure_airport_code Arrival_airport_code Scheduled_departure_time Scheduled_arrival_time LEG_INSTANCE Flight_number Leg_number Date Number_of_available_seats Airplane_id Departure_airport_code Departure_time Arrival_airport_code Arrival_time FARE Flight_number Fare_code Amount Restrictions AIRPLANE_TYPE Airplane_type_name Max_seats Company CAN_LAND Airplane_type_name Airport_code AIRPLANE Airplane_id Total_number_of_seats Airplane_type SEAT_RESERVATION Flight_number Leg_number Date Seat_number Customer_name Figure 5.8 The AIRLINE relational database schema. Customer_phone ?. Your DDL statements should clearly specify the Primary Key, Foreign Key, Unique, NOT NULL and Check constraints. ii. You need to implement the following business rules that are declaratively specified in your schema or be implemented through triggers. (a) The Number in the FLIGHT must be unique. The fare amount (Amount) is in a range of ($0 - $10,000). (c) The maximum seats (Max_seats) for any airplane type cannot exceed 600. (d) The maximum number of flight legs (leg_no in the FLIGHT_LEG) cannot exceed 4. (e) For any instance of a flight leg, the date of (Date in the LEG_INSTANCE) must be either current date or a future date. (b)
Answer: SQL Server is used CREATE TABLE Airport ( airport_code varchar(50) NOT NULL PRIMARY KEY, city varchar(255) NOT NULL, state varchar(255) NOT NULL, Name varchar(255) NOT NULL ); CREATE TABLE Airplane_type( type_name varchar(50) NOT NULL PRIMARY