2
answers
1
watching
324
views

Q5. There are two tables with the following details:

 

Ride_details table:

 

Ride_id – A unique entry for each ride taken. Created_at – The time on which the ride was created. Pickup_location – An id for the pickup location.

Drop_location – An id for the drop location.

 

 

 

Location table:

 

Location_id – A unique entry for each location.

 

Metro_location – 1 implies that the stand is a metro station. 0 implies that the stand is not a metro station.

 

Write an SQL query to get the date wise number of rides in the following sets -

  1. Rides starting from the metro and ending at a non-metro location - Column name – metro_start

 

  1. Rides starting from a non-metro location and ending at the metro station - Column name –

metro_end

 

  1. Rides starting and ending at the metro station - Column name – metro_start_end

 

Rides starting and ending at a non-metro location - Column name – non_metro_start_end

For unlimited access to Homework Help, a Homework+ subscription is required.

Avatar image
Read by 1 person

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in
Avatar image
Read by 4 people
Already have an account? Log in

Related questions

Related Documents

Weekly leaderboard

Start filling in the gaps now
Log in