0% found this document useful (0 votes)
374 views1 page

SQL Main Test Question

The document provides SQL queries to analyze flight and passenger data: 1) Count the number of flights between 6 AM and 6 PM from Chennai. 2) Display flight details and classify type as "AIR PASSENGER", "AIR BUS", or "EXECUTIVE PASSENGER" based on ticket price. 3) Display unique passenger profiles that booked tickets from Hyderabad to Chennai including ID, name, mobile, and email. 4) Display flight ID, departure date, and number of passengers ("No_of_Passengers") for each flight and scheduled date. 5) Display flight details where over 10% of seats were booked, sorted by flight ID then seats booked.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
374 views1 page

SQL Main Test Question

The document provides SQL queries to analyze flight and passenger data: 1) Count the number of flights between 6 AM and 6 PM from Chennai. 2) Display flight details and classify type as "AIR PASSENGER", "AIR BUS", or "EXECUTIVE PASSENGER" based on ticket price. 3) Display unique passenger profiles that booked tickets from Hyderabad to Chennai including ID, name, mobile, and email. 4) Display flight ID, departure date, and number of passengers ("No_of_Passengers") for each flight and scheduled date. 5) Display flight details where over 10% of seats were booked, sorted by flight ID then seats booked.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1. Display number of flights between 6.00 AM and 6.00 PM from Chennai.

Hint Use FLIGHT_COUNT


as alias name

2. Display flight id, departure date, flight type of all flights. Flight type can be identified if ticket price
is less than 3000 then 'AIR PASSENGER’, ticket price between 3000 and less than 4000 'AIR BUS' and
ticket price between 4000 and greater than 4000 then 'EXECUTIVE PASSENGER'. Hint use
FLIGHT_TYPE as alias name

3. Write a query to display unique passenger profile id, first name, and mobile number and email
address of passengers who booked ticket to travel from HYDERABAD to CHENNAI.

4. Write a query to find the number of passengers travelled in each flight in each scheduled date.
The Query should display flight_id, flight_departure_date and the number of passengers as
“No_of_Passengers” (alias name).

6. Write a query to display the flight details in which more than 10% of seats have been booked. The
query should display Flight_Id, From_Location, To_Location,Total_Seats, seats booked as
“No_of_Seats_Booked” .Display the records sorted in ascending order based on flight id and then by
No_of_Seats_Booked.

You might also like