Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

Students also viewed these Databases questions