Hive Bike Share Assignment

[premium_content]

 

Utilizing the Bay Area Bike Share database (both Year 1 & 2, Aug. 2013- Aug. 2015)- what is the most popular start station based on trip data?

2. Utilizing the Bay Area Bike Share database (Year 1 only, Aug. 2013- Feb 2014) – Which is the least popular(least used) start station in the Bike share trips data?

(Hint: Use the count of start station, group and order in ascending order)

Query on Impala :
select startstation , count(*) as total from trip_data where concat_ws(‘-‘, substr(startdate,1,2), substr(startdate,3,4), substr(startdate,5) ) < CAST(‘2014-08-01’ as timestamp) and concat_ws(‘-‘, substr(startdate,1,2), substr(startdate,3,4), substr(startdate,5) ) > CAST(‘2013-08-01’ as timestamp ) group by startstation order by total asc
3. 

Utilizing the Bay Area Bike Share database (for Year 1 only, Aug. 2013 – Aug. 2014 only) – what is the SECOND MOST popular end station based on trip data?

(Hint: Use the count of end station, group and order in descending order)

[/premium_content]
Post Tagged with

Leave a Reply