21.16. Write Code Questions

  1. Given a database of bike share information fix the SELECT statement to retrieve the bike_number and duration from table trip_data for bike_number “W00837”.

  2. Given a database of bike share information write a SELECT statement below that retrieves the bike_number and duration from table trip_data for all of the rentals that had a duration of more than 85,000.

  3. Given a database of bike share information write a SELECT statement below that retrieves the bike_number, duration, and start_date for all of the rentals from start_station 31105 and limit the results to 5.

  4. Given a database of bike share information write a SELECT statement below that retrieves the bike_number and member_type, for all of the rentals from end_station 31200 and limit the results to 5.

  5. Given a database of bike share information write a SELECT statement below that retrieves the bike_number and duration from table trip_data for all of the rentals that had a duration of more than 85,000 and order them by duration descending.

  6. Given a database of bike share information write a SELECT statement to retrieve all the columns from tables trip_data and bikeshare_stations where the start_station in trip_data is the same as the station_id in bikeshare_stations. Limit the results to 5 rows.

  7. Given a database of bike share information write a SELECT statement to retrieve the duration and bike_number from trip_data and the name from bikeshare_stations where the start_station in trip_data is the same as the station_id in bikeshare_stations. Limit the results to 5 rows.

  8. Given a database of bike share information write a SELECT statement to retrieve the duration and bike_number from trip_data and the name, latitude, and longitude from bikeshare_stations where the start_station in trip_data is the same as the station_id in bikeshare_stations. Limit the results to 5 rows.

  9. Given a database of bike share information write a SELECT statement to retrieve the bike_number, start_date, and end_date from trip_data and the station_id and name from bikeshare_stations where the start_station in trip_data is the same as the station_id in bikeshare_stations and where the station_id equals 31101. Limit the results to 5 rows.

  10. Given a database of bike share information write a SELECT statement to retrieve the bike_number, start_date, and end_date from trip_data and the station_id and name from bikeshare_stations where the start_station in trip_data is the same as the station_id in bikeshare_stations and where the member_type equals “Casual”. Limit the results to 5 rows.

You have attempted of activities on this page