db_id
stringlengths 4
31
| SQL
stringlengths 18
1.45k
| input_sequence
stringlengths 148
11k
| question
stringlengths 16
325
|
|---|---|---|---|
student_assessment
|
select student_id from student_course_registrations union select student_id from student_course_attendance
|
Question: what are the ids of the students who either registered or attended a course? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
|
what are the ids of the students who either registered or attended a course?
|
student_assessment
|
select course_id from student_course_registrations where student_id = 121 union select course_id from student_course_attendance where student_id = 121
|
Question: find the id of courses which are registered or attended by student whose id is 121? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
|
find the id of courses which are registered or attended by student whose id is 121?
|
student_assessment
|
select course_id from student_course_registrations where student_id = 121 union select course_id from student_course_attendance where student_id = 121
|
Question: what are the ids of the courses that are registered or attended by the student whose id is 121? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
|
what are the ids of the courses that are registered or attended by the student whose id is 121?
|
student_assessment
|
select * from student_course_registrations where student_id not in (select student_id from student_course_attendance)
|
Question: what are all info of students who registered courses but not attended courses? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
|
what are all info of students who registered courses but not attended courses?
|
student_assessment
|
select * from student_course_registrations where student_id not in (select student_id from student_course_attendance)
|
Question: what are all details of the students who registered but did not attend any course? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
|
what are all details of the students who registered but did not attend any course?
|
student_assessment
|
select t2.student_id from courses as t1 join student_course_registrations as t2 on t1.course_id = t2.course_id where t1.course_name = 'statistics' order by t2.registration_date
|
Question: list the id of students who registered course statistics in the order of registration date. | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
|
list the id of students who registered course statistics in the order of registration date.
|
student_assessment
|
select t2.student_id from courses as t1 join student_course_registrations as t2 on t1.course_id = t2.course_id where t1.course_name = 'statistics' order by t2.registration_date
|
Question: what are the ids of the students who registered course statistics by order of registration date? | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
|
what are the ids of the students who registered course statistics by order of registration date?
|
student_assessment
|
select t2.student_id from courses as t1 join student_course_attendance as t2 on t1.course_id = t2.course_id where t1.course_name = 'statistics' order by t2.date_of_attendance
|
Question: list the id of students who attended statistics courses in the order of attendance date. | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
|
list the id of students who attended statistics courses in the order of attendance date.
|
student_assessment
|
select t2.student_id from courses as t1 join student_course_attendance as t2 on t1.course_id = t2.course_id where t1.course_name = 'statistics' order by t2.date_of_attendance
|
Question: what are the ids of the students who attended courses in the statistics department in order of attendance date. | Tables: Addresses -> address_id, line_1, line_2, city, zip_postcode, state_province_county, country. People -> person_id, first_name, middle_name, last_name, cell_mobile_number, email_address, login_name, password. Students -> student_id, student_details. Courses -> course_id, course_name, course_description, other_details. People_Addresses -> person_address_id, person_id, address_id, date_from, date_to. Student_Course_Registrations -> student_id, course_id, registration_date. Student_Course_Attendance -> student_id, course_id, date_of_attendance. Candidates -> candidate_id, candidate_details. Candidate_Assessments -> candidate_id, qualification, assessment_date, asessment_outcome_code. | Joins: Students.student_id = People.person_id, People_Addresses.address_id = Addresses.address_id, People_Addresses.person_id = People.person_id, Student_Course_Registrations.course_id = Courses.course_id, Student_Course_Registrations.student_id = Students.student_id, Student_Course_Attendance.student_id = Student_Course_Registrations.student_id, Student_Course_Attendance.course_id = Student_Course_Registrations.course_id, Candidates.candidate_id = People.person_id, Candidate_Assessments.candidate_id = Candidates.candidate_id,
|
what are the ids of the students who attended courses in the statistics department in order of attendance date.
|
bike_1
|
select date from weather where max_temperature_f > 85
|
Question: give me the dates when the max temperature was higher than 85. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
give me the dates when the max temperature was higher than 85.
|
bike_1
|
select date from weather where max_temperature_f > 85
|
Question: what are the dates with a maximum temperature higher than 85? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the dates with a maximum temperature higher than 85?
|
bike_1
|
select name from station where lat < 37.5
|
Question: what are the names of stations that have latitude lower than 37.5? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the names of stations that have latitude lower than 37.5?
|
bike_1
|
select name from station where lat < 37.5
|
Question: what are the names of all stations with a latitude smaller than 37.5? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the names of all stations with a latitude smaller than 37.5?
|
bike_1
|
select city , max(lat) from station group by city
|
Question: for each city, return the highest latitude among its stations. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each city, return the highest latitude among its stations.
|
bike_1
|
select city , max(lat) from station group by city
|
Question: for each city, what is the highest latitude for its stations? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each city, what is the highest latitude for its stations?
|
bike_1
|
select start_station_name , end_station_name from trip order by id limit 3
|
Question: give me the start station and end station for the trips with the three oldest id. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
give me the start station and end station for the trips with the three oldest id.
|
bike_1
|
select start_station_name , end_station_name from trip order by id limit 3
|
Question: what is the station station and end station for the trips with the three smallest ids? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the station station and end station for the trips with the three smallest ids?
|
bike_1
|
select avg(lat) , avg(long) from station where city = 'san jose'
|
Question: what is the average latitude and longitude of stations located in san jose city? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the average latitude and longitude of stations located in san jose city?
|
bike_1
|
select avg(lat) , avg(long) from station where city = 'san jose'
|
Question: what is the average latitude and longitude in san jose? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the average latitude and longitude in san jose?
|
bike_1
|
select id from trip order by duration limit 1
|
Question: what is the id of the trip that has the shortest duration? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the id of the trip that has the shortest duration?
|
bike_1
|
select id from trip order by duration limit 1
|
Question: what is the id of the shortest trip? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the id of the shortest trip?
|
bike_1
|
select sum(duration) , max(duration) from trip where bike_id = 636
|
Question: what is the total and maximum duration of trips with bike id 636? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the total and maximum duration of trips with bike id 636?
|
bike_1
|
select sum(duration) , max(duration) from trip where bike_id = 636
|
Question: what is the total and maximum duration for all trips with the bike id 636? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the total and maximum duration for all trips with the bike id 636?
|
bike_1
|
select zip_code , avg(mean_temperature_f) from weather where date like '8/%' group by zip_code
|
Question: for each zip code, return the average mean temperature of august there. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each zip code, return the average mean temperature of august there.
|
bike_1
|
select zip_code , avg(mean_temperature_f) from weather where date like '8/%' group by zip_code
|
Question: for each zip code, what is the average mean temperature for all dates that start with '8'? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each zip code, what is the average mean temperature for all dates that start with '8'?
|
bike_1
|
select count(distinct bike_id) from trip
|
Question: from the trip record, find the number of unique bikes. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
from the trip record, find the number of unique bikes.
|
bike_1
|
select count(distinct bike_id) from trip
|
Question: how many different bike ids are there? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
how many different bike ids are there?
|
bike_1
|
select count(distinct city) from station
|
Question: what is the number of distinct cities the stations are located at? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the number of distinct cities the stations are located at?
|
bike_1
|
select count(distinct city) from station
|
Question: how many different cities have these stations? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
how many different cities have these stations?
|
bike_1
|
select count(*) from station where city = 'mountain view'
|
Question: how many stations does mountain view city has? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
how many stations does mountain view city has?
|
bike_1
|
select count(*) from station where city = 'mountain view'
|
Question: how many stations are in mountain view? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
how many stations are in mountain view?
|
bike_1
|
select distinct t1.name from station as t1 join status as t2 on t1.id = t2.station_id where t2.bikes_available = 7
|
Question: return the unique name for stations that have ever had 7 bikes available. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
return the unique name for stations that have ever had 7 bikes available.
|
bike_1
|
select distinct t1.name from station as t1 join status as t2 on t1.id = t2.station_id where t2.bikes_available = 7
|
Question: what are the different names for each station that has ever had 7 bikes available? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the different names for each station that has ever had 7 bikes available?
|
bike_1
|
select start_station_name , start_station_id from trip where start_date like '8/%' group by start_station_name order by count(*) desc limit 1
|
Question: which start station had the most trips starting from august? give me the name and id of the station. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
which start station had the most trips starting from august? give me the name and id of the station.
|
bike_1
|
select start_station_name , start_station_id from trip where start_date like '8/%' group by start_station_name order by count(*) desc limit 1
|
Question: what are the start station's name and id for the one that had the most start trips in august? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the start station's name and id for the one that had the most start trips in august?
|
bike_1
|
select bike_id from trip where zip_code = 94002 group by bike_id order by count(*) desc limit 1
|
Question: which bike traveled the most often in zip code 94002? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
which bike traveled the most often in zip code 94002?
|
bike_1
|
select bike_id from trip where zip_code = 94002 group by bike_id order by count(*) desc limit 1
|
Question: what is the id of the bike that traveled the most in 94002? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the id of the bike that traveled the most in 94002?
|
bike_1
|
select count(*) from weather where mean_humidity > 50 and mean_visibility_miles > 8
|
Question: how many days had both mean humidity above 50 and mean visibility above 8? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
how many days had both mean humidity above 50 and mean visibility above 8?
|
bike_1
|
select count(*) from weather where mean_humidity > 50 and mean_visibility_miles > 8
|
Question: what is the number of days that had an average humity above 50 and an average visibility above 8? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the number of days that had an average humity above 50 and an average visibility above 8?
|
bike_1
|
select t1.lat , t1.long , t1.city from station as t1 join trip as t2 on t1.id = t2.start_station_id order by t2.duration limit 1
|
Question: what is the latitude, longitude, city of the station from which the shortest trip started? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the latitude, longitude, city of the station from which the shortest trip started?
|
bike_1
|
select t1.lat , t1.long , t1.city from station as t1 join trip as t2 on t1.id = t2.start_station_id order by t2.duration limit 1
|
Question: what is the latitude, longitude, and city of the station from which the trip with smallest duration started? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the latitude, longitude, and city of the station from which the trip with smallest duration started?
|
bike_1
|
select id from station where city = 'san francisco' intersect select station_id from status group by station_id having avg(bikes_available) > 10
|
Question: what are the ids of stations that are located in san francisco and have average bike availability above 10. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the ids of stations that are located in san francisco and have average bike availability above 10.
|
bike_1
|
select id from station where city = 'san francisco' intersect select station_id from status group by station_id having avg(bikes_available) > 10
|
Question: what are the ids of the stations in san francisco that normally have more than 10 bikes available? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the ids of the stations in san francisco that normally have more than 10 bikes available?
|
bike_1
|
select t1.name , t1.id from station as t1 join status as t2 on t1.id = t2.station_id group by t2.station_id having avg(t2.bikes_available) > 14 union select name , id from station where installation_date like '12/%'
|
Question: what are the names and ids of stations that had more than 14 bikes available on average or were installed in december? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the names and ids of stations that had more than 14 bikes available on average or were installed in december?
|
bike_1
|
select t1.name , t1.id from station as t1 join status as t2 on t1.id = t2.station_id group by t2.station_id having avg(t2.bikes_available) > 14 union select name , id from station where installation_date like '12/%'
|
Question: what are the names and ids of all stations that have more than 14 bikes available on average or had bikes installed in december? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the names and ids of all stations that have more than 14 bikes available on average or had bikes installed in december?
|
bike_1
|
select cloud_cover from weather where zip_code = 94107 group by cloud_cover order by count (*) desc limit 3
|
Question: what is the 3 most common cloud cover rates in the region of zip code 94107? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the 3 most common cloud cover rates in the region of zip code 94107?
|
bike_1
|
select cloud_cover from weather where zip_code = 94107 group by cloud_cover order by count (*) desc limit 3
|
Question: what are the 3 most common cloud covers in the zip code of 94107? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the 3 most common cloud covers in the zip code of 94107?
|
bike_1
|
select zip_code from weather group by zip_code order by avg(mean_sea_level_pressure_inches) limit 1
|
Question: what is the zip code in which the average mean sea level pressure is the lowest? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the zip code in which the average mean sea level pressure is the lowest?
|
bike_1
|
select zip_code from weather group by zip_code order by avg(mean_sea_level_pressure_inches) limit 1
|
Question: what is the zip code that has the lowest average mean sea level pressure? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the zip code that has the lowest average mean sea level pressure?
|
bike_1
|
select avg(bikes_available) from status where station_id not in (select id from station where city = 'palo alto')
|
Question: what is the average bike availability in stations that are not located in palo alto? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the average bike availability in stations that are not located in palo alto?
|
bike_1
|
select avg(bikes_available) from status where station_id not in (select id from station where city = 'palo alto')
|
Question: what is the average bike availablility for stations not in palo alto? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the average bike availablility for stations not in palo alto?
|
bike_1
|
select avg(long) from station where id not in (select station_id from status group by station_id having max(bikes_available) > 10)
|
Question: what is the average longitude of stations that never had bike availability more than 10? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the average longitude of stations that never had bike availability more than 10?
|
bike_1
|
select avg(long) from station where id not in (select station_id from status group by station_id having max(bikes_available) > 10)
|
Question: what is the mean longitude for all stations that have never had more than 10 bikes available? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the mean longitude for all stations that have never had more than 10 bikes available?
|
bike_1
|
select date , zip_code from weather where max_temperature_f >= 80
|
Question: when and in what zip code did max temperature reach 80? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
when and in what zip code did max temperature reach 80?
|
bike_1
|
select date , zip_code from weather where max_temperature_f >= 80
|
Question: what zip codes have a station with a max temperature greater than or equal to 80 and when did it reach that temperature? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what zip codes have a station with a max temperature greater than or equal to 80 and when did it reach that temperature?
|
bike_1
|
select t1.id from trip as t1 join weather as t2 on t1.zip_code = t2.zip_code group by t2.zip_code having avg(t2.mean_temperature_f) > 60
|
Question: give me ids for all the trip that took place in a zip code area with average mean temperature above 60. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
give me ids for all the trip that took place in a zip code area with average mean temperature above 60.
|
bike_1
|
select t1.id from trip as t1 join weather as t2 on t1.zip_code = t2.zip_code group by t2.zip_code having avg(t2.mean_temperature_f) > 60
|
Question: for each zip code, find the ids of all trips that have a higher average mean temperature above 60? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each zip code, find the ids of all trips that have a higher average mean temperature above 60?
|
bike_1
|
select zip_code , count(*) from weather where max_wind_speed_mph >= 25 group by zip_code
|
Question: for each zip code, return how many times max wind speed reached 25? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each zip code, return how many times max wind speed reached 25?
|
bike_1
|
select zip_code , count(*) from weather where max_wind_speed_mph >= 25 group by zip_code
|
Question: for each zip code, how many times has the maximum wind speed reached 25 mph? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each zip code, how many times has the maximum wind speed reached 25 mph?
|
bike_1
|
select date , zip_code from weather where min_dew_point_f < (select min(min_dew_point_f) from weather where zip_code = 94107)
|
Question: on which day and in which zip code was the min dew point lower than any day in zip code 94107? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
on which day and in which zip code was the min dew point lower than any day in zip code 94107?
|
bike_1
|
select date , zip_code from weather where min_dew_point_f < (select min(min_dew_point_f) from weather where zip_code = 94107)
|
Question: which days had a minimum dew point smaller than any day in zip code 94107, and in which zip codes were those measurements taken? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
which days had a minimum dew point smaller than any day in zip code 94107, and in which zip codes were those measurements taken?
|
bike_1
|
select t1.id , t2.installation_date from trip as t1 join station as t2 on t1.end_station_id = t2.id
|
Question: for each trip, return its ending station's installation date. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each trip, return its ending station's installation date.
|
bike_1
|
select t1.id , t2.installation_date from trip as t1 join station as t2 on t1.end_station_id = t2.id
|
Question: what is the installation date for each ending station on all the trips? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the installation date for each ending station on all the trips?
|
bike_1
|
select t1.id from trip as t1 join station as t2 on t1.start_station_id = t2.id order by t2.dock_count desc limit 1
|
Question: which trip started from the station with the largest dock count? give me the trip id. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
which trip started from the station with the largest dock count? give me the trip id.
|
bike_1
|
select t1.id from trip as t1 join station as t2 on t1.start_station_id = t2.id order by t2.dock_count desc limit 1
|
Question: what is the id of the trip that started from the station with the highest dock count? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the id of the trip that started from the station with the highest dock count?
|
bike_1
|
select count(*) from trip as t1 join station as t2 on t1.end_station_id = t2.id where t2.city != 'san francisco'
|
Question: count the number of trips that did not end in san francisco city. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
count the number of trips that did not end in san francisco city.
|
bike_1
|
select count(*) from trip as t1 join station as t2 on t1.end_station_id = t2.id where t2.city != 'san francisco'
|
Question: how many trips did not end in san francisco? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
how many trips did not end in san francisco?
|
bike_1
|
select date from weather where zip_code = 94107 and events != 'fog' and events != 'rain'
|
Question: in zip code 94107, on which day neither fog nor rain was not observed? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
in zip code 94107, on which day neither fog nor rain was not observed?
|
bike_1
|
select date from weather where zip_code = 94107 and events != 'fog' and events != 'rain'
|
Question: on which day has it neither been foggy nor rained in the zip code of 94107? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
on which day has it neither been foggy nor rained in the zip code of 94107?
|
bike_1
|
select id from station where lat > 37.4 except select station_id from status group by station_id having min(bikes_available) < 7
|
Question: what are the ids of stations that have latitude above 37.4 and never had bike availability below 7? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the ids of stations that have latitude above 37.4 and never had bike availability below 7?
|
bike_1
|
select id from station where lat > 37.4 except select station_id from status group by station_id having min(bikes_available) < 7
|
Question: what are the ids of all stations that have a latitude above 37.4 and have never had less than 7 bikes available? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the ids of all stations that have a latitude above 37.4 and have never had less than 7 bikes available?
|
bike_1
|
select t1.name from station as t1 join status as t2 on t1.id = t2.station_id group by t2.station_id having avg(bikes_available) > 10 except select name from station where city = 'san jose'
|
Question: what are names of stations that have average bike availability above 10 and are not located in san jose city? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are names of stations that have average bike availability above 10 and are not located in san jose city?
|
bike_1
|
select t1.name from station as t1 join status as t2 on t1.id = t2.station_id group by t2.station_id having avg(bikes_available) > 10 except select name from station where city = 'san jose'
|
Question: what are the names of all stations that have more than 10 bikes available and are not located in san jose? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the names of all stations that have more than 10 bikes available and are not located in san jose?
|
bike_1
|
select name , lat , city from station order by lat limit 1
|
Question: what are the name, latitude, and city of the station with the lowest latitude? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the name, latitude, and city of the station with the lowest latitude?
|
bike_1
|
select name , lat , city from station order by lat limit 1
|
Question: what is the name, latitude, and city of the station that is located the furthest south? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the name, latitude, and city of the station that is located the furthest south?
|
bike_1
|
select date , mean_temperature_f , mean_humidity from weather order by max_gust_speed_mph desc limit 3
|
Question: what are the date, mean temperature and mean humidity for the top 3 days with the largest max gust speeds? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the date, mean temperature and mean humidity for the top 3 days with the largest max gust speeds?
|
bike_1
|
select date , mean_temperature_f , mean_humidity from weather order by max_gust_speed_mph desc limit 3
|
Question: what is the date, average temperature and mean humidity for the days with the 3 largest maximum gust speeds? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the date, average temperature and mean humidity for the days with the 3 largest maximum gust speeds?
|
bike_1
|
select city , count(*) from station group by city having count(*) >= 15
|
Question: list the name and the number of stations for all the cities that have at least 15 stations. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
list the name and the number of stations for all the cities that have at least 15 stations.
|
bike_1
|
select city , count(*) from station group by city having count(*) >= 15
|
Question: what is the name of every city that has at least 15 stations and how many stations does it have? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what is the name of every city that has at least 15 stations and how many stations does it have?
|
bike_1
|
select start_station_id , start_station_name from trip group by start_station_name having count(*) >= 200
|
Question: find the ids and names of stations from which at least 200 trips started. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
find the ids and names of stations from which at least 200 trips started.
|
bike_1
|
select start_station_id , start_station_name from trip group by start_station_name having count(*) >= 200
|
Question: what are the ids and names of all start stations that were the beginning of at least 200 trips? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the ids and names of all start stations that were the beginning of at least 200 trips?
|
bike_1
|
select zip_code from weather group by zip_code having avg(mean_visibility_miles) < 10
|
Question: find the zip code in which the average mean visibility is lower than 10. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
find the zip code in which the average mean visibility is lower than 10.
|
bike_1
|
select zip_code from weather group by zip_code having avg(mean_visibility_miles) < 10
|
Question: for each zip code, select all those that have an average mean visiblity below 10. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each zip code, select all those that have an average mean visiblity below 10.
|
bike_1
|
select city from station group by city order by max(lat) desc
|
Question: list all the cities in a decreasing order of each city's stations' highest latitude. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
list all the cities in a decreasing order of each city's stations' highest latitude.
|
bike_1
|
select city from station group by city order by max(lat) desc
|
Question: for each city, list their names in decreasing order by their highest station latitude. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each city, list their names in decreasing order by their highest station latitude.
|
bike_1
|
select date , cloud_cover from weather order by cloud_cover desc limit 5
|
Question: what are the dates that had the top 5 cloud cover rates? also tell me the cloud cover rate. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the dates that had the top 5 cloud cover rates? also tell me the cloud cover rate.
|
bike_1
|
select date , cloud_cover from weather order by cloud_cover desc limit 5
|
Question: what are the dates that have the 5 highest cloud cover rates and what are the rates? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the dates that have the 5 highest cloud cover rates and what are the rates?
|
bike_1
|
select id , duration from trip order by duration desc limit 3
|
Question: what are the ids and durations of the trips with the top 3 durations? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the ids and durations of the trips with the top 3 durations?
|
bike_1
|
select id , duration from trip order by duration desc limit 3
|
Question: what are the ids of the trips that lasted the longest and how long did they last? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the ids of the trips that lasted the longest and how long did they last?
|
bike_1
|
select t1.name , t1.long , avg(t2.duration) from station as t1 join trip as t2 on t1.id = t2.start_station_id group by t2.start_station_id
|
Question: for each station, return its longitude and the average duration of trips that started from the station. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each station, return its longitude and the average duration of trips that started from the station.
|
bike_1
|
select t1.name , t1.long , avg(t2.duration) from station as t1 join trip as t2 on t1.id = t2.start_station_id group by t2.start_station_id
|
Question: for each start station id, what is its name, longitude and average duration of trips started there? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each start station id, what is its name, longitude and average duration of trips started there?
|
bike_1
|
select t1.name , t1.lat , min(t2.duration) from station as t1 join trip as t2 on t1.id = t2.end_station_id group by t2.end_station_id
|
Question: for each station, find its latitude and the minimum duration of trips that ended at the station. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each station, find its latitude and the minimum duration of trips that ended at the station.
|
bike_1
|
select t1.name , t1.lat , min(t2.duration) from station as t1 join trip as t2 on t1.id = t2.end_station_id group by t2.end_station_id
|
Question: for each end station id, what is its name, latitude, and minimum duration for trips ended there? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
for each end station id, what is its name, latitude, and minimum duration for trips ended there?
|
bike_1
|
select distinct start_station_name from trip where duration < 100
|
Question: list all the distinct stations from which a trip of duration below 100 started. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
list all the distinct stations from which a trip of duration below 100 started.
|
bike_1
|
select distinct start_station_name from trip where duration < 100
|
Question: what are all the different start station names for a trip that lasted less than 100? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are all the different start station names for a trip that lasted less than 100?
|
bike_1
|
select distinct zip_code from weather except select distinct zip_code from weather where max_dew_point_f >= 70
|
Question: find all the zip codes in which the max dew point have never reached 70. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
find all the zip codes in which the max dew point have never reached 70.
|
bike_1
|
select distinct zip_code from weather except select distinct zip_code from weather where max_dew_point_f >= 70
|
Question: what are all the different zip codes that have a maximum dew point that was always below 70? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are all the different zip codes that have a maximum dew point that was always below 70?
|
bike_1
|
select id from trip where duration >= (select avg(duration) from trip where zip_code = 94103)
|
Question: find the id for the trips that lasted at least as long as the average duration of trips in zip code 94103. | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
find the id for the trips that lasted at least as long as the average duration of trips in zip code 94103.
|
bike_1
|
select id from trip where duration >= (select avg(duration) from trip where zip_code = 94103)
|
Question: what are the ids of all trips that had a duration as long as the average trip duration in the zip code 94103? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the ids of all trips that had a duration as long as the average trip duration in the zip code 94103?
|
bike_1
|
select date from weather where mean_sea_level_pressure_inches between 30.3 and 31
|
Question: what are the dates in which the mean sea level pressure was between 30.3 and 31? | Tables: station -> id, name, lat, long, dock_count, city, installation_date. status -> station_id, bikes_available, docks_available, time. trip -> id, duration, start_date, start_station_name, start_station_id, end_date, end_station_name, end_station_id, bike_id, subscription_type, zip_code. weather -> date, max_temperature_f, mean_temperature_f, min_temperature_f, max_dew_point_f, mean_dew_point_f, min_dew_point_f, max_humidity, mean_humidity, min_humidity, max_sea_level_pressure_inches, mean_sea_level_pressure_inches, min_sea_level_pressure_inches, max_visibility_miles, mean_visibility_miles, min_visibility_miles, max_wind_Speed_mph, mean_wind_speed_mph, max_gust_speed_mph, precipitation_inches, cloud_cover, events, wind_dir_degrees, zip_code. | Joins: status.station_id = station.id,
|
what are the dates in which the mean sea level pressure was between 30.3 and 31?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.