messages
listlengths
3
3
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# addresses ( address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country )\n# people ( person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password )\n# students ( student_id , student_details )\n# courses ( course_id , course_name , course_description , other_details )\n# people_addresses ( person_address_id , person_id , address_id , date_from , date_to )\n# student_course_registrations ( student_id , course_id , registration_date )\n# student_course_attendance ( student_id , course_id , date_of_attendance )\n# candidates ( candidate_id , candidate_details )\n# candidate_assessments ( candidate_id , qualification , assessment_date , asessment_outcome_code )\n# students.student_id = people.person_id\n# people_addresses.address_id = addresses.address_id\n# people_addresses.person_id = people.person_id\n# student_course_registrations.course_id = courses.course_id\n# student_course_registrations.student_id = students.student_id\n# student_course_attendance.student_id = student_course_registrations.student_id\n# student_course_attendance.course_id = student_course_registrations.course_id\n# candidates.candidate_id = people.person_id\n# candidate_assessments.candidate_id = candidates.candidate_id\n\n#\n### What are the ids of the students who either registered or attended a course?\nSELECT \n" }, { "role": "assistant", "content": "student_id from student_course_registrations union select student_id from student_course_attendance" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# addresses ( address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country )\n# people ( person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password )\n# students ( student_id , student_details )\n# courses ( course_id , course_name , course_description , other_details )\n# people_addresses ( person_address_id , person_id , address_id , date_from , date_to )\n# student_course_registrations ( student_id , course_id , registration_date )\n# student_course_attendance ( student_id , course_id , date_of_attendance )\n# candidates ( candidate_id , candidate_details )\n# candidate_assessments ( candidate_id , qualification , assessment_date , asessment_outcome_code )\n# students.student_id = people.person_id\n# people_addresses.address_id = addresses.address_id\n# people_addresses.person_id = people.person_id\n# student_course_registrations.course_id = courses.course_id\n# student_course_registrations.student_id = students.student_id\n# student_course_attendance.student_id = student_course_registrations.student_id\n# student_course_attendance.course_id = student_course_registrations.course_id\n# candidates.candidate_id = people.person_id\n# candidate_assessments.candidate_id = candidates.candidate_id\n\n#\n### Find the id of courses which are registered or attended by student whose id is 121?\nSELECT \n" }, { "role": "assistant", "content": "course_id from student_course_registrations where student_id = 121 union select course_id from student_course_attendance where student_id = 121" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# addresses ( address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country )\n# people ( person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password )\n# students ( student_id , student_details )\n# courses ( course_id , course_name , course_description , other_details )\n# people_addresses ( person_address_id , person_id , address_id , date_from , date_to )\n# student_course_registrations ( student_id , course_id , registration_date )\n# student_course_attendance ( student_id , course_id , date_of_attendance )\n# candidates ( candidate_id , candidate_details )\n# candidate_assessments ( candidate_id , qualification , assessment_date , asessment_outcome_code )\n# students.student_id = people.person_id\n# people_addresses.address_id = addresses.address_id\n# people_addresses.person_id = people.person_id\n# student_course_registrations.course_id = courses.course_id\n# student_course_registrations.student_id = students.student_id\n# student_course_attendance.student_id = student_course_registrations.student_id\n# student_course_attendance.course_id = student_course_registrations.course_id\n# candidates.candidate_id = people.person_id\n# candidate_assessments.candidate_id = candidates.candidate_id\n\n#\n### What are the ids of the courses that are registered or attended by the student whose id is 121?\nSELECT \n" }, { "role": "assistant", "content": "course_id from student_course_registrations where student_id = 121 union select course_id from student_course_attendance where student_id = 121" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# addresses ( address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country )\n# people ( person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password )\n# students ( student_id , student_details )\n# courses ( course_id , course_name , course_description , other_details )\n# people_addresses ( person_address_id , person_id , address_id , date_from , date_to )\n# student_course_registrations ( student_id , course_id , registration_date )\n# student_course_attendance ( student_id , course_id , date_of_attendance )\n# candidates ( candidate_id , candidate_details )\n# candidate_assessments ( candidate_id , qualification , assessment_date , asessment_outcome_code )\n# students.student_id = people.person_id\n# people_addresses.address_id = addresses.address_id\n# people_addresses.person_id = people.person_id\n# student_course_registrations.course_id = courses.course_id\n# student_course_registrations.student_id = students.student_id\n# student_course_attendance.student_id = student_course_registrations.student_id\n# student_course_attendance.course_id = student_course_registrations.course_id\n# candidates.candidate_id = people.person_id\n# candidate_assessments.candidate_id = candidates.candidate_id\n\n#\n### What are all info of students who registered courses but not attended courses?\nSELECT \n" }, { "role": "assistant", "content": "* from student_course_registrations where student_id not in ( select student_id from student_course_attendance )" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# addresses ( address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country )\n# people ( person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password )\n# students ( student_id , student_details )\n# courses ( course_id , course_name , course_description , other_details )\n# people_addresses ( person_address_id , person_id , address_id , date_from , date_to )\n# student_course_registrations ( student_id , course_id , registration_date )\n# student_course_attendance ( student_id , course_id , date_of_attendance )\n# candidates ( candidate_id , candidate_details )\n# candidate_assessments ( candidate_id , qualification , assessment_date , asessment_outcome_code )\n# students.student_id = people.person_id\n# people_addresses.address_id = addresses.address_id\n# people_addresses.person_id = people.person_id\n# student_course_registrations.course_id = courses.course_id\n# student_course_registrations.student_id = students.student_id\n# student_course_attendance.student_id = student_course_registrations.student_id\n# student_course_attendance.course_id = student_course_registrations.course_id\n# candidates.candidate_id = people.person_id\n# candidate_assessments.candidate_id = candidates.candidate_id\n\n#\n### What are all details of the students who registered but did not attend any course?\nSELECT \n" }, { "role": "assistant", "content": "* from student_course_registrations where student_id not in ( select student_id from student_course_attendance )" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# addresses ( address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country )\n# people ( person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password )\n# students ( student_id , student_details )\n# courses ( course_id , course_name , course_description , other_details )\n# people_addresses ( person_address_id , person_id , address_id , date_from , date_to )\n# student_course_registrations ( student_id , course_id , registration_date )\n# student_course_attendance ( student_id , course_id , date_of_attendance )\n# candidates ( candidate_id , candidate_details )\n# candidate_assessments ( candidate_id , qualification , assessment_date , asessment_outcome_code )\n# students.student_id = people.person_id\n# people_addresses.address_id = addresses.address_id\n# people_addresses.person_id = people.person_id\n# student_course_registrations.course_id = courses.course_id\n# student_course_registrations.student_id = students.student_id\n# student_course_attendance.student_id = student_course_registrations.student_id\n# student_course_attendance.course_id = student_course_registrations.course_id\n# candidates.candidate_id = people.person_id\n# candidate_assessments.candidate_id = candidates.candidate_id\n\n#\n### List the id of students who registered course statistics in the order of registration date.\nSELECT \n" }, { "role": "assistant", "content": "student_course_registrations.student_id from courses join student_course_registrations on courses.course_id = student_course_registrations.course_id where courses.course_name = 'statistics' order by student_course_registrations.registration_date asc" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# addresses ( address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country )\n# people ( person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password )\n# students ( student_id , student_details )\n# courses ( course_id , course_name , course_description , other_details )\n# people_addresses ( person_address_id , person_id , address_id , date_from , date_to )\n# student_course_registrations ( student_id , course_id , registration_date )\n# student_course_attendance ( student_id , course_id , date_of_attendance )\n# candidates ( candidate_id , candidate_details )\n# candidate_assessments ( candidate_id , qualification , assessment_date , asessment_outcome_code )\n# students.student_id = people.person_id\n# people_addresses.address_id = addresses.address_id\n# people_addresses.person_id = people.person_id\n# student_course_registrations.course_id = courses.course_id\n# student_course_registrations.student_id = students.student_id\n# student_course_attendance.student_id = student_course_registrations.student_id\n# student_course_attendance.course_id = student_course_registrations.course_id\n# candidates.candidate_id = people.person_id\n# candidate_assessments.candidate_id = candidates.candidate_id\n\n#\n### What are the ids of the students who registered course statistics by order of registration date?\nSELECT \n" }, { "role": "assistant", "content": "student_course_registrations.student_id from courses join student_course_registrations on courses.course_id = student_course_registrations.course_id where courses.course_name = 'statistics' order by student_course_registrations.registration_date asc" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# addresses ( address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country )\n# people ( person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password )\n# students ( student_id , student_details )\n# courses ( course_id , course_name , course_description , other_details )\n# people_addresses ( person_address_id , person_id , address_id , date_from , date_to )\n# student_course_registrations ( student_id , course_id , registration_date )\n# student_course_attendance ( student_id , course_id , date_of_attendance )\n# candidates ( candidate_id , candidate_details )\n# candidate_assessments ( candidate_id , qualification , assessment_date , asessment_outcome_code )\n# students.student_id = people.person_id\n# people_addresses.address_id = addresses.address_id\n# people_addresses.person_id = people.person_id\n# student_course_registrations.course_id = courses.course_id\n# student_course_registrations.student_id = students.student_id\n# student_course_attendance.student_id = student_course_registrations.student_id\n# student_course_attendance.course_id = student_course_registrations.course_id\n# candidates.candidate_id = people.person_id\n# candidate_assessments.candidate_id = candidates.candidate_id\n\n#\n### List the id of students who attended statistics courses in the order of attendance date.\nSELECT \n" }, { "role": "assistant", "content": "student_course_attendance.student_id from courses join student_course_attendance on courses.course_id = student_course_attendance.course_id where courses.course_name = 'statistics' order by student_course_attendance.date_of_attendance asc" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# addresses ( address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country )\n# people ( person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password )\n# students ( student_id , student_details )\n# courses ( course_id , course_name , course_description , other_details )\n# people_addresses ( person_address_id , person_id , address_id , date_from , date_to )\n# student_course_registrations ( student_id , course_id , registration_date )\n# student_course_attendance ( student_id , course_id , date_of_attendance )\n# candidates ( candidate_id , candidate_details )\n# candidate_assessments ( candidate_id , qualification , assessment_date , asessment_outcome_code )\n# students.student_id = people.person_id\n# people_addresses.address_id = addresses.address_id\n# people_addresses.person_id = people.person_id\n# student_course_registrations.course_id = courses.course_id\n# student_course_registrations.student_id = students.student_id\n# student_course_attendance.student_id = student_course_registrations.student_id\n# student_course_attendance.course_id = student_course_registrations.course_id\n# candidates.candidate_id = people.person_id\n# candidate_assessments.candidate_id = candidates.candidate_id\n\n#\n### What are the ids of the students who attended courses in the statistics department in order of attendance date.\nSELECT \n" }, { "role": "assistant", "content": "student_course_attendance.student_id from courses join student_course_attendance on courses.course_id = student_course_attendance.course_id where courses.course_name = 'statistics' order by student_course_attendance.date_of_attendance asc" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Give me the dates when the max temperature was higher than 85.\nSELECT \n" }, { "role": "assistant", "content": "date from weather where max_temperature_f > 85" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the dates with a maximum temperature higher than 85?\nSELECT \n" }, { "role": "assistant", "content": "date from weather where max_temperature_f > 85" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the names of stations that have latitude lower than 37.5?\nSELECT \n" }, { "role": "assistant", "content": "name from station where lat < 37.5" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the names of all stations with a latitude smaller than 37.5?\nSELECT \n" }, { "role": "assistant", "content": "name from station where lat < 37.5" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each city, return the highest latitude among its stations.\nSELECT \n" }, { "role": "assistant", "content": "city , max ( lat ) from station group by city" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each city, what is the highest latitude for its stations?\nSELECT \n" }, { "role": "assistant", "content": "city , max ( lat ) from station group by city" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Give me the start station and end station for the trips with the three oldest id.\nSELECT \n" }, { "role": "assistant", "content": "start_station_name , end_station_name from trip order by id asc limit 3" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the station station and end station for the trips with the three smallest ids?\nSELECT \n" }, { "role": "assistant", "content": "start_station_name , end_station_name from trip order by id asc limit 3" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the average latitude and longitude of stations located in San Jose city?\nSELECT \n" }, { "role": "assistant", "content": "avg ( lat ) , avg ( long ) from station where city = 'San Jose'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the average latitude and longitude in San Jose?\nSELECT \n" }, { "role": "assistant", "content": "avg ( lat ) , avg ( long ) from station where city = 'San Jose'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the id of the trip that has the shortest duration?\nSELECT \n" }, { "role": "assistant", "content": "id from trip order by duration asc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the id of the shortest trip?\nSELECT \n" }, { "role": "assistant", "content": "id from trip order by duration asc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the total and maximum duration of trips with bike id 636?\nSELECT \n" }, { "role": "assistant", "content": "sum ( duration ) , max ( duration ) from trip where bike_id = 636" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the total and maximum duration for all trips with the bike id 636?\nSELECT \n" }, { "role": "assistant", "content": "sum ( duration ) , max ( duration ) from trip where bike_id = 636" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each zip code, return the average mean temperature of August there.\nSELECT \n" }, { "role": "assistant", "content": "zip_code , avg ( mean_temperature_f ) from weather where date like '8/%' group by zip_code" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each zip code, what is the average mean temperature for all dates that start with '8'?\nSELECT \n" }, { "role": "assistant", "content": "zip_code , avg ( mean_temperature_f ) from weather where date like '8/%' group by zip_code" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### From the trip record, find the number of unique bikes.\nSELECT \n" }, { "role": "assistant", "content": "count ( distinct bike_id ) from trip" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### How many different bike ids are there?\nSELECT \n" }, { "role": "assistant", "content": "count ( distinct bike_id ) from trip" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the number of distinct cities the stations are located at?\nSELECT \n" }, { "role": "assistant", "content": "count ( distinct city ) from station" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### How many different cities have these stations?\nSELECT \n" }, { "role": "assistant", "content": "count ( distinct city ) from station" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### How many stations does Mountain View city has?\nSELECT \n" }, { "role": "assistant", "content": "count ( * ) from station where city = 'Mountain View'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### How many stations are in Mountain View?\nSELECT \n" }, { "role": "assistant", "content": "count ( * ) from station where city = 'Mountain View'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Return the unique name for stations that have ever had 7 bikes available.\nSELECT \n" }, { "role": "assistant", "content": "distinct station.name from station join status on station.id = status.station_id where status.bikes_available = 7" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the different names for each station that has ever had 7 bikes available?\nSELECT \n" }, { "role": "assistant", "content": "distinct station.name from station join status on station.id = status.station_id where status.bikes_available = 7" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Which start station had the most trips starting from August? Give me the name and id of the station.\nSELECT \n" }, { "role": "assistant", "content": "start_station_name , start_station_id from trip where start_date like '8/%' group by start_station_name order by count ( * ) desc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the start station's name and id for the one that had the most start trips in August?\nSELECT \n" }, { "role": "assistant", "content": "start_station_name , start_station_id from trip where start_date like '8/%' group by start_station_name order by count ( * ) desc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Which bike traveled the most often in zip code 94002?\nSELECT \n" }, { "role": "assistant", "content": "bike_id from trip where zip_code = 94002 group by bike_id order by count ( * ) desc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the id of the bike that traveled the most in 94002?\nSELECT \n" }, { "role": "assistant", "content": "bike_id from trip where zip_code = 94002 group by bike_id order by count ( * ) desc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### How many days had both mean humidity above 50 and mean visibility above 8?\nSELECT \n" }, { "role": "assistant", "content": "count ( * ) from weather where mean_humidity > 50 and mean_visibility_miles > 8" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the number of days that had an average humity above 50 and an average visibility above 8?\nSELECT \n" }, { "role": "assistant", "content": "count ( * ) from weather where mean_humidity > 50 and mean_visibility_miles > 8" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the latitude, longitude, city of the station from which the shortest trip started?\nSELECT \n" }, { "role": "assistant", "content": "station.lat , station.long , station.city from station join trip on station.id = trip.start_station_id order by trip.duration asc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the latitude, longitude, and city of the station from which the trip with smallest duration started?\nSELECT \n" }, { "role": "assistant", "content": "station.lat , station.long , station.city from station join trip on station.id = trip.start_station_id order by trip.duration asc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the ids of stations that are located in San Francisco and have average bike availability above 10.\nSELECT \n" }, { "role": "assistant", "content": "id from station where city = 'San Francisco' intersect select station_id from status group by station_id having avg ( bikes_available ) > 10" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the ids of the stations in San Francisco that normally have more than 10 bikes available?\nSELECT \n" }, { "role": "assistant", "content": "id from station where city = 'San Francisco' intersect select station_id from status group by station_id having avg ( bikes_available ) > 10" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the names and ids of stations that had more than 14 bikes available on average or were installed in December?\nSELECT \n" }, { "role": "assistant", "content": "station.name , station.id from station join status on station.id = status.station_id group by status.station_id having avg ( status.bikes_available ) > 14 union select name , id from station where installation_date like '12/%'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the names and ids of all stations that have more than 14 bikes available on average or had bikes installed in December?\nSELECT \n" }, { "role": "assistant", "content": "station.name , station.id from station join status on station.id = status.station_id group by status.station_id having avg ( status.bikes_available ) > 14 union select name , id from station where installation_date like '12/%'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the 3 most common cloud cover rates in the region of zip code 94107?\nSELECT \n" }, { "role": "assistant", "content": "cloud_cover from weather where zip_code = 94107 group by cloud_cover order by count ( * ) desc limit 3" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the 3 most common cloud covers in the zip code of 94107?\nSELECT \n" }, { "role": "assistant", "content": "cloud_cover from weather where zip_code = 94107 group by cloud_cover order by count ( * ) desc limit 3" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the zip code in which the average mean sea level pressure is the lowest?\nSELECT \n" }, { "role": "assistant", "content": "zip_code from weather group by zip_code order by avg ( mean_sea_level_pressure_inches ) asc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the zip code that has the lowest average mean sea level pressure?\nSELECT \n" }, { "role": "assistant", "content": "zip_code from weather group by zip_code order by avg ( mean_sea_level_pressure_inches ) asc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the average bike availability in stations that are not located in Palo Alto?\nSELECT \n" }, { "role": "assistant", "content": "avg ( bikes_available ) from status where station_id not in ( select id from station where city = 'Palo Alto' )" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the average bike availablility for stations not in Palo Alto?\nSELECT \n" }, { "role": "assistant", "content": "avg ( bikes_available ) from status where station_id not in ( select id from station where city = 'Palo Alto' )" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the average longitude of stations that never had bike availability more than 10?\nSELECT \n" }, { "role": "assistant", "content": "avg ( long ) from station where id not in ( select station_id from status group by station_id having max ( bikes_available ) > 10 )" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the mean longitude for all stations that have never had more than 10 bikes available?\nSELECT \n" }, { "role": "assistant", "content": "avg ( long ) from station where id not in ( select station_id from status group by station_id having max ( bikes_available ) > 10 )" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### When and in what zip code did max temperature reach 80?\nSELECT \n" }, { "role": "assistant", "content": "date , zip_code from weather where max_temperature_f >= 80" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What zip codes have a station with a max temperature greater than or equal to 80 and when did it reach that temperature?\nSELECT \n" }, { "role": "assistant", "content": "date , zip_code from weather where max_temperature_f >= 80" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Give me ids for all the trip that took place in a zip code area with average mean temperature above 60.\nSELECT \n" }, { "role": "assistant", "content": "trip.id from trip join weather on trip.zip_code = weather.zip_code group by weather.zip_code having avg ( weather.mean_temperature_f ) > 60" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each zip code, find the ids of all trips that have a higher average mean temperature above 60?\nSELECT \n" }, { "role": "assistant", "content": "trip.id from trip join weather on trip.zip_code = weather.zip_code group by weather.zip_code having avg ( weather.mean_temperature_f ) > 60" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each zip code, return how many times max wind speed reached 25?\nSELECT \n" }, { "role": "assistant", "content": "zip_code , count ( * ) from weather where max_wind_speed_mph >= 25 group by zip_code" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each zip code, how many times has the maximum wind speed reached 25 mph?\nSELECT \n" }, { "role": "assistant", "content": "zip_code , count ( * ) from weather where max_wind_speed_mph >= 25 group by zip_code" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### On which day and in which zip code was the min dew point lower than any day in zip code 94107?\nSELECT \n" }, { "role": "assistant", "content": "date , zip_code from weather where min_dew_point_f < ( select min ( min_dew_point_f ) from weather where zip_code = 94107 )" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Which days had a minimum dew point smaller than any day in zip code 94107, and in which zip codes were those measurements taken?\nSELECT \n" }, { "role": "assistant", "content": "date , zip_code from weather where min_dew_point_f < ( select min ( min_dew_point_f ) from weather where zip_code = 94107 )" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each trip, return its ending station's installation date.\nSELECT \n" }, { "role": "assistant", "content": "trip.id , station.installation_date from trip join station on trip.end_station_id = station.id" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the installation date for each ending station on all the trips?\nSELECT \n" }, { "role": "assistant", "content": "trip.id , station.installation_date from trip join station on trip.end_station_id = station.id" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Which trip started from the station with the largest dock count? Give me the trip id.\nSELECT \n" }, { "role": "assistant", "content": "trip.id from trip join station on trip.start_station_id = station.id order by station.dock_count desc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the id of the trip that started from the station with the highest dock count?\nSELECT \n" }, { "role": "assistant", "content": "trip.id from trip join station on trip.start_station_id = station.id order by station.dock_count desc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Count the number of trips that did not end in San Francisco city.\nSELECT \n" }, { "role": "assistant", "content": "count ( * ) from trip join station on trip.end_station_id = station.id where station.city != 'San Francisco'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### How many trips did not end in San Francisco?\nSELECT \n" }, { "role": "assistant", "content": "count ( * ) from trip join station on trip.end_station_id = station.id where station.city != 'San Francisco'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### In zip code 94107, on which day neither Fog nor Rain was not observed?\nSELECT \n" }, { "role": "assistant", "content": "date from weather where zip_code = 94107 and events != 'Fog' and events != 'Rain'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### On which day has it neither been foggy nor rained in the zip code of 94107?\nSELECT \n" }, { "role": "assistant", "content": "date from weather where zip_code = 94107 and events != 'Fog' and events != 'Rain'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the ids of stations that have latitude above 37.4 and never had bike availability below 7?\nSELECT \n" }, { "role": "assistant", "content": "id from station where lat > 37.4 except select station_id from status group by station_id having min ( bikes_available ) < 7" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the ids of all stations that have a latitude above 37.4 and have never had less than 7 bikes available?\nSELECT \n" }, { "role": "assistant", "content": "id from station where lat > 37.4 except select station_id from status group by station_id having min ( bikes_available ) < 7" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are names of stations that have average bike availability above 10 and are not located in San Jose city?\nSELECT \n" }, { "role": "assistant", "content": "station.name from station join status on station.id = status.station_id group by status.station_id having avg ( bikes_available ) > 10 except select name from station where city = 'San Jose'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the names of all stations that have more than 10 bikes available and are not located in San Jose?\nSELECT \n" }, { "role": "assistant", "content": "station.name from station join status on station.id = status.station_id group by status.station_id having avg ( bikes_available ) > 10 except select name from station where city = 'San Jose'" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the name, latitude, and city of the station with the lowest latitude?\nSELECT \n" }, { "role": "assistant", "content": "name , lat , city from station order by lat asc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the name, latitude, and city of the station that is located the furthest South?\nSELECT \n" }, { "role": "assistant", "content": "name , lat , city from station order by lat asc limit 1" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the date, mean temperature and mean humidity for the top 3 days with the largest max gust speeds?\nSELECT \n" }, { "role": "assistant", "content": "date , mean_temperature_f , mean_humidity from weather order by max_gust_speed_mph desc limit 3" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the date, average temperature and mean humidity for the days with the 3 largest maximum gust speeds?\nSELECT \n" }, { "role": "assistant", "content": "date , mean_temperature_f , mean_humidity from weather order by max_gust_speed_mph desc limit 3" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### List the name and the number of stations for all the cities that have at least 15 stations.\nSELECT \n" }, { "role": "assistant", "content": "city , count ( * ) from station group by city having count ( * ) >= 15" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What is the name of every city that has at least 15 stations and how many stations does it have?\nSELECT \n" }, { "role": "assistant", "content": "city , count ( * ) from station group by city having count ( * ) >= 15" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Find the ids and names of stations from which at least 200 trips started.\nSELECT \n" }, { "role": "assistant", "content": "start_station_id , start_station_name from trip group by start_station_name having count ( * ) >= 200" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the ids and names of all start stations that were the beginning of at least 200 trips?\nSELECT \n" }, { "role": "assistant", "content": "start_station_id , start_station_name from trip group by start_station_name having count ( * ) >= 200" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Find the zip code in which the average mean visibility is lower than 10.\nSELECT \n" }, { "role": "assistant", "content": "zip_code from weather group by zip_code having avg ( mean_visibility_miles ) < 10" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each zip code, select all those that have an average mean visiblity below 10.\nSELECT \n" }, { "role": "assistant", "content": "zip_code from weather group by zip_code having avg ( mean_visibility_miles ) < 10" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### List all the cities in a decreasing order of each city's stations' highest latitude.\nSELECT \n" }, { "role": "assistant", "content": "city from station group by city order by max ( lat ) desc" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each city, list their names in decreasing order by their highest station latitude.\nSELECT \n" }, { "role": "assistant", "content": "city from station group by city order by max ( lat ) desc" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the dates that had the top 5 cloud cover rates? Also tell me the cloud cover rate.\nSELECT \n" }, { "role": "assistant", "content": "date , cloud_cover from weather order by cloud_cover desc limit 5" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the dates that have the 5 highest cloud cover rates and what are the rates?\nSELECT \n" }, { "role": "assistant", "content": "date , cloud_cover from weather order by cloud_cover desc limit 5" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the ids and durations of the trips with the top 3 durations?\nSELECT \n" }, { "role": "assistant", "content": "id , duration from trip order by duration desc limit 3" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the ids of the trips that lasted the longest and how long did they last?\nSELECT \n" }, { "role": "assistant", "content": "id , duration from trip order by duration desc limit 3" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each station, return its longitude and the average duration of trips that started from the station.\nSELECT \n" }, { "role": "assistant", "content": "station.name , station.long , avg ( trip.duration ) from station join trip on station.id = trip.start_station_id group by trip.start_station_id" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each start station id, what is its name, longitude and average duration of trips started there?\nSELECT \n" }, { "role": "assistant", "content": "station.name , station.long , avg ( trip.duration ) from station join trip on station.id = trip.start_station_id group by trip.start_station_id" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each station, find its latitude and the minimum duration of trips that ended at the station.\nSELECT \n" }, { "role": "assistant", "content": "station.name , station.lat , min ( trip.duration ) from station join trip on station.id = trip.end_station_id group by trip.end_station_id" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### For each end station id, what is its name, latitude, and minimum duration for trips ended there?\nSELECT \n" }, { "role": "assistant", "content": "station.name , station.lat , min ( trip.duration ) from station join trip on station.id = trip.end_station_id group by trip.end_station_id" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### List all the distinct stations from which a trip of duration below 100 started.\nSELECT \n" }, { "role": "assistant", "content": "distinct start_station_name from trip where duration < 100" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are all the different start station names for a trip that lasted less than 100?\nSELECT \n" }, { "role": "assistant", "content": "distinct start_station_name from trip where duration < 100" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Find all the zip codes in which the max dew point have never reached 70.\nSELECT \n" }, { "role": "assistant", "content": "distinct zip_code from weather except select distinct zip_code from weather where max_dew_point_f >= 70" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are all the different zip codes that have a maximum dew point that was always below 70?\nSELECT \n" }, { "role": "assistant", "content": "distinct zip_code from weather except select distinct zip_code from weather where max_dew_point_f >= 70" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### Find the id for the trips that lasted at least as long as the average duration of trips in zip code 94103.\nSELECT \n" }, { "role": "assistant", "content": "id from trip where duration >= ( select avg ( duration ) from trip where zip_code = 94103 )" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the ids of all trips that had a duration as long as the average trip duration in the zip code 94103?\nSELECT \n" }, { "role": "assistant", "content": "id from trip where duration >= ( select avg ( duration ) from trip where zip_code = 94103 )" } ]
[ { "role": "system", "content": "You are an excellent SQL writer." }, { "role": "user", "content": "### Complete sqlite SQL query only and with no explanation, and do not select extra columns that are not explicitly requested in the query.\n### Sqlite SQL tables, with their properties:\n#\n# station ( id , name , lat , long , dock_count , city , installation_date )\n# status ( station_id , bikes_available , docks_available , time )\n# 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 )\n# 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 )\n# status.station_id = station.id\n\n#\n### What are the dates in which the mean sea level pressure was between 30.3 and 31?\nSELECT \n" }, { "role": "assistant", "content": "date from weather where mean_sea_level_pressure_inches between 30.3 and 31" } ]