answer
stringlengths
18
552
context
stringlengths
30
393
question
stringlengths
5
73
SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance
CREATE TABLE student_course_registrations (student_id VARCHAR), CREATE TABLE student_course_attendance (student_id VARCHAR)
注册或参加课程的学生的ID是什么?
SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121
CREATE TABLE student_course_registrations (student_id VARCHAR, course_id VARCHAR), CREATE TABLE student_course_attendance (student_id VARCHAR, course_id VARCHAR)
查找ID为121的学生注册或参加的课程的ID?
SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121
CREATE TABLE student_course_registrations (student_id VARCHAR, course_id VARCHAR), CREATE TABLE student_course_attendance (student_id VARCHAR, course_id VARCHAR)
ID是121的学生所注册或参加的课程的ID是什么?
SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)
CREATE TABLE student_course_registrations (student_id VARCHAR), CREATE TABLE student_course_attendance (student_id VARCHAR)
注册课程但不参加课程的学生都有哪些信息?
SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)
CREATE TABLE student_course_registrations (student_id VARCHAR), CREATE TABLE student_course_attendance (student_id VARCHAR)
注册但没有参加任何课程的学生的详细情况是什么?
SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "统计学" ORDER BY T2.registration_date
CREATE TABLE courses (course_name VARCHAR, course_id VARCHAR), CREATE TABLE student_course_registrations (student_id VARCHAR, course_id VARCHAR, registration_date VARCHAR)
按照注册日期的顺序列出注册“统计学”课程的学生的ID。
SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "统计学" ORDER BY T2.registration_date
CREATE TABLE courses (course_name VARCHAR, course_id VARCHAR), CREATE TABLE student_course_registrations (student_id VARCHAR, course_id VARCHAR, registration_date VARCHAR)
按注册日期顺序排序,注册“统计学”课程的学生的ID是什么?
SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "统计学" ORDER BY T2.date_of_attendance
CREATE TABLE courses (course_name VARCHAR, course_id VARCHAR), CREATE TABLE student_course_attendance (student_id VARCHAR, course_id VARCHAR, date_of_attendance VARCHAR)
按照出勤日期的顺序列出参加“统计学”课程的学生的ID。
SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "统计学" ORDER BY T2.date_of_attendance
CREATE TABLE courses (course_name VARCHAR, course_id VARCHAR), CREATE TABLE student_course_attendance (student_id VARCHAR, course_id VARCHAR, date_of_attendance VARCHAR)
按照出勤日期的顺序,上“统计学”学院课程的学生的ID是什么?
SELECT date FROM weather WHERE max_temperature_f > 85
CREATE TABLE weather (date VARCHAR, max_temperature_f INTEGER)
给我最高温度高于85的日期。
SELECT date FROM weather WHERE max_temperature_f > 85
CREATE TABLE weather (date VARCHAR, max_temperature_f INTEGER)
最高温度高于85的日期是什么?
SELECT name FROM station WHERE lat < 37.5
CREATE TABLE station (lat INTEGER, name VARCHAR)
纬度低于37.5的车站名称是什么?
SELECT name FROM station WHERE lat < 37.5
CREATE TABLE station (lat INTEGER, name VARCHAR)
纬度小于37.5的所有车站的名称是什么?
SELECT city , max(lat) FROM station GROUP BY city
CREATE TABLE station (lat INTEGER, city VARCHAR)
对于每一个城市,返回所有车站的最高纬度。
SELECT city , max(lat) FROM station GROUP BY city
CREATE TABLE station (lat INTEGER, city VARCHAR)
对于每一个城市来说,其车站的最高纬度是什么?
SELECT start_station_name , end_station_name FROM trip ORDER BY id LIMIT 3
CREATE TABLE trip (start_station_name VARCHAR, end_station_name VARCHAR, id VARCHAR)
给我三个ID最老的路线的起始站和结束站。
SELECT start_station_name , end_station_name FROM trip ORDER BY id LIMIT 3
CREATE TABLE trip (start_station_name VARCHAR, end_station_name VARCHAR, id VARCHAR)
三个最小ID的路线的起始站和终点站是什么?
SELECT avg(lat) , avg(long) FROM station WHERE city = "长沙"
CREATE TABLE station (lat INTEGER, city VARCHAR, long INTEGER)
“长沙”市车站平均纬度和经度是多少?
SELECT avg(lat) , avg(long) FROM station WHERE city = "长沙"
CREATE TABLE station (lat INTEGER, city VARCHAR, long INTEGER)
“长沙”市的平均纬度和经度是多少?
SELECT id FROM trip ORDER BY duration LIMIT 1
CREATE TABLE trip (id VARCHAR, duration VARCHAR)
长度最短的路线的ID是什么?
SELECT id FROM trip ORDER BY duration LIMIT 1
CREATE TABLE trip (id VARCHAR, duration VARCHAR)
最短路线的ID是什么?
SELECT sum(duration) , max(duration) FROM trip WHERE bike_id = 636
CREATE TABLE trip (bike_id VARCHAR, duration INTEGER)
ID为636的自行车的路线的总时间和最大持续时间是多少?
SELECT sum(duration) , max(duration) FROM trip WHERE bike_id = 636
CREATE TABLE trip (bike_id VARCHAR, duration INTEGER)
ID为636自行车的所有路线的总时间和最大持续时间是多少?
SELECT zip_code , avg(mean_temperature_f) FROM weather WHERE date LIKE "八月" GROUP BY zip_code
CREATE TABLE weather (date VARCHAR, mean_temperature_f INTEGER, zip_code VARCHAR)
对于每个邮编,返回那里8月的平均温度。
SELECT zip_code , avg(mean_temperature_f) FROM weather WHERE date LIKE "八月" GROUP BY zip_code
CREATE TABLE weather (date VARCHAR, mean_temperature_f INTEGER, zip_code VARCHAR)
对于每个邮政编码,以“8”开头的所有日期的平均温度是多少?
SELECT count(DISTINCT bike_id) FROM trip
CREATE TABLE trip (bike_id VARCHAR)
从路线记录,找出不同的自行车的数量。
SELECT count(DISTINCT bike_id) FROM trip
CREATE TABLE trip (bike_id VARCHAR)
有多少个不同的自行车ID?
SELECT count(DISTINCT city) FROM station
CREATE TABLE station (city VARCHAR)
车站所处的不同城市的数量是多少?
SELECT count(DISTINCT city) FROM station
CREATE TABLE station (city VARCHAR)
这些车站在多少个不同的城市?
SELECT COUNT(*) FROM station WHERE city = "重庆"
CREATE TABLE station (city VARCHAR)
“重庆”城有多少个车站?
SELECT COUNT(*) FROM station WHERE city = "重庆"
CREATE TABLE station (city VARCHAR)
“重庆”有多少车站?
SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7
CREATE TABLE station (name VARCHAR, id VARCHAR), CREATE TABLE status (station_id VARCHAR, bikes_available VARCHAR)
返回曾经有7辆可用自行车的车站的唯一名称。
SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7
CREATE TABLE station (name VARCHAR, id VARCHAR), CREATE TABLE status (station_id VARCHAR, bikes_available VARCHAR)
每个曾经有7辆可用自行车的车站都有哪些不同的名字?
SELECT start_station_name , start_station_id FROM trip WHERE start_date LIKE "八月" GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE trip (start_station_name VARCHAR, start_station_id VARCHAR, start_date VARCHAR)
哪一个起点站从8月份开始的路线最多?请告诉我车站的名字和ID。
SELECT start_station_name , start_station_id FROM trip WHERE start_date LIKE "八月" GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE trip (start_station_name VARCHAR, start_station_id VARCHAR, start_date VARCHAR)
八月份出发次数最多的那个出发站的名称和ID是什么?
SELECT bike_id FROM trip WHERE zip_code = 94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE trip (zip_code VARCHAR, bike_id VARCHAR)
哪辆自行车路线在邮政编码94002的地区旅行最多?
SELECT bike_id FROM trip WHERE zip_code = 94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE trip (zip_code VARCHAR, bike_id VARCHAR)
在邮政编码94002的地区中的旅行最多的自行车的ID是多少?
SELECT COUNT(*) FROM weather WHERE mean_humidity > 50 AND mean_visibility_miles > 8
CREATE TABLE weather (mean_humidity INTEGER, mean_visibility_miles INTEGER)
有多少天平均湿度在50以上,平均能见度在8以上?
SELECT COUNT(*) FROM weather WHERE mean_humidity > 50 AND mean_visibility_miles > 8
CREATE TABLE weather (mean_humidity INTEGER, mean_visibility_miles INTEGER)
平均湿度超过50,平均能见度超过8天的天数是多少?
SELECT T1.lat , T1.long , T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id ORDER BY T2.duration LIMIT 1
CREATE TABLE station (lat VARCHAR, city VARCHAR, long VARCHAR, id VARCHAR), CREATE TABLE trip (start_station_id VARCHAR, duration VARCHAR)
最短的路线开始的车站是的纬度、经度、城市是什么?
SELECT T1.lat , T1.long , T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id ORDER BY T2.duration LIMIT 1
CREATE TABLE station (lat VARCHAR, city VARCHAR, long VARCHAR, id VARCHAR), CREATE TABLE trip (start_station_id VARCHAR, duration VARCHAR)
从什么纬度、经度和城市的车站开始的路线最短?
SELECT id FROM station WHERE city = "厦门" INTERSECT SELECT station_id FROM status GROUP BY station_id HAVING avg(bikes_available) > 10
CREATE TABLE station (station_id VARCHAR, city VARCHAR, bikes_available INTEGER, id VARCHAR), CREATE TABLE status (station_id VARCHAR, city VARCHAR, bikes_available INTEGER, id VARCHAR)
平均自行车可用数在10以上的“厦门”的站台ID是什么?
SELECT id FROM station WHERE city = "厦门" INTERSECT SELECT station_id FROM status GROUP BY station_id HAVING avg(bikes_available) > 10
CREATE TABLE station (station_id VARCHAR, city VARCHAR, bikes_available INTEGER, id VARCHAR), CREATE TABLE status (station_id VARCHAR, city VARCHAR, bikes_available INTEGER, id VARCHAR)
“厦门”通常有超过10辆可用自行车的车站ID有哪些?
SELECT T1.name , T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(T2.bikes_available) > 14 UNION SELECT name , id FROM station WHERE installation_date LIKE "十二月"
CREATE TABLE station (name VARCHAR, id VARCHAR, installation_date VARCHAR), CREATE TABLE status (station_id VARCHAR, bikes_available INTEGER)
平均有14辆以上可用自行车或在12月份安装自行车的车站的名称和ID是什么?
SELECT T1.name , T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(T2.bikes_available) > 14 UNION SELECT name , id FROM station WHERE installation_date LIKE "十二月"
CREATE TABLE station (name VARCHAR, id VARCHAR, installation_date VARCHAR), CREATE TABLE status (station_id VARCHAR, bikes_available INTEGER)
平均有14辆以上可用自行车或在12月安装自行车的所有车站的名称和ID是什么?
SELECT cloud_cover FROM weather WHERE zip_code = 94107 GROUP BY cloud_cover ORDER BY COUNT (*) DESC LIMIT 3
CREATE TABLE weather (cloud_cover VARCHAR, zip_code VARCHAR)
在邮政编码94107的地区,3种最常见的云覆盖率是多少?
SELECT cloud_cover FROM weather WHERE zip_code = 94107 GROUP BY cloud_cover ORDER BY COUNT (*) DESC LIMIT 3
CREATE TABLE weather (cloud_cover VARCHAR, zip_code VARCHAR)
94107邮政编码地区中最常见的3种云覆盖是什么?
SELECT zip_code FROM weather GROUP BY zip_code ORDER BY avg(mean_sea_level_pressure_inches) LIMIT 1
CREATE TABLE weather (mean_sea_level_pressure_inches INTEGER, zip_code VARCHAR)
平均海平面气压最低的地区的邮编是多少?
SELECT zip_code FROM weather GROUP BY zip_code ORDER BY avg(mean_sea_level_pressure_inches) LIMIT 1
CREATE TABLE weather (mean_sea_level_pressure_inches INTEGER, zip_code VARCHAR)
平均海平面气压最低的地区邮编是什么?
SELECT avg(bikes_available) FROM status WHERE station_id NOT IN (SELECT id FROM station WHERE city = "西安")
CREATE TABLE status (station_id VARCHAR, city VARCHAR, bikes_available INTEGER, id VARCHAR), CREATE TABLE station (station_id VARCHAR, city VARCHAR, bikes_available INTEGER, id VARCHAR)
不是位于“西安”市的车站里,自行车的平均可用数是多少?
SELECT avg(bikes_available) FROM status WHERE station_id NOT IN (SELECT id FROM station WHERE city = "西安")
CREATE TABLE status (station_id VARCHAR, city VARCHAR, bikes_available INTEGER, id VARCHAR), CREATE TABLE station (station_id VARCHAR, city VARCHAR, bikes_available INTEGER, id VARCHAR)
不在“西安”市的车站的平均自行车可用率是多少?
SELECT avg(long) FROM station WHERE id NOT IN (SELECT station_id FROM status GROUP BY station_id HAVING max(bikes_available) > 10)
CREATE TABLE station (station_id VARCHAR, bikes_available INTEGER, long INTEGER, id VARCHAR), CREATE TABLE status (station_id VARCHAR, bikes_available INTEGER, long INTEGER, id VARCHAR)
从来没有超过10辆可用自行车的车站的平均经度是多少?
SELECT avg(long) FROM station WHERE id NOT IN (SELECT station_id FROM status GROUP BY station_id HAVING max(bikes_available) > 10)
CREATE TABLE station (station_id VARCHAR, bikes_available INTEGER, long INTEGER, id VARCHAR), CREATE TABLE status (station_id VARCHAR, bikes_available INTEGER, long INTEGER, id VARCHAR)
对于从来没有超过10辆可用自行车的所有车站,它们的平均经度是多少?
SELECT date , zip_code FROM weather WHERE max_temperature_f >= 80
CREATE TABLE weather (date VARCHAR, max_temperature_f INTEGER, zip_code VARCHAR)
什么时候,在什么邮政编码地区最大温度达到80?
SELECT date , zip_code FROM weather WHERE max_temperature_f >= 80
CREATE TABLE weather (date VARCHAR, max_temperature_f INTEGER, zip_code VARCHAR)
什么邮政编码地区有一个最高温度大于或等于80的车站,什么时候达到这个温度?
SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.zip_code HAVING avg(T2.mean_temperature_f) > 60
CREATE TABLE trip (id VARCHAR, zip_code VARCHAR), CREATE TABLE weather (mean_temperature_f INTEGER, zip_code VARCHAR)
请给出平均温度高于60度的邮政编码区进行的所有路线的ID。
SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.zip_code HAVING avg(T2.mean_temperature_f) > 60
CREATE TABLE trip (id VARCHAR, zip_code VARCHAR), CREATE TABLE weather (mean_temperature_f INTEGER, zip_code VARCHAR)
对于每个邮政编码地区,找到所有具有平均温度在60以上的路线的ID?
SELECT zip_code , count(*) FROM weather WHERE max_wind_Speed_mph >= 25 GROUP BY zip_code
CREATE TABLE weather (zip_code VARCHAR, max_wind_Speed_mph INTEGER)
对于每个邮编地区,返回最大风速达到25的次数?
SELECT zip_code , count(*) FROM weather WHERE max_wind_Speed_mph >= 25 GROUP BY zip_code
CREATE TABLE weather (zip_code VARCHAR, max_wind_Speed_mph INTEGER)
对于每一个邮政编码地区,多少次最大风速达到25英里每小时?
SELECT date , zip_code FROM weather WHERE min_dew_point_f < (SELECT min(min_dew_point_f) FROM weather WHERE zip_code = 94107)
CREATE TABLE weather (date VARCHAR, min_dew_point_f INTEGER, zip_code VARCHAR)
哪一天哪个地区的最小露点低于邮编94107地区中任何一天,这些地区的邮编是什么?
SELECT date , zip_code FROM weather WHERE min_dew_point_f < (SELECT min(min_dew_point_f) FROM weather WHERE zip_code = 94107)
CREATE TABLE weather (date VARCHAR, min_dew_point_f INTEGER, zip_code VARCHAR)
哪些天的最低露点比邮政编码94107中的任何一天都要小,在哪个邮政编码地区中进行测量的?
SELECT T1.id , T2.installation_date FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id
CREATE TABLE trip (end_station_id VARCHAR, id VARCHAR), CREATE TABLE station (id VARCHAR, installation_date VARCHAR)
针对每个路线,返回其终点站的安装日期。
SELECT T1.id , T2.installation_date FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id
CREATE TABLE trip (end_station_id VARCHAR, id VARCHAR), CREATE TABLE station (id VARCHAR, installation_date VARCHAR)
每个旅程的终点站的安装日期是多少?
SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id = T2.id ORDER BY T2.dock_count DESC LIMIT 1
CREATE TABLE trip (start_station_id VARCHAR, id VARCHAR), CREATE TABLE station (dock_count VARCHAR, id VARCHAR)
哪一次旅行从码头数最多的车站开始?把旅行id给我。
SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id = T2.id ORDER BY T2.dock_count DESC LIMIT 1
CREATE TABLE trip (start_station_id VARCHAR, id VARCHAR), CREATE TABLE station (dock_count VARCHAR, id VARCHAR)
从码头数最高的车站出发的旅行ID是什么?
SELECT count(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city != "厦门"
CREATE TABLE trip (end_station_id VARCHAR), CREATE TABLE station (city VARCHAR, id VARCHAR)
统计不是结束在“厦门”市的旅行的次数。
SELECT count(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city != "厦门"
CREATE TABLE trip (end_station_id VARCHAR), CREATE TABLE station (city VARCHAR, id VARCHAR)
有多少次旅行没有结束在“厦门”?
SELECT date FROM weather WHERE zip_code = 94107 AND EVENTS != "大雾" AND EVENTS != "大雨"
CREATE TABLE weather (date VARCHAR, zip_code VARCHAR, EVENTS VARCHAR)
在邮政编码94107,在哪一天既没有“大雨”也没有观察到“大雾”?
SELECT date FROM weather WHERE zip_code = 94107 AND EVENTS != "大雾" AND EVENTS != "大雨"
CREATE TABLE weather (date VARCHAR, zip_code VARCHAR, EVENTS VARCHAR)
在94107的邮政编码哪一天既没有“大雨”也没有“大雾”?
SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING min(bikes_available) < 7
CREATE TABLE station (station_id VARCHAR, bikes_available INTEGER, id VARCHAR, lat INTEGER), CREATE TABLE status (station_id VARCHAR, bikes_available INTEGER, id VARCHAR, lat INTEGER)
那些纬度在37.4以上、自行车可用率从来在7以下的车站的ID是多少?
SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING min(bikes_available) < 7
CREATE TABLE station (station_id VARCHAR, bikes_available INTEGER, id VARCHAR, lat INTEGER), CREATE TABLE status (station_id VARCHAR, bikes_available INTEGER, id VARCHAR, lat INTEGER)
所有纬度在37.4以上、从来没有少于7辆可用自行车的车站的ID是什么?
SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(bikes_available) > 10 EXCEPT SELECT name FROM station WHERE city = "长沙"
CREATE TABLE station (name VARCHAR, bikes_available INTEGER, city VARCHAR), CREATE TABLE status (station_id VARCHAR)
哪些车站的平均自行车供应量超过10而且不位于'“长沙”‘市?
SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(bikes_available) > 10 EXCEPT SELECT name FROM station WHERE city = "长沙"
CREATE TABLE station (name VARCHAR, bikes_available INTEGER, city VARCHAR), CREATE TABLE status (station_id VARCHAR)
有超过十辆自行车,而且不在'“长沙”‘的所有车站都叫什么名字?
SELECT name , lat , city FROM station ORDER BY lat LIMIT 1
CREATE TABLE station (lat VARCHAR, name VARCHAR, city VARCHAR)
最低纬度的车站的名称、纬度和城市是什么?
SELECT name , lat , city FROM station ORDER BY lat LIMIT 1
CREATE TABLE station (lat VARCHAR, name VARCHAR, city VARCHAR)
位于最南边的火车站的名称、纬度和城市是什么?
SELECT date , mean_temperature_f , mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
CREATE TABLE weather (date VARCHAR, max_gust_speed_mph VARCHAR, mean_temperature_f VARCHAR, mean_humidity VARCHAR)
最大阵风速度最高的3天的日期、平均温度和平均湿度是多少?
SELECT date , mean_temperature_f , mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
CREATE TABLE weather (date VARCHAR, max_gust_speed_mph VARCHAR, mean_temperature_f VARCHAR, mean_humidity VARCHAR)
三个最大阵风速度的日子的日期、平均温度和平均湿度是多少?
SELECT city , COUNT(*) FROM station GROUP BY city HAVING COUNT(*) >= 15
CREATE TABLE station (city VARCHAR)
列出所有至少有15个站点的城市的名称和站点数量。
SELECT city , COUNT(*) FROM station GROUP BY city HAVING COUNT(*) >= 15
CREATE TABLE station (city VARCHAR)
每个至少有15个车站的城市叫什么名字?有多少个车站?
SELECT start_station_id , start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*) >= 200
CREATE TABLE trip (start_station_id VARCHAR, start_station_name VARCHAR)
查找至少有200个路线开始的站的ID和名称。
SELECT start_station_id , start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*) >= 200
CREATE TABLE trip (start_station_id VARCHAR, start_station_name VARCHAR)
至少是200个路线的出发站的车站的ID和名称是什么?
SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_visibility_miles) < 10
CREATE TABLE weather (mean_visibility_miles INTEGER, zip_code VARCHAR)
找到平均能见度低于10的地区的邮政编码。
SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_visibility_miles) < 10
CREATE TABLE weather (mean_visibility_miles INTEGER, zip_code VARCHAR)
对于每个邮政编码,选择那些平均可见度低于10的地区的邮政编码。
SELECT city FROM station GROUP BY city ORDER BY max(lat) DESC
CREATE TABLE station (lat INTEGER, city VARCHAR)
按照每个城市站点的最高纬度的递减顺序列出所有城市。
SELECT city FROM station GROUP BY city ORDER BY max(lat) DESC
CREATE TABLE station (lat INTEGER, city VARCHAR)
对于每个城市,按其最高站点纬度降序排列,列出它们的名称。
SELECT date , cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5
CREATE TABLE weather (cloud_cover VARCHAR, date VARCHAR)
前5的云覆盖率的日期是什么?并告诉我云的覆盖率。
SELECT date , cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5
CREATE TABLE weather (cloud_cover VARCHAR, date VARCHAR)
前5高的云覆盖率的日期是什么,覆盖率是多少?
SELECT id , duration FROM trip ORDER BY duration DESC LIMIT 3
CREATE TABLE trip (id VARCHAR, duration VARCHAR)
前3的持续时间的路线的ID和持续时间是什么?
SELECT id , duration FROM trip ORDER BY duration DESC LIMIT 3
CREATE TABLE trip (id VARCHAR, duration VARCHAR)
持续时间最长的路线ID是什么?路线时间多长?
SELECT T1.name , T1.long , avg(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id
CREATE TABLE station (name VARCHAR, long VARCHAR, id VARCHAR), CREATE TABLE trip (start_station_id VARCHAR, duration INTEGER)
对于每个站点,返回其经度和从该站点开始的路线的平均持续时间。
SELECT T1.name , T1.long , avg(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id
CREATE TABLE station (name VARCHAR, long VARCHAR, id VARCHAR), CREATE TABLE trip (start_station_id VARCHAR, duration INTEGER)
对于每个起始站ID,它的名称、经度和在那里开始的路线的平均持续时间是什么?
SELECT T1.name , T1.lat , min(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.end_station_id GROUP BY T2.end_station_id
CREATE TABLE station (lat VARCHAR, name VARCHAR, id VARCHAR), CREATE TABLE trip (end_station_id VARCHAR, duration INTEGER)
对于每个车站,找到它的纬度和在这个车站结束的路线的最小持续时间。
SELECT T1.name , T1.lat , min(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.end_station_id GROUP BY T2.end_station_id
CREATE TABLE station (lat VARCHAR, name VARCHAR, id VARCHAR), CREATE TABLE trip (end_station_id VARCHAR, duration INTEGER)
对于每个终点站ID,它的名称、纬度和以此为终点站的路线的最短持续时间是什么?
SELECT DISTINCT start_station_name FROM trip WHERE duration < 100
CREATE TABLE trip (start_station_name VARCHAR, duration INTEGER)
列出所有持续时间低于100的路线的不同起始车站。
SELECT DISTINCT start_station_name FROM trip WHERE duration < 100
CREATE TABLE trip (start_station_name VARCHAR, duration INTEGER)
对于持续时间不到100的路线,不同的起点站名是什么?
SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70
CREATE TABLE weather (max_dew_point_f INTEGER, zip_code VARCHAR)
查找所有最大露点从未达到70的邮政编码。
SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70
CREATE TABLE weather (max_dew_point_f INTEGER, zip_code VARCHAR)
哪些地区的最大露点总是低于70,这些地区的不同邮编是多少?
SELECT id FROM trip WHERE duration >= (SELECT avg(duration) FROM trip WHERE zip_code = 94103)
CREATE TABLE trip (zip_code VARCHAR, id VARCHAR, duration INTEGER)
在邮政编码94103地区中,查找至少与路线平均持续时间一样长的路线的id。
SELECT id FROM trip WHERE duration >= (SELECT avg(duration) FROM trip WHERE zip_code = 94103)
CREATE TABLE trip (zip_code VARCHAR, id VARCHAR, duration INTEGER)
邮政编码94103地区中持续时间和平均旅行持续时间一样长的所有路线的id是什么?
SELECT date FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31
CREATE TABLE weather (date VARCHAR, mean_sea_level_pressure_inches INTEGER)
平均海平面气压在30.3到31之间的日期是什么?