Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL Queries: Flights database 1.) Using the flights.m_ticket_prices and the m_airports table, find the distinct routes (route is a distinct origin-destination pair) where the origin

SQL Queries: Flights database

 1.) Using the flights.m_ticket_prices and the m_airports table, find the distinct routes (route is a distinct origin-destination pair) where the origin and the destination are part of the same state; in the output show the origin, dest, and the state of the airports.

 

2.) Use the table flights.m_ticket_prices. For each route (origin-destination pair), list the following statistics:

  • cheapest fare
  • most expensive fare
  • the average fare
  • number of carriers serving the route
  • total number of passengers for the route

Report results only for routes with at least 3 carriers and more than  10,000 total passengers. 

 

3.) Flights: For each state of the origin airport, calculate the following metrics: the number of origin airports in the state, the number of carriers operating flights that originate from the state, the total number of passengers originating from the state, and the average fare per mile. Use the m_ticket_prices and the m_airports tables to find the information that you need. 

 

4.)

 

Flights: Using the table flights.m_ticket_prices, for each carrier, report the number of routes they maintain, the number of airports their flights leave from, and their average fare per mile. Report results only for carriers having more than 20,000 passengers across all their flights.


Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Algorithms questions

Question

What is a form?

Answered: 1 week ago

Question

Describe the results of the division process in relational algebra.

Answered: 1 week ago