context
stringlengths
28
393
answer
stringlengths
17
532
question
stringlengths
5
112
CREATE TABLE user_profiles (followers INTEGER)
SELECT MAX(followers), SUM(followers) FROM user_profiles
查找所有用户的追随者的最大数量和总数。
CREATE TABLE catalog_contents (catalog_entry_name VARCHAR)
SELECT DISTINCT (catalog_entry_name) FROM catalog_contents
查找所有目录项的名称。
CREATE TABLE catalog_contents (catalog_entry_name VARCHAR)
SELECT DISTINCT (catalog_entry_name) FROM catalog_contents
所有目录项名称是什么?
CREATE TABLE Attribute_Definitions (attribute_data_type VARCHAR)
SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING COUNT(*) > 3
查找拥有多于3个属性定义的属性数据类型的列表。
CREATE TABLE Attribute_Definitions (attribute_data_type VARCHAR)
SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING COUNT(*) > 3
哪些属性数据类型有超过3个属性定义?
CREATE TABLE Attribute_Definitions (attribute_data_type VARCHAR, attribute_name VARCHAR)
SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name = "绿色"
属性名为“绿色”的属性数据类型是什么?
CREATE TABLE Attribute_Definitions (attribute_data_type VARCHAR, attribute_name VARCHAR)
SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name = "绿色"
查找属性名为“绿色”的属性数据类型。
CREATE TABLE Catalog_Structure (catalog_level_name VARCHAR, catalog_level_number INTEGER)
SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10
查找级别在5到10之间的目录结构的名称和级别。
CREATE TABLE Catalog_Structure (catalog_level_name VARCHAR, catalog_level_number INTEGER)
SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10
级别在5到10之间的目录结构的名称和级别是什么?
CREATE TABLE catalogs (catalog_publisher VARCHAR)
SELECT DISTINCT (catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "小刚"
查找所有名字包含“小刚”的目录出版商。
CREATE TABLE catalogs (catalog_publisher VARCHAR)
SELECT DISTINCT (catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "小刚"
哪些目录出版商的名字内包含"小刚"这个子串?
CREATE TABLE catalogs (catalog_publisher VARCHAR)
SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY COUNT(*) DESC LIMIT 1
哪个目录出版商出版了最多的目录?
CREATE TABLE catalogs (catalog_publisher VARCHAR)
SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY COUNT(*) DESC LIMIT 1
查找目录最多的目录出版商。
CREATE TABLE catalogs (catalog_id VARCHAR, date_of_publication VARCHAR, catalog_name VARCHAR), CREATE TABLE catalog_structure (catalog_id VARCHAR)
SELECT t1.catalog_name, t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5
查找目录级别号大于5的所有目录的名称和发布日期。
CREATE TABLE catalogs (catalog_id VARCHAR, date_of_publication VARCHAR, catalog_name VARCHAR), CREATE TABLE catalog_structure (catalog_id VARCHAR)
SELECT t1.catalog_name, t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5
级别号在5以上的目录的名称和发布日期是什么?
CREATE TABLE Catalog_Contents (catalog_entry_id VARCHAR, catalog_entry_name VARCHAR), CREATE TABLE Catalog_Contents_Additional_Attributes (attribute_value VARCHAR)
SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY COUNT(*) DESC LIMIT 1)
具有最多条目所具有的属性所属的目录的条目名称是什么?
CREATE TABLE Catalog_Contents (catalog_entry_id VARCHAR, catalog_entry_name VARCHAR), CREATE TABLE Catalog_Contents_Additional_Attributes (attribute_value VARCHAR)
SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY COUNT(*) DESC LIMIT 1)
查找具有最多条目的属性所属的目录的条目名称。
CREATE TABLE catalog_contents (price_in_dollars VARCHAR, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1
最贵的目录(美元)的条目名称是什么?
CREATE TABLE catalog_contents (price_in_dollars VARCHAR, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1
以最高价格(美元)查找目录的条目名称。
CREATE TABLE catalog_contents (catalog_level_number VARCHAR, price_in_dollars VARCHAR), CREATE TABLE catalog_structure (catalog_level_name VARCHAR, catalog_level_number VARCHAR)
SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1
最便宜的目录(美元)的级别名称是什么?
CREATE TABLE catalog_contents (catalog_level_number VARCHAR, price_in_dollars VARCHAR), CREATE TABLE catalog_structure (catalog_level_name VARCHAR, catalog_level_number VARCHAR)
SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1
查找价格最低的(美元)目录的级别名称。
CREATE TABLE catalog_contents (price_in_euros INTEGER)
SELECT AVG(price_in_euros), MIN(price_in_euros) FROM catalog_contents
所有产品的平均价格和最低价格(欧元)是多少?
CREATE TABLE catalog_contents (price_in_euros INTEGER)
SELECT AVG(price_in_euros), MIN(price_in_euros) FROM catalog_contents
给我产品的平均价格和最低价格(欧元)。
CREATE TABLE catalog_contents (height VARCHAR, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1
最高的产品是什么?给我目录条目名称。
CREATE TABLE catalog_contents (height VARCHAR, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1
哪个目录内容最高?给我目录条目名称。
CREATE TABLE catalog_contents (capacity VARCHAR, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1
找出容量最小的产品的名称。
CREATE TABLE catalog_contents (capacity VARCHAR, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1
哪个目录内容的容量最小?返回目录条目名称。
CREATE TABLE catalog_contents (product_stock_number VARCHAR, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2"
找出所有产品的名称,其库存号以“2”开头。
CREATE TABLE catalog_contents (product_stock_number VARCHAR, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2"
哪些目录内容有从“2”开始的产品库存号?显示目录项名称。
CREATE TABLE Catalog_Contents (catalog_entry_id VARCHAR, catalog_entry_name VARCHAR), CREATE TABLE Catalog_Contents_Additional_Attributes (catalog_entry_id VARCHAR, catalog_level_number VARCHAR)
SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8"
查找级别为“8”的目录条目名称。
CREATE TABLE Catalog_Contents (catalog_entry_id VARCHAR, catalog_entry_name VARCHAR), CREATE TABLE Catalog_Contents_Additional_Attributes (catalog_entry_id VARCHAR, catalog_level_number VARCHAR)
SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8"
级别为“8”的目录条目名称是什么?
CREATE TABLE catalog_contents (width INTEGER, LENGTH INTEGER, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5
查找长度小于3或高度大于5的产品的名称。
CREATE TABLE catalog_contents (width INTEGER, LENGTH INTEGER, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5
哪些目录内容的长度低于3或大于5?查找目录条目名称。
CREATE TABLE Attribute_Definitions (attribute_id VARCHAR, attribute_name VARCHAR), CREATE TABLE Catalog_Contents_Additional_Attributes (attribute_id VARCHAR, attribute_value VARCHAR)
SELECT t1.attribute_name, t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0
找到属性值为0的属性定义的名称和属性ID。
CREATE TABLE Attribute_Definitions (attribute_id VARCHAR, attribute_name VARCHAR), CREATE TABLE Catalog_Contents_Additional_Attributes (attribute_id VARCHAR, attribute_value VARCHAR)
SELECT t1.attribute_name, t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0
哪些属性定义具有属性值0?给我属性名和属性ID。
CREATE TABLE Catalog_Contents (capacity VARCHAR, price_in_dollars INTEGER, catalog_entry_name VARCHAR)
SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700
查找价格大于700(美元)的产品名称和容量。
CREATE TABLE Catalog_Contents (capacity VARCHAR, price_in_dollars INTEGER, catalog_entry_name VARCHAR)
SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700
哪些目录内容的价格超过700美元?显示他们的目录条目名称和容量。
CREATE TABLE Catalogs (date_of_latest_revision VARCHAR)
SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING COUNT(*) > 1
找出修订超过一次的日期。
CREATE TABLE Catalogs (date_of_latest_revision VARCHAR)
SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING COUNT(*) > 1
在哪几天内对目录进行了一次以上的修改。
CREATE TABLE catalog_contents (Id VARCHAR)
SELECT COUNT(*) FROM catalog_contents
记录中有多少种产品?
CREATE TABLE catalog_contents (Id VARCHAR)
SELECT COUNT(*) FROM catalog_contents
查找目录内容的总数。
CREATE TABLE catalog_contents (next_entry_id INTEGER, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8
找到下一个条目ID大于8的所有产品的名字。
CREATE TABLE catalog_contents (next_entry_id INTEGER, catalog_entry_name VARCHAR)
SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8
下一个条目ID在8以上的产品的目录条目名称是什么?
CREATE TABLE Aircraft (Id VARCHAR)
SELECT COUNT(*) FROM Aircraft
我们有多少架飞机?
CREATE TABLE Aircraft (Id VARCHAR)
SELECT COUNT(*) FROM Aircraft
数据库中有多少飞机?
CREATE TABLE Aircraft (name VARCHAR, distance VARCHAR)
SELECT name, distance FROM Aircraft
显示所有飞机的名称和距离。
CREATE TABLE Aircraft (name VARCHAR, distance VARCHAR)
SELECT name, distance FROM Aircraft
所有飞机的名称和距离是多少?
CREATE TABLE Aircraft (aid VARCHAR, distance INTEGER)
SELECT aid FROM Aircraft WHERE distance > 1000
显示所有距离超过1000的飞机的ID。
CREATE TABLE Aircraft (aid VARCHAR, distance INTEGER)
SELECT aid FROM Aircraft WHERE distance > 1000
能覆盖超过1000距离的所有飞行器的ID是什么?
CREATE TABLE Aircraft (distance INTEGER)
SELECT COUNT(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000
有多少架飞机有1000到5000的距离?
CREATE TABLE Aircraft (distance INTEGER)
SELECT COUNT(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000
距离在1000到5000之间的飞机的有多少台?
CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR, distance VARCHAR)
SELECT name, distance FROM Aircraft WHERE aid = 12
ID是12的飞机的名称和距离是多少?
CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR, distance VARCHAR)
SELECT name, distance FROM Aircraft WHERE aid = 12
ID是12的飞机的名称和距离是多少?
CREATE TABLE Aircraft (distance INTEGER)
SELECT MIN(distance), AVG(distance), MAX(distance) FROM Aircraft
所有飞机的最小、平均和最大距离是多少?
CREATE TABLE Aircraft (distance INTEGER)
SELECT MIN(distance), AVG(distance), MAX(distance) FROM Aircraft
返回所有飞行器的最小、平均和最大距离。
CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR, distance VARCHAR)
SELECT aid, name FROM Aircraft ORDER BY distance DESC LIMIT 1
显示最大距离的飞机的ID和名称。
CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR, distance VARCHAR)
SELECT aid, name FROM Aircraft ORDER BY distance DESC LIMIT 1
可以覆盖最大距离的飞机的ID和名称是什么?
CREATE TABLE Aircraft (name VARCHAR, distance VARCHAR)
SELECT name FROM Aircraft ORDER BY distance LIMIT 3
显示前三个最低距离的飞机的名称。
CREATE TABLE Aircraft (name VARCHAR, distance VARCHAR)
SELECT name FROM Aircraft ORDER BY distance LIMIT 3
最短距离前3的飞机是什么?列出他们的名字。
CREATE TABLE Aircraft (distance INTEGER, name VARCHAR)
SELECT name FROM Aircraft WHERE distance > (SELECT AVG(distance) FROM Aircraft)
显示所有飞机的名称,其距离超过平均值。
CREATE TABLE Aircraft (distance INTEGER, name VARCHAR)
SELECT name FROM Aircraft WHERE distance > (SELECT AVG(distance) FROM Aircraft)
所有能覆盖平均距离的飞机的名称是什么?
CREATE TABLE Employee (Id VARCHAR)
SELECT COUNT(*) FROM Employee
我们有多少员工?
CREATE TABLE Employee (Id VARCHAR)
SELECT COUNT(*) FROM Employee
员工人数是多少?
CREATE TABLE Employee (name VARCHAR, salary VARCHAR)
SELECT name, salary FROM Employee ORDER BY salary
为所有员工按薪资排序,并显示姓名和薪金。
CREATE TABLE Employee (name VARCHAR, salary VARCHAR)
SELECT name, salary FROM Employee ORDER BY salary
所有员工的姓名和薪水是多少?
CREATE TABLE Employee (salary INTEGER, eid VARCHAR)
SELECT eid FROM Employee WHERE salary > 100000
显示所有工资至少有100000的工资员工。
CREATE TABLE Employee (salary INTEGER, eid VARCHAR)
SELECT eid FROM Employee WHERE salary > 100000
每一个工资至少有100000的员工的ID是多少?
CREATE TABLE Employee (salary INTEGER)
SELECT COUNT(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000
薪水在100000到200000的员工有多少?
CREATE TABLE Employee (salary INTEGER)
SELECT COUNT(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000
员工工资在100000到200000的人数是多少?
CREATE TABLE Employee (name VARCHAR, eid VARCHAR, salary VARCHAR)
SELECT name, salary FROM Employee WHERE eid = 242518965
ID为242518965的员工的姓名和薪水是多少?
CREATE TABLE Employee (name VARCHAR, eid VARCHAR, salary VARCHAR)
SELECT name, salary FROM Employee WHERE eid = 242518965
ID242518965的雇员的姓名和薪金是多少?
CREATE TABLE Employee (salary INTEGER)
SELECT AVG(salary), MAX(salary) FROM Employee
所有员工的平均工资和最高工资是多少?
CREATE TABLE Employee (salary INTEGER)
SELECT AVG(salary), MAX(salary) FROM Employee
所有员工的平均工资和最高工资是多少?
CREATE TABLE Employee (name VARCHAR, eid VARCHAR, salary VARCHAR)
SELECT eid, name FROM Employee ORDER BY salary DESC LIMIT 1
显示平均工资最高的员工的ID和姓名。
CREATE TABLE Employee (name VARCHAR, eid VARCHAR, salary VARCHAR)
SELECT eid, name FROM Employee ORDER BY salary DESC LIMIT 1
工资最高的员工的ID和姓名是什么?
CREATE TABLE Employee (name VARCHAR, salary VARCHAR)
SELECT name FROM Employee ORDER BY salary ASC LIMIT 3
显示工资最低的三名员工的姓名。
CREATE TABLE Employee (name VARCHAR, salary VARCHAR)
SELECT name FROM Employee ORDER BY salary ASC LIMIT 3
哪3个员工的薪水最少?
CREATE TABLE Employee (salary INTEGER, name VARCHAR)
SELECT name FROM Employee WHERE salary > (SELECT AVG(salary) FROM Employee)
显示所有薪水高于平均水平的员工。
CREATE TABLE Employee (salary INTEGER, name VARCHAR)
SELECT name FROM Employee WHERE salary > (SELECT AVG(salary) FROM Employee)
工资高于平均水平的所有员工的姓名是什么?
CREATE TABLE Employee (salary VARCHAR, eid VARCHAR, name VARCHAR)
SELECT eid, salary FROM Employee WHERE name = '张晓梅'
显示“张晓梅”的ID和薪水。
CREATE TABLE Employee (salary VARCHAR, eid VARCHAR, name VARCHAR)
SELECT eid, salary FROM Employee WHERE name = '张晓梅'
那个叫“张晓梅”的员工的ID和薪水是多少?
CREATE TABLE Flight (Id VARCHAR)
SELECT COUNT(*) FROM Flight
我们有多少班次?
CREATE TABLE Flight (Id VARCHAR)
SELECT COUNT(*) FROM Flight
航班的数量是多少?
CREATE TABLE Flight (origin VARCHAR, destination VARCHAR, flno VARCHAR)
SELECT flno, origin, destination FROM Flight ORDER BY origin
按照起飞城市的字母顺序显示所有航班的航班号、起点、目的地。
CREATE TABLE Flight (origin VARCHAR, destination VARCHAR, flno VARCHAR)
SELECT flno, origin, destination FROM Flight ORDER BY origin
按起飞城市的字母顺序排列的所有航班的航班号、起点和目的地是什么?
CREATE TABLE Flight (origin VARCHAR, flno VARCHAR)
SELECT flno FROM Flight WHERE origin = "上海"
显示所有从“上海”起飞的航班号。
CREATE TABLE Flight (origin VARCHAR, flno VARCHAR)
SELECT flno FROM Flight WHERE origin = "上海"
从“上海”来的所有航班的号码是多少?
CREATE TABLE Flight (destination VARCHAR, origin VARCHAR)
SELECT origin FROM Flight WHERE destination = "海口"
显示所有以“海口”为目的地航班的出发地。
CREATE TABLE Flight (destination VARCHAR, origin VARCHAR)
SELECT origin FROM Flight WHERE destination = "海口"
飞往“海口”的所有航班的出发地是什么?
CREATE TABLE Flight (destination VARCHAR, departure_date VARCHAR, arrival_date VARCHAR, origin VARCHAR)
SELECT departure_date, arrival_date FROM Flight WHERE origin = "上海" AND destination = "海口"
告诉我从“上海”到“海口”的所有航班的出发日期和到达日期。
CREATE TABLE Flight (destination VARCHAR, departure_date VARCHAR, arrival_date VARCHAR, origin VARCHAR)
SELECT departure_date, arrival_date FROM Flight WHERE origin = "上海" AND destination = "海口"
从“上海”到“海口”的所有航班的起飞和到达日期是什么?
CREATE TABLE Flight (distance INTEGER, flno VARCHAR)
SELECT flno FROM Flight WHERE distance > 2000
显示超过2000距离的所有航班的航班号。
CREATE TABLE Flight (distance INTEGER, flno VARCHAR)
SELECT flno FROM Flight WHERE distance > 2000
能覆盖超过2000的距离的所有航班的号码是多少?
CREATE TABLE Flight (destination VARCHAR, price INTEGER, origin VARCHAR)
SELECT AVG(price) FROM Flight WHERE origin = "上海" AND destination = "海口"
从“上海”到“海口”的航班平均价格是多少?
CREATE TABLE Flight (destination VARCHAR, price INTEGER, origin VARCHAR)
SELECT AVG(price) FROM Flight WHERE origin = "上海" AND destination = "海口"
从“上海”到“海口”的航班平均价格是多少?
CREATE TABLE Flight (destination VARCHAR, price INTEGER, origin VARCHAR)
SELECT origin, destination FROM Flight WHERE price > 300
显示价格高于300的航班的出发地和目的地。
CREATE TABLE Flight (destination VARCHAR, price INTEGER, origin VARCHAR)
SELECT origin, destination FROM Flight WHERE price > 300
价格高于300的航班的起点和目的地是什么?
CREATE TABLE Flight (distance VARCHAR, flno VARCHAR, price VARCHAR)
SELECT flno, distance FROM Flight ORDER BY price DESC LIMIT 1
显示最高价航班的航班号和飞行距离。
CREATE TABLE Flight (distance VARCHAR, flno VARCHAR, price VARCHAR)
SELECT flno, distance FROM Flight ORDER BY price DESC LIMIT 1
最高价航班的航班号和距离是多少?
CREATE TABLE Flight (distance VARCHAR, flno VARCHAR)
SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3
显示三个最低距离的航班号。