21.17. Write Code Questions¶
-
Given a database of bike share information fix the SELECT statement to retrieve the
bike_number
andduration
from tabletrip_data
forbike_number
“W00837”. -
Given a database of bike share information write a SELECT statement below that retrieves the
bike_number
andduration
from tabletrip_data
for all of the rentals that had aduration
of more than 85,000. -
Given a database of bike share information write a SELECT statement below that retrieves the
bike_number
,duration
, andstart_date
from tabletrip_data
for all of the rentals fromstart_station
31105 and limit the results to 5. -
Given a database of bike share information write a SELECT statement below that retrieves the
bike_number
andmember_type
for all of the rentals from tabletrip_data
whereend_station
31200 and limit the results to 5. -
Given a database of bike share information write a SELECT statement below that retrieves the
bike_number
andduration
from tabletrip_data
for all of the rentals that had aduration
of more than 85,000 and order them byduration
descending. -
Given a database of bike share information write a SELECT statement to retrieve all the rows from tables
trip_data
andbikeshare_stations
where thestart_station
intrip_data
is the same as thestation_id
inbikeshare_stations
. Limit the results to 5 rows. -
Given a database of bike share information write a SELECT statement to retrieve the
duration
andbike_number
fromtrip_data
and thename
frombikeshare_stations
where thestart_station
intrip_data
is the same as thestation_id
inbikeshare_stations
. Limit the results to 5 rows. -
Given a database of bike share information write a SELECT statement to retrieve the
duration
andbike_number
fromtrip_data
and thename
,latitude
, andlongitude
frombikeshare_stations
where thestart_station
intrip_data
is the same as thestation_id
inbikeshare_stations
. Limit the results to 5 rows. -
Given a database of bike share information write a SELECT statement to retrieve the
bike_number
,start_date
, andend_date
fromtrip_data
and thestation_id
andname
frombikeshare_stations
where thestart_station
intrip_data
is the same as thestation_id
inbikeshare_stations
and where thestation_id
equals 31101. Limit the results to 5 rows. -
Given a database of bike share information write a SELECT statement to retrieve the
bike_number
,start_date
, andend_date
fromtrip_data
and thestation_id
andname
frombikeshare_stations
where thestart_station
intrip_data
is the same as thestation_id
inbikeshare_stations
and where themember_type
equals “Casual”. Limit the results to 5 rows.