SQL Capstone Project
SQL Capstone Project
Write your answers(query) in the answer and submit it. To write the answer in the
assignment, please follow the below example in yellow
Example:
Questions: Extract all the columns of the flights table
Answer: SELECT * FROM flights
3. Write a query to find the seat number which is least allocated among all the seats?
Answer:
4. In the database, identify the month wise highest paying passenger name and
passenger id.
SQL Capstone Project
Answer:
5. In the database, identify the month wise least paying passenger name and
passenger id?
Expected output: Month_name(“mmm-yy” format), passenger_id, passenger_name and total
amount
Answer:
6. Identify the travel details of non stop journeys or return journeys (having more than
1 flight).
Expected Output: Passenger_id, passenger_name, ticket_number and flight count.
Answer:
Answer:
Answer:
9. Identify details of all the morning flights (morning means between 6AM to 11 AM,
using flights table)?
Expected output: flight_id, flight_number, scheduled_departure, scheduled_arrival and timings.
Answer:
10. Identify the earliest morning flight available from every airport.
SQL Capstone Project
Answer:
12. Write a query to get the count of seats in various fare condition for every aircraft code?
Expected Outputs: Aircraft_code, fare_conditions ,seat count
Answer:
13. How many aircrafts codes have at least one Business class seats?
Expected Output : Count of aircraft codes
Answer:
14. Find out the name of the airport having maximum number of departure flight
Expected Output : Airport_name
Answer:
15. Find out the name of the airport having least number of scheduled departure flights
Expected Output : Airport_name
Answer:
16. How many flights from ‘DME’ airport don’t have actual departure?
Expected Output : Flight Count
Answer:
Answer:
18. Write a query to get the count of flights flying between URS and KUF?
Expected Output : Flight_count
Answer:
19. Write a query to get the count of flights flying from either from NOZ or KRR?
Expected Output : Flight count
SQL Capstone Project
Answer:
20. Write a query to get the count of flights flying from KZN,DME,NBC,NJC,GDX,SGC,VKO,ROV
Expected Output : Departure airport ,count of flights flying from these airports.
Answer:
21. Write a query to extract flight details having range between 3000 and 6000 and flying from
DME
Expected Output :Flight_no,aircraft_code,range,departure_airport
Answer:
22. Find the list of flight ids which are using aircrafts from “Airbus” company and got cancelled
or delayed
Expected Output : Flight_id,aircraft_model
Answer:
23. Find the list of flight ids which are using aircrafts from “Boeing” company and got cancelled
or delayed
Expected Output : Flight_id,aircraft_model
Answer:
Answer:
Answer:
27. Identify list of customers who will get the refund due to cancellation of the flights and how
much amount they will get?
Expected Output : Passenger_name,total_refund.
Answer:
SQL Capstone Project
28. Identify date wise first cancelled flight id flying for every airport?
Expected Output : Flight_id,flight_number,schedule_departure,departure_airport
Answer:
Answer:
Answer: