1sf/bird-sql-train-with-schema huggingface dataset:
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: For all trips which took less 5 minutes, state the station name where the bike were borrowed and returned. Indicate mean temperature of the day.
Evidence: less than 5 minutes refers to duration<300 in seconds; the station where the bike was borrowed refers to start_station_name; the station where the bike was returned refers to end_station_name; mean temperature refers to min_temperature_f;
SQL: SELECT T1.start_station_name, T1.end_station_name, T2.mean_temperature_f FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.duration < 300
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: Among all the trips, which day had the most bikes borrowed? What was the average coldest temperature on that day?
Evidence: which day had the most bikes borrowed refers to MAX(start_date); the average coldest temperature can be computed as DIVIDE(SUM(min_temperature_f), COUNT(min_temperature_f));
SQL: SELECT T2.date, AVG(T2.min_temperature_f) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code GROUP BY T2.date ORDER BY COUNT(T1.start_date) DESC LIMIT 1
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: Calculate the average usage of each bike in the third quarter of year 2013. Find the average wind direction within the same period.
Evidence: the third quarter of year 2013 implies 3 month interval, including July, August, and September of 2013 and refers to date; the average usage of each bike = DIVIDE(SUM(duration), COUNT(bike_id)); the average wind direction = DIVIDE(SUM(wind_dir_degrees), COUNT(date));
SQL: SELECT AVG(T1.duration), AVG(T2.wind_dir_degrees) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE SUBSTR(CAST(T2.date AS TEXT), 1, INSTR(T2.date, '/') - 1) IN ('7', '8', '9') AND SUBSTR(CAST(T2.date AS TEXT), -4) = '2013'
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: How many bike stations were installed in San Jose in 2014? Indicate the names of the stations.
Evidence: San Jose is the name of the city; 2014 refers to installation_date between '1/1/2014' and '12/31/2014';
SQL: SELECT SUM(CASE WHEN city = 'San Jose' AND SUBSTR(installation_date, -4) = '2014' THEN 1 ELSE 0 END) FROM station UNION SELECT name FROM station WHERE city = 'San Jose' AND SUBSTR(installation_date, -4) = '2014'
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: What is the longest trip duration that started and ended August 29, 2013?
Evidence: started and ended August 29, 2013 refers to start_date = '8/29/2013' and end_date = '8/29/2013';
SQL: SELECT MAX(duration) FROM trip WHERE start_date LIKE '8/29/2013%' AND end_date LIKE '8/29/2013%'
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: How long did it take for bike id 426 to reach 2nd at South Park from Market at 4th on 8/29/2013? Indicate the duration in minutes.
Evidence: duration in minutes refers to DIVIDE(duration, 60 seconds); 2nd at South Park refers to end_station_name; Market at 4th refers to start_station_name; start_date = '8/29/2013'; end_date = '8/29/2013';
SQL: SELECT CAST(duration AS REAL) / 60  FROM trip WHERE bike_id = 426 AND end_station_name = '2nd at South Park' AND start_station_name = 'Market at 4th' AND start_date LIKE '8/29/2013%' AND end_date LIKE '8/29/2013%'
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: On 8/29/2013, who took the longest to arrive in California Ave Caltrain Station from University and Emerson? Indicate the bike id.
Evidence: start_date = '8/29/2013'; end_date = '8/29/2013'; end_station_name = 'California Ave Caltrain Station'; start_station_name = 'University and Emerson'; who took the longest to arrive refers to MAX(duration);
SQL: SELECT bike_id FROM trip WHERE start_date LIKE '8/29/2013%' AND end_date LIKE '8/29/2013%' AND end_station_name = 'California Ave Caltrain Station' AND start_station_name = 'University and Emerson' AND duration = ( SELECT MAX(duration) FROM trip WHERE start_date LIKE '8/29/2013%' AND end_date LIKE '8/29/2013%' AND end_station_name = 'California Ave Caltrain Station' AND start_station_name = 'University and Emerson' )
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: How many stations in San Francico can hold more than 20 bikes?
Evidence: San Francico is the name of the city; can hold more than 20 bikes implies dock's capacity and refers to dock_count≥20;
SQL: SELECT SUM(CASE WHEN city = 'San Francisco' AND dock_count > 20 THEN 1 ELSE 0 END) FROM station
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: When was the hottest temperature recorded? If there are multiple dates with the hottest temperature, indicate all of the dates.
Evidence: the hottest temperature refers to max_temperature_f;
SQL: SELECT max_temperature_f, date FROM weather WHERE max_temperature_f = ( SELECT MAX(max_temperature_f) FROM weather WHERE max_temperature_f IS NOT NULL AND max_temperature_f IS NOT '' )
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: What is the maximum dew point in Fahrenheit degree on 7/15/2014 in the area with a zip code of 94301?
Evidence: the maximum dew point in Fahrenheit degree refers to max_dew_point_f; date = '7/15/2014';
SQL: SELECT DISTINCT CASE WHEN date = '7/15/2014' AND zip_code = 94301 THEN max_dew_point_f END FROM weather
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: Which year experienced the most rain?
Evidence: events = 'Rain'; year refers to YEAR(date);
SQL: SELECT SUBSTR(CAST(date AS TEXT), -4) FROM weather GROUP BY SUBSTR(CAST(date AS TEXT), -4) ORDER BY SUM(CASE WHEN events LIKE '%Rain%' OR events LIKE '%rain%' THEN 1 ELSE 0 END) DESC LIMIT 1
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: On 10/20/2014, what is the duration of the fastest trip which started from the station with latitude and longitudes of 37.789625 and -122.400811, respectively? Indicate the bike id.
Evidence: lat = '37.789625' and long = '-122.400811' are latitude and longitude coordinates indicating location; started from the station refers to start_station_name; start_date = '10/20/2014'; duration of the fastest trip refers to MIN(duration);
SQL: SELECT MIN(T2.duration), T2.bike_id FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name WHERE T2.start_date LIKE '10/20/2014%' AND T1.lat = 37.789625 AND T1.long = -122.400811
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: Among the subscribers who rented a bike from South Van Ness at Market on 12/1/2013, whose duration was the shortest and to which station was the bike returned to? Indicate South Van Ness's dock count.
Evidence: South Van Ness at Market refers to start_station_name; subscriber refers to subscription_type; start_date = '12/1/2013'; the shortest duration refers to MIN(duration); which station was the bike returned to refers to end_station_name;
SQL: SELECT MIN(T2.duration), T2.end_station_name, COUNT(T2.start_station_name) FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name WHERE T2.start_date LIKE '12/1/2013%' AND T2.start_station_name = 'South Van Ness at Market' AND T2.subscription_type = 'Subscriber'
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: What is the maximum humidity in Powell Street BART when bike 496 was borrowed from the station on 8/29/2013?
Evidence: Powell Street refers to start_station_name; bike 496 refers to bike_id = '496'; start_date = '8/29/2013';
SQL: SELECT T2.max_humidity FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.start_date LIKE '8/29/2013%' AND T1.bike_id = 496 AND T1.start_station_name = 'Powell Street BART'
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: Which day in the month of November, 2014 have a foggy weather in the zip code 94301 and in total, how many bikes were borrowed by subscribers from all of the stations in the said day?
Evidence: day in the month of November, 2014 refers to start_date between '11/1/2014' and '11/30/2014'; foggy weather refers to events = 'Fog'; subscriber refers to subscription_type; all of the stations bikes were borrowed from refer to start_station_name;
SQL: SELECT T2.date, COUNT(T1.start_station_name) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '11/%/2014%' AND T2.zip_code = 94301 AND T2.events = 'Fog' AND T1.subscription_type = 'Subscriber'
Database: bike_share_1
Tables: station, status, trip, weather
Columns (table index, column name): -1, *, 0, id, 0, name, 0, lat, 0, long, 0, dock_count, 0, city, 0, installation_date, 1, station_id, 1, bikes_available, 1, docks_available, 1, time, 2, id, 2, duration, 2, start_date, 2, start_station_name, 2, start_station_id, 2, end_date, 2, end_station_name, 2, end_station_id, 2, bike_id, 2, subscription_type, 2, zip_code, 3, date, 3, max_temperature_f, 3, mean_temperature_f, 3, min_temperature_f, 3, max_dew_point_f, 3, mean_dew_point_f, 3, min_dew_point_f, 3, max_humidity, 3, mean_humidity, 3, min_humidity, 3, max_sea_level_pressure_inches, 3, mean_sea_level_pressure_inches, 3, min_sea_level_pressure_inches, 3, max_visibility_miles, 3, mean_visibility_miles, 3, min_visibility_miles, 3, max_wind_Speed_mph, 3, mean_wind_speed_mph, 3, max_gust_speed_mph, 3, precipitation_inches, 3, cloud_cover, 3, events, 3, wind_dir_degrees, 3, zip_code
Question: What is the name of the station that is less used by customers who borrow bikes from? Indicate when was the station installed.
Evidence: less used station where bikes are borrowed from refers to start_station_name which has the least number of customers; subscription_type = 'Customer'; when installed refers to installation_date;
SQL: SELECT T1.start_station_name, T2.installation_date FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.subscription_type = 'Customer' GROUP BY T1.start_station_name ORDER BY COUNT(T1.subscription_type) LIMIT 1