Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Airline Database

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

SWE1004 Database Management Systems

A. Create the following tables


AIRLINE Database
AIRPORT(Airport_code ,Name,City,State)
FLIGHT(Flight_number, Airline,Weekdays)
FLIGHT_LEG(Flight_number,Leg_number,Scheduled_departure_time,Departure_ airport _
code,Arrival_airport_code,Scheduled_arrival_time)
LEG_INSTANCE(Flight_number,Leg_number,Date1,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,Customer_phone)
Make the underlined columns as primary key. Insert at least 10 rows to each table.
(Apply Interactive insertion. Check Entity Integrity Constraint and key Constraint.)
Query the Db to display
1. The flight details.
2. Id and type of Airplane.
3. Airports that start with “K”.
4. Airports (name) in Tamilnadu.
5. Seat reservation details for a given customer name and date.
6. Flight numbers that are scheduled on Wednesday or contain India in the name.
7. Airplane details for which type is not known.
8. Flight leg details that has a departure and arrival airport code.
9. Airport details that is not in 'Chennai'.
10. Seat reservations that are made during last month.
11. Fare code for amount in range 21000 to 37000.
12. Airplane company names that contains exactly 3 'S' in it.
13. Flight leg details that has leg #s 1, 3, and 4.
14. Maximum seats in airplane.
15. Number of leg instances of a flight number.
16. Total amount collected as fare for a given flight number.

B. Alter the tables to


1. Add required foreign keys.
2. Insert values to see the referential integrity constraints.
3. Make name of airport as Unique and weekdays as not null.
4. Make weekdays as multivalued attribute.
5. Increase the size of flight airline.
6. Convert fare amount to decimal type.
7. Decrease the size of fare restriction.
8. Add column country in airport table. (Update the table).
9. Add a column address in seat reservation table (as composite attribute).(Update the
table)
10. Delete the column added in Q.9.

C. Create the following assertions in the above tables.


1. Flight number should be in the range 1000 to 2000.
2. Country in airport must be India, USA, UAE, Malaysia, South Africa.
3. No of weekdays of flight is not more than 3.

D. Queries on SQL * PLUS functions.


1. Find the flight numbers booked for tomorrow.
2. Print the company name as 'aba' translated to 'ryb'.
3. Print the months between date of reservation and todays date(only unique dates).
4. Print the Airplane type names in Upper case
5. Print flight numbers with left padded stars.
6. Print the first five characters of customer names.
7. Print the length of longest airport name.
8. Print System date in the format 27th Nov 2015.
9. Replace the “a‟s present in customer names with “e”.
10. Print the time in flight leg as hh-ss-mm.
11. Print the date in seat reservation in the format '27/11/2015'.
12. Print the arrival time in 12hr format.

You might also like