Question: SQL In a file marta-queries.sql, write SQL queries to answer each of the following questions: What is the stop_name where the most people got on?

SQL

In a file marta-queries.sql, write SQL queries to answer each of the following questions:

What is the stop_name where the most people got on? What is the stop_name where the most people got off? (Hint: You will need to use an aggregate function)

What is the vehicle_id of the vehicle that made the most number of stops (not necessarily unique)?

What is the vehicle_id of the vehicle that visited the least number of unique stops in the given period?

What is the stop_name of the stop that is visited along the greatest number of unique routes?

Which direction has the highest passenger traffic? (Passenger traffic is determined by the sum of the number of people getting on at any stop along a route in a given direction) Which direction has the lowest?

What is the route_name of the most popular route? (The most popular route is the one with the highest average passenger traffic in either direction)

You are given data for Friday Tuesday (7/1/2016 7/5/2016). Which date has the highest passenger traffic and which date has the lowest?

DATA

https://www.dropbox.com/s/5yq259rjb8qme7l/passenger_data.csv?dl=0

https://www.dropbox.com/s/h9592ln0y6h5amp/marta-schema.sql?dl=0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!