context
stringlengths
28
393
answer
stringlengths
17
532
question
stringlengths
5
112
CREATE TABLE Flight (distance VARCHAR, flno VARCHAR)
SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3
最短航班的号码是多少?
CREATE TABLE Flight (distance INTEGER, price INTEGER, origin VARCHAR)
SELECT AVG(distance), AVG(price) FROM Flight WHERE origin = "上海"
从“上海”起飞的航班的平均距离和平均价格是多少?
CREATE TABLE Flight (distance INTEGER, price INTEGER, origin VARCHAR)
SELECT AVG(distance), AVG(price) FROM Flight WHERE origin = "上海"
从“上海”起飞的所有航班的平均距离和价格是多少?
CREATE TABLE Flight (origin VARCHAR)
SELECT origin, COUNT(*) FROM Flight GROUP BY origin
显示所有出发地和每个出发地的航班的数量。
CREATE TABLE Flight (origin VARCHAR)
SELECT origin, COUNT(*) FROM Flight GROUP BY origin
对于每一个出发地,有多少航班来自那里?
CREATE TABLE Flight (destination VARCHAR)
SELECT destination, COUNT(*) FROM Flight GROUP BY destination
显示所有目的地和飞往每个目的地的航班数。
CREATE TABLE Flight (destination VARCHAR)
SELECT destination, COUNT(*) FROM Flight GROUP BY destination
目的地有哪些?飞往每个目的地的航班数量是多少?
CREATE TABLE Flight (origin VARCHAR)
SELECT origin FROM Flight GROUP BY origin ORDER BY COUNT(*) DESC LIMIT 1
哪个出发地的航班最多?
CREATE TABLE Flight (origin VARCHAR)
SELECT origin FROM Flight GROUP BY origin ORDER BY COUNT(*) DESC LIMIT 1
从哪里来的航班最多?
CREATE TABLE Flight (destination VARCHAR)
SELECT destination FROM Flight GROUP BY destination ORDER BY COUNT(*) LIMIT 1
哪个目的地的航班最少?
CREATE TABLE Flight (destination VARCHAR)
SELECT destination FROM Flight GROUP BY destination ORDER BY COUNT(*) LIMIT 1
哪个目的地的航班最少?
CREATE TABLE Flight (aid VARCHAR, flno VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
99号航班的飞机名称是什么?
CREATE TABLE Flight (aid VARCHAR, flno VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
99号班机叫什么名字?
CREATE TABLE Flight (aid VARCHAR, flno VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "空客"
显示使用“空客”飞机的所有航班号。
CREATE TABLE Flight (aid VARCHAR, flno VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "空客"
“空客”飞机的航班号是多少?
CREATE TABLE Flight (aid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T2.name, COUNT(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid
显示每架飞机的飞机名称和航班号。
CREATE TABLE Flight (aid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T2.name, COUNT(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid
每架飞机的名字是什么,每个飞机有多少个航班?
CREATE TABLE Flight (aid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING COUNT(*) >= 2
显示至少有两个航班的所有飞机的名称。
CREATE TABLE Flight (aid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING COUNT(*) >= 2
至少有2个航班的所有飞机的名字是什么?
CREATE TABLE Certificate (eid VARCHAR)
SELECT COUNT(DISTINCT eid) FROM Certificate
有多少员工有证书?
CREATE TABLE Certificate (eid VARCHAR)
SELECT COUNT(DISTINCT eid) FROM Certificate
拥有证书的不同雇员的总数是多少?
CREATE TABLE Employee (eid VARCHAR), CREATE TABLE Certificate (eid VARCHAR)
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
显示所有没有证书的员工ID。
CREATE TABLE Employee (eid VARCHAR), CREATE TABLE Certificate (eid VARCHAR)
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
没有证书的所有员工的ID是什么?
CREATE TABLE Employee (name VARCHAR, eid VARCHAR), CREATE TABLE Certificate (aid VARCHAR, eid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "赵强"
显示“赵强”所拥有证件的所有飞机名称。
CREATE TABLE Employee (name VARCHAR, eid VARCHAR), CREATE TABLE Certificate (aid VARCHAR, eid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "赵强"
“赵强”有驾驶执照的所有飞机的名字是什么?
CREATE TABLE Employee (name VARCHAR, eid VARCHAR), CREATE TABLE Certificate (aid VARCHAR, eid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "波音"
显示所有拥有“波音 733-800”证书的员工姓名。
CREATE TABLE Employee (name VARCHAR, eid VARCHAR), CREATE TABLE Certificate (aid VARCHAR, eid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "波音"
所有持有“波音”飞行证书的员工的名字是什么?
CREATE TABLE Employee (name VARCHAR, eid VARCHAR), CREATE TABLE Certificate (aid VARCHAR, eid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "波音" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "空客"
显示所有拥有“波音”和“空客”证书的员工的姓名。
CREATE TABLE Employee (name VARCHAR, eid VARCHAR), CREATE TABLE Certificate (aid VARCHAR, eid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "波音" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "空客"
所有能同时驾驶“波音”和“空客”的员工的名字是什么?
CREATE TABLE Employee (name VARCHAR, eid VARCHAR), CREATE TABLE Certificate (aid VARCHAR, eid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "波音"
显示所有没有“波音 733-800”证书的员工的姓名。
CREATE TABLE Employee (name VARCHAR, eid VARCHAR), CREATE TABLE Certificate (aid VARCHAR, eid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "波音"
所有未获得驾驶“波音”认证的雇员的姓名是什么?
CREATE TABLE Certificate (aid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY COUNT(*) DESC LIMIT 1
显示最少人拥有的飞机证书名字。
CREATE TABLE Certificate (aid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY COUNT(*) DESC LIMIT 1
被认证最少的飞机名称是什么?
CREATE TABLE Certificate (aid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, distance INTEGER, name VARCHAR)
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY COUNT(*) >= 5
显示距离超过5000并且至少有5人拥有其证书的飞机的名称和距离。
CREATE TABLE Certificate (aid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, distance INTEGER, name VARCHAR)
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY COUNT(*) >= 5
能飞5000距离、至少5人能飞的飞机的名字和距离是多少?
CREATE TABLE Employee (name VARCHAR, eid VARCHAR, salary VARCHAR), CREATE TABLE Certificate (eid VARCHAR)
SELECT T1.name, T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY COUNT(*) DESC LIMIT 1
持有飞机证件最多的员工的工资和姓名是什么?
CREATE TABLE Employee (name VARCHAR, eid VARCHAR, salary VARCHAR), CREATE TABLE Certificate (eid VARCHAR)
SELECT T1.name, T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY COUNT(*) DESC LIMIT 1
拥有最多飞机证件的员工的薪资和姓名是什么?
CREATE TABLE Employee (name VARCHAR, eid VARCHAR), CREATE TABLE Certificate (aid VARCHAR, eid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, distance INTEGER)
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY COUNT(*) DESC LIMIT 1
持有最多的距离超过5000的飞机证书的员工的工资和姓名是什么?
CREATE TABLE Employee (name VARCHAR, eid VARCHAR), CREATE TABLE Certificate (aid VARCHAR, eid VARCHAR), CREATE TABLE Aircraft (aid VARCHAR, distance INTEGER)
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY COUNT(*) DESC LIMIT 1
持有距离超过5000飞机证书最多的员工的工资和姓名是什么?
CREATE TABLE Allergy_type (allergy VARCHAR)
SELECT COUNT(DISTINCT allergy) FROM Allergy_type
有多少过敏反应?
CREATE TABLE Allergy_type (allergy VARCHAR)
SELECT COUNT(DISTINCT allergy) FROM Allergy_type
有多少过敏项目?
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT COUNT(DISTINCT allergytype) FROM Allergy_type
有多少种不同的过敏反应类型?
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT COUNT(DISTINCT allergytype) FROM Allergy_type
有多少种不同的过敏反应?
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT DISTINCT allergytype FROM Allergy_type
显示所有过敏类型。
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT DISTINCT allergytype FROM Allergy_type
过敏的类型有哪些?
CREATE TABLE Allergy_type (allergytype VARCHAR, allergy VARCHAR)
SELECT allergy, allergytype FROM Allergy_type
显示所有过敏和他们的类型。
CREATE TABLE Allergy_type (allergytype VARCHAR, allergy VARCHAR)
SELECT allergy, allergytype FROM Allergy_type
过敏和它们的类型是什么?
CREATE TABLE Allergy_type (allergytype VARCHAR, allergy VARCHAR)
SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "食物"
显示所有类型的“食物”过敏。
CREATE TABLE Allergy_type (allergytype VARCHAR, allergy VARCHAR)
SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "食物"
所有不同的“食物"过敏是什么?
CREATE TABLE Allergy_type (allergytype VARCHAR, allergy VARCHAR)
SELECT allergytype FROM Allergy_type WHERE allergy = "猫"
过敏原是"猫”的过敏类型是什么?
CREATE TABLE Allergy_type (allergytype VARCHAR, allergy VARCHAR)
SELECT allergytype FROM Allergy_type WHERE allergy = "猫"
“猫”过敏是什么类型的?
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT COUNT(*) FROM Allergy_type WHERE allergytype = "动物"
有多少“动物”过敏反应?
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT COUNT(*) FROM Allergy_type WHERE allergytype = "动物"
有多少种“动物”过敏?
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT allergytype, COUNT(*) FROM Allergy_type GROUP BY allergytype
显示所有过敏类型和每种类型的数量。
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT allergytype, COUNT(*) FROM Allergy_type GROUP BY allergytype
过敏类型有哪些?每种类型有多少种过敏反应?
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) DESC LIMIT 1
哪种过敏类型有最多的过敏反应?
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) DESC LIMIT 1
哪种过敏反应类型最常见?
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) ASC LIMIT 1
哪种过敏类型有最少的过敏反应?
CREATE TABLE Allergy_type (allergytype VARCHAR)
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) ASC LIMIT 1
哪种过敏类型最不常见?
CREATE TABLE Student (Id VARCHAR)
SELECT COUNT(*) FROM Student
有多少学生?
CREATE TABLE Student (Id VARCHAR)
SELECT COUNT(*) FROM Student
学生总数是多少?
CREATE TABLE Student (Lname VARCHAR, Fname VARCHAR)
SELECT Fname, Lname FROM Student
显示所有学生的名字和姓氏。
CREATE TABLE Student (Lname VARCHAR, Fname VARCHAR)
SELECT Fname, Lname FROM Student
所有学生的全名是什么?
CREATE TABLE Student (advisor VARCHAR)
SELECT COUNT(DISTINCT advisor) FROM Student
列出了多少不同的顾问?
CREATE TABLE Student (advisor VARCHAR)
SELECT COUNT(DISTINCT advisor) FROM Student
有多少顾问?
CREATE TABLE Student (Major VARCHAR)
SELECT DISTINCT Major FROM Student
显示所有专业。
CREATE TABLE Student (Major VARCHAR)
SELECT DISTINCT Major FROM Student
不同专业有哪些?
CREATE TABLE Student (city_code VARCHAR)
SELECT DISTINCT city_code FROM Student
显示所有学生居住的城市。
CREATE TABLE Student (city_code VARCHAR)
SELECT DISTINCT city_code FROM Student
学生居住在什么城市?
CREATE TABLE Student (Age VARCHAR, Sex VARCHAR, Lname VARCHAR, Fname VARCHAR)
SELECT Fname, Lname, Age FROM Student WHERE Sex = '女'
显示所有女学生的名、姓氏、年龄。他们的性别是“女”.
CREATE TABLE Student (Age VARCHAR, Sex VARCHAR, Lname VARCHAR, Fname VARCHAR)
SELECT Fname, Lname, Age FROM Student WHERE Sex = '女'
所有性别为“女”的女生全名和年龄是多少?
CREATE TABLE Student (Sex VARCHAR, StuID VARCHAR)
SELECT StuID FROM Student WHERE Sex = '男'
显示所有男生的学生ID。
CREATE TABLE Student (Sex VARCHAR, StuID VARCHAR)
SELECT StuID FROM Student WHERE Sex = '男'
所有男生的学生ID是什么?
CREATE TABLE Student (age VARCHAR)
SELECT COUNT(*) FROM Student WHERE age = 18
18岁的学生有多少?
CREATE TABLE Student (age VARCHAR)
SELECT COUNT(*) FROM Student WHERE age = 18
有多少18岁的学生?
CREATE TABLE Student (StuID VARCHAR, age INTEGER)
SELECT StuID FROM Student WHERE age > 20
显示所有20岁以上的学生ID。
CREATE TABLE Student (StuID VARCHAR, age INTEGER)
SELECT StuID FROM Student WHERE age > 20
20岁以上学生的学生ID是什么?
CREATE TABLE Student (LName VARCHAR, city_code VARCHAR)
SELECT city_code FROM Student WHERE LName = "金"
姓“金”的学生住在哪个城市?
CREATE TABLE Student (LName VARCHAR, city_code VARCHAR)
SELECT city_code FROM Student WHERE LName = "金"
给出姓“金”的学生所住的城市。
CREATE TABLE Student (Advisor VARCHAR, StuID VARCHAR)
SELECT Advisor FROM Student WHERE StuID = 1004
谁是ID1004的学生的导师?
CREATE TABLE Student (Advisor VARCHAR, StuID VARCHAR)
SELECT Advisor FROM Student WHERE StuID = 1004
谁指导1004学生?
CREATE TABLE Student (city_code VARCHAR)
SELECT COUNT(*) FROM Student WHERE city_code = "香港" OR city_code = "深圳"
“香港”或“深圳”有多少学生聚准?
CREATE TABLE Student (city_code VARCHAR)
SELECT COUNT(*) FROM Student WHERE city_code = "香港" OR city_code = "深圳"
给出居住在“香港”或“深圳”学生的人数。
CREATE TABLE Student (age INTEGER)
SELECT MIN(age), AVG(age), MAX(age) FROM Student
显示所有学生的最低、平均和最大年龄。
CREATE TABLE Student (age INTEGER)
SELECT MIN(age), AVG(age), MAX(age) FROM Student
所有学生的最低年龄、平均年龄和最大年龄是多少?
CREATE TABLE Student (LName VARCHAR, age INTEGER)
SELECT LName FROM Student WHERE age = (SELECT MIN(age) FROM Student)
最小的学生的姓是什么?
CREATE TABLE Student (LName VARCHAR, age INTEGER)
SELECT LName FROM Student WHERE age = (SELECT MIN(age) FROM Student)
提供最年轻学生的姓氏。
CREATE TABLE Student (StuID VARCHAR, age INTEGER)
SELECT StuID FROM Student WHERE age = (SELECT MAX(age) FROM Student)
显示最老学生的学生ID。
CREATE TABLE Student (StuID VARCHAR, age INTEGER)
SELECT StuID FROM Student WHERE age = (SELECT MAX(age) FROM Student)
最老的学生的学生ID是什么?
CREATE TABLE Student (major VARCHAR)
SELECT major, COUNT(*) FROM Student GROUP BY major
显示所有专业和相应的学生数量。
CREATE TABLE Student (major VARCHAR)
SELECT major, COUNT(*) FROM Student GROUP BY major
每个专业有多少学生?
CREATE TABLE Student (major VARCHAR)
SELECT major FROM Student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
哪个专业的学生最多?
CREATE TABLE Student (major VARCHAR)
SELECT major FROM Student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
最大的专业是什么?
CREATE TABLE Student (age VARCHAR)
SELECT age, COUNT(*) FROM Student GROUP BY age
显示所有年龄和对应学生的数量。
CREATE TABLE Student (age VARCHAR)
SELECT age, COUNT(*) FROM Student GROUP BY age
每个学生年龄有多大?每个年龄段有多少学生?
CREATE TABLE Student (sex VARCHAR, age INTEGER)
SELECT AVG(age), sex FROM Student GROUP BY sex
显示男女学生的平均年龄。
CREATE TABLE Student (sex VARCHAR, age INTEGER)
SELECT AVG(age), sex FROM Student GROUP BY sex
男女学生平均年龄是多少?
CREATE TABLE Student (city_code VARCHAR)
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code
显示所有城市和相应的学生数量。
CREATE TABLE Student (city_code VARCHAR)
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code
每个城市有多少学生?
CREATE TABLE Student (advisor VARCHAR)
SELECT advisor, COUNT(*) FROM Student GROUP BY advisor
显示所有的顾问和相应的学生人数。