This project covers my initial process of learning SQL and also aims at the retrieval of relevant information from the database in the best and efficient manner. The database is made up of eight (8) tables namely:
- airports
- aircrafts
- boarding_passes
- bookings
- flights
- seats
- tickets
- ticket_flights.
The following cases (29) were acknowledged in facilitating the query;
- List the cities in which there is no flights from Moscow.
- Select airports with time zone in Asia / Novokuznetsk and Asia / Krasnoyarsk.
- Which planes have a flight range from 3000 km to 6000 km?
- Get the model, range and miles of every aircraft exist in the airlines database. Notice that miles = range/1.609 and round the result to 2 numbers after the float point.
- Calculate the Average ticket sales.
- Return the number of seats in the aircraft that has aircraft code ‘CN1’.
- Return the number of seats in the aircraft that has aircraft code ‘SU9’
- Write a query to return the aircraft code and the number of seats of each aircraft in ascending order.
- Calculate the number of seats for all aircraft models, but now taking into account the class of service; Business class and Economic class.
- What was the least day in tickets sales?
PostgresSQL 14