Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT FROM LIMIT
- All of the information on the stations table. SELECT * FROM stations
- Max, min, and mean temp from the conditions table.
- SELECT MAX(max_temperature_f) FROM conditions;
- SELECT MIN(max_temperature_f) FROM conditions;
- SELECT AVG(max_temperature_f) FROM conditions;
- id, start_station_id, and duration of five trips.
- WHERE
- Trips that started at the station with an id of 2.
- SELECT id, start_station_id, duration FROM trips WHERE start_station_id = '2'LIMIT 5;
- Stations that have a dock_count of 15.
- SELECT * FROM stations WHERE dock_count = '15';
- id, date, and precipitation for conditions with more than 1 inch of precipitation.
- SELECT id, date, precipitation_inches FROM conditions WHERE precipitation_inches > '1';
- max/min/count/average
- Duration of the longest trip.
- SELECT MAX(duration) FROM trips;
- Duration of the shortest trip.
- SELECT MIN(duration) FROM trips;
- Average dock_count at a station.
- SELECT AVG(dock_count) FROM stations;
- Highest dock_count at a station.
- SELECT MAX(duration) FROM trips;
- Count of days with no rain.
- SELECT COUNT(*) FROM conditions WHERE precipitation_inches = 0;
- Name/dock_count of the station with the most docks.
- SELECT name, dock_count FROM stations WHERE dock_count = (SELECT MAX(dock_count) FROM stations);
- Id, start station id, and duration of the longest trip.
- SELECT id,start_station_id, duration FROM trips WHERE duration = (SELECT MAX(duration) FROM trips);
- Id, start station id, and duration of the shortest trips.
- SELECT id,start_station_id, duration FROM trips WHERE duration = (SELECT MIN(duration) FROM trips);
- JOIN
- Name of the station where the longest trip started.
- SELECT name FROM stations JOIN trips ON stations.id = start_station_id WHERE duration = (SELECT MAX(duration) FROM trips);
- Name of the stations where the shortest trips started.
- SELECT name FROM stations JOIN trips ON stations.id = start_station_id WHERE duration = (SELECT MIN(duration) FROM trips);
- GROUP
- Count of trips started at each station.
- Count of trips ended at each station.
- Count of trips started on days with more than an inch of precipitation.
- ORDER
- Top five stations with the most trips started.
- Top five stations with the most trips ended.
- Least popular start station.
- mean_temperature and precipiation on the five dates with the most trips.
Add Comment
Please, Sign In to add comment