0% found this document useful (0 votes)
25 views

SQL Capstone Project

capstone

Uploaded by

tushar3931ynr
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

SQL Capstone Project

capstone

Uploaded by

tushar3931ynr
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

SQL Capstone Project

Please answer the following questions using Airline DB database.


Instruction to attempt questions:
 Students need to write queries for the questions mentioned in the using Airline DB database
 Read the questions carefully before writing the query in Airline Playground (in the Playground
chapter of SQL)
 Airline DB: https://www.skillovilla.com/playground/sql?exerciseId=0181e251-6ea8-4595-ae2b-
0c690119f8db
How to submit the capstone:
 Copy the SQL query code and paste it in the answer section in this file.
 Once the assignment is done, submit the file over LMS.
Invalid Submissions:
 Pasting pictures of the code as answer is NOT acceptable.
 Uploading output data (CSVs) of the SQL queries is NOT acceptable.

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

Attempt the following Questions-

1. Represent the “book_date” column in “yyyy-mmm-dd” format using Bookings table


Expected output: book_ref, book_date (in “yyyy-mmm-dd” format) , total amount
Answer:

2. Get the following columns in the exact same sequence.


Expected columns in the output: ticket_no, boarding_no, seat_number, passenger_id,
passenger_name.
Answer:

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

Expected output: Month_name(“mmm-yy” format), passenger_id, passenger_name and total


amount

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:

7. How many tickets are there without boarding passes?


Expected Output: just one number is required.

Answer:

8. Identify details of the longest flight (using flights table)?


Expected Output: Flight number, departure airport, arrival airport, aircraft code and durations.

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

Expected output: flight_id, flight_number, scheduled_departure, scheduled_arrival, departure


airport and timings.
Answer:

11. Questions: Find list of airport codes in Europe/Moscow timezone


Expected Output: Airport_code.

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:

17. Identify flight ids having range between 3000 to 6000


Expected Output : Flight_Number , aircraft_code, ranges

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:

24. Which airport(name) has most cancelled flights (arriving)?


Expected Output : Airport_name

25. Identify flight ids which are using “Airbus aircrafts”


Expected Output : Flight_id,aircraft_model

Answer:

26. Identify date-wise last flight id flying from every airport?


Expected Output: Flight_id,flight_number,schedule_departure,departure_airport

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:

29. Identify list of Airbus flight ids which got cancelled.


Expected Output : Flight_id

Answer:

30. Identify list of flight ids having highest range.


Expected Output : Flight_no, range

Answer:

You might also like