text2SQL
stringlengths 192
7.27k
|
---|
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 空调品牌 (
词条id,
名称,
所属公司,
国家,
亚洲企业排名,
中国上市公司排名)
CREATE TABLE 空调型号 (
词条id,
名称,
毛重,
频数类型,
匹数,
类别,
用途,
制冷量,
制热量,
定价,
制冷剂,
品牌id)
CREATE TABLE 匹数对应面积 (
匹数,
最小面积,
最大面积)
CREATE TABLE 空调各季度售卖 (
型号id,
季度,
售价,
最高价格,
最低价格,
售卖量)
CREATE TABLE 空调各城市售卖 (
城市,
空调售卖量,
空调日平均用时)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各品牌的空调型号中,都有哪些空调品牌,它们都属于哪个公司,以及一共多少毛重
SELECT### Response: select T2.所属公司 , T2.名称 , sum ( T1.毛重 ) from 空调型号 as T1 join 空调品牌 as T2 on 空调型号.品牌id == 空调品牌.词条id group by T1.品牌id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 空调品牌 (
词条id,
名称,
所属公司,
国家,
亚洲企业排名,
中国上市公司排名)
CREATE TABLE 空调型号 (
词条id,
名称,
毛重,
频数类型,
匹数,
类别,
用途,
制冷量,
制热量,
定价,
制冷剂,
品牌id)
CREATE TABLE 匹数对应面积 (
匹数,
最小面积,
最大面积)
CREATE TABLE 空调各季度售卖 (
型号id,
季度,
售价,
最高价格,
最低价格,
售卖量)
CREATE TABLE 空调各城市售卖 (
城市,
空调售卖量,
空调日平均用时)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各品牌的空调型号中,都有哪些空调品牌,它们都属于哪个公司,以及平均多少毛重
SELECT### Response: select T2.所属公司 , T2.名称 , avg ( T1.毛重 ) from 空调型号 as T1 join 空调品牌 as T2 on 空调型号.品牌id == 空调品牌.词条id group by T1.品牌id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 空调品牌 (
词条id,
名称,
所属公司,
国家,
亚洲企业排名,
中国上市公司排名)
CREATE TABLE 空调型号 (
词条id,
名称,
毛重,
频数类型,
匹数,
类别,
用途,
制冷量,
制热量,
定价,
制冷剂,
品牌id)
CREATE TABLE 匹数对应面积 (
匹数,
最小面积,
最大面积)
CREATE TABLE 空调各季度售卖 (
型号id,
季度,
售价,
最高价格,
最低价格,
售卖量)
CREATE TABLE 空调各城市售卖 (
城市,
空调售卖量,
空调日平均用时)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各品牌的空调型号中,都有哪些空调品牌,它们都属于哪个公司,以及最高多少毛重
SELECT### Response: select T2.所属公司 , T2.名称 , max ( T1.毛重 ) from 空调型号 as T1 join 空调品牌 as T2 on 空调型号.品牌id == 空调品牌.词条id group by T1.品牌id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 空调品牌 (
词条id,
名称,
所属公司,
国家,
亚洲企业排名,
中国上市公司排名)
CREATE TABLE 空调型号 (
词条id,
名称,
毛重,
频数类型,
匹数,
类别,
用途,
制冷量,
制热量,
定价,
制冷剂,
品牌id)
CREATE TABLE 匹数对应面积 (
匹数,
最小面积,
最大面积)
CREATE TABLE 空调各季度售卖 (
型号id,
季度,
售价,
最高价格,
最低价格,
售卖量)
CREATE TABLE 空调各城市售卖 (
城市,
空调售卖量,
空调日平均用时)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各品牌的空调型号中,都有哪些空调品牌,它们都属于哪个公司,以及最少多少毛重
SELECT### Response: select T2.所属公司 , T2.名称 , min ( T1.毛重 ) from 空调型号 as T1 join 空调品牌 as T2 on 空调型号.品牌id == 空调品牌.词条id group by T1.品牌id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 应用商店 (
词条id,
名称,
应用软件数,
累计下载次数)
CREATE TABLE 应用商店支持国家 (
应用商店id,
国家,
用户是否可以购买应用程序,
开发人员是否可以出售应用程序)
CREATE TABLE 软件 (
词条id,
名称,
用途)
CREATE TABLE 软件下载量 (
软件id,
应用商店id,
下载量,
评价人数,
好评数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各软件的下载情况中,都有哪些软件,它们都有什么用途,以及软件一共下载多少次
SELECT### Response: select T2.用途 , T2.名称 , sum ( T1.下载量 ) from 软件下载量 as T1 join 软件 as T2 on 软件下载量.软件id == 软件.词条id group by T1.软件id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 应用商店 (
词条id,
名称,
应用软件数,
累计下载次数)
CREATE TABLE 应用商店支持国家 (
应用商店id,
国家,
用户是否可以购买应用程序,
开发人员是否可以出售应用程序)
CREATE TABLE 软件 (
词条id,
名称,
用途)
CREATE TABLE 软件下载量 (
软件id,
应用商店id,
下载量,
评价人数,
好评数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各软件的下载情况中,都有哪些软件,它们都有什么用途,以及软件平均下载多少次
SELECT### Response: select T2.用途 , T2.名称 , avg ( T1.下载量 ) from 软件下载量 as T1 join 软件 as T2 on 软件下载量.软件id == 软件.词条id group by T1.软件id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 应用商店 (
词条id,
名称,
应用软件数,
累计下载次数)
CREATE TABLE 应用商店支持国家 (
应用商店id,
国家,
用户是否可以购买应用程序,
开发人员是否可以出售应用程序)
CREATE TABLE 软件 (
词条id,
名称,
用途)
CREATE TABLE 软件下载量 (
软件id,
应用商店id,
下载量,
评价人数,
好评数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各软件的下载情况中,都有哪些软件,它们都有什么用途,以及软件最少下载多少次
SELECT### Response: select T2.用途 , T2.名称 , min ( T1.下载量 ) from 软件下载量 as T1 join 软件 as T2 on 软件下载量.软件id == 软件.词条id group by T1.软件id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 应用商店 (
词条id,
名称,
应用软件数,
累计下载次数)
CREATE TABLE 应用商店支持国家 (
应用商店id,
国家,
用户是否可以购买应用程序,
开发人员是否可以出售应用程序)
CREATE TABLE 软件 (
词条id,
名称,
用途)
CREATE TABLE 软件下载量 (
软件id,
应用商店id,
下载量,
评价人数,
好评数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各软件的下载情况中,都有哪些软件,它们都有什么用途,以及软件最多下载多少次
SELECT### Response: select T2.用途 , T2.名称 , max ( T1.下载量 ) from 软件下载量 as T1 join 软件 as T2 on 软件下载量.软件id == 软件.词条id group by T1.软件id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 公司 (
词条id,
名称,
总部地点,
成立时间,
创始人,
首席执行官,
年营业额,
员工数)
CREATE TABLE 品牌 (
词条id,
名称,
成立时间,
所属公司id,
法定代表人,
注册资本)
CREATE TABLE 公司品牌历年收入 (
年份,
品牌id,
营收,
利润,
营收同比增长,
利润同比增长)
CREATE TABLE 公司各品牌收入排名 (
公司id,
品牌id,
营收占比,
利润占比,
支出占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各品牌的历年收入中,都有哪些品牌,它们的法定代表人都是谁,以及公司品牌历年平均多少营收
SELECT### Response: select T2.法定代表人 , T2.名称 , avg ( T1.营收 ) from 公司品牌历年收入 as T1 join 品牌 as T2 on 公司品牌历年收入.品牌id == 品牌.词条id group by T1.品牌id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 公司 (
词条id,
名称,
总部地点,
成立时间,
创始人,
首席执行官,
年营业额,
员工数)
CREATE TABLE 品牌 (
词条id,
名称,
成立时间,
所属公司id,
法定代表人,
注册资本)
CREATE TABLE 公司品牌历年收入 (
年份,
品牌id,
营收,
利润,
营收同比增长,
利润同比增长)
CREATE TABLE 公司各品牌收入排名 (
公司id,
品牌id,
营收占比,
利润占比,
支出占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各品牌的历年收入中,都有哪些品牌,它们的法定代表人都是谁,以及公司品牌历年最少多少营收
SELECT### Response: select T2.法定代表人 , T2.名称 , min ( T1.营收 ) from 公司品牌历年收入 as T1 join 品牌 as T2 on 公司品牌历年收入.品牌id == 品牌.词条id group by T1.品牌id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 公司 (
词条id,
名称,
总部地点,
成立时间,
创始人,
首席执行官,
年营业额,
员工数)
CREATE TABLE 品牌 (
词条id,
名称,
成立时间,
所属公司id,
法定代表人,
注册资本)
CREATE TABLE 公司品牌历年收入 (
年份,
品牌id,
营收,
利润,
营收同比增长,
利润同比增长)
CREATE TABLE 公司各品牌收入排名 (
公司id,
品牌id,
营收占比,
利润占比,
支出占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各品牌的历年收入中,都有哪些品牌,它们的法定代表人都是谁,以及公司品牌历年一共多少营收
SELECT### Response: select T2.法定代表人 , T2.名称 , sum ( T1.营收 ) from 公司品牌历年收入 as T1 join 品牌 as T2 on 公司品牌历年收入.品牌id == 品牌.词条id group by T1.品牌id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 公司 (
词条id,
名称,
总部地点,
成立时间,
创始人,
首席执行官,
年营业额,
员工数)
CREATE TABLE 品牌 (
词条id,
名称,
成立时间,
所属公司id,
法定代表人,
注册资本)
CREATE TABLE 公司品牌历年收入 (
年份,
品牌id,
营收,
利润,
营收同比增长,
利润同比增长)
CREATE TABLE 公司各品牌收入排名 (
公司id,
品牌id,
营收占比,
利润占比,
支出占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各品牌的历年收入中,都有哪些品牌,它们的法定代表人都是谁,以及公司品牌历年最多多少营收
SELECT### Response: select T2.法定代表人 , T2.名称 , max ( T1.营收 ) from 公司品牌历年收入 as T1 join 品牌 as T2 on 公司品牌历年收入.品牌id == 品牌.词条id group by T1.品牌id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 火车站 (
词条id,
名称,
所属城市,
是否有地铁站,
距机场距离,
距汽车站距离,
距市中心距离)
CREATE TABLE 列车 (
词条id,
名称,
类型,
始发站id,
到达站id,
出发时间,
到达时间)
CREATE TABLE 列车票价 (
日期,
列车id,
车票类型,
票价,
余票)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各列车各类型车票的价格中,都有哪些列车,它们都是什么类型的,以及票价一共多少
SELECT### Response: select T2.类型 , T2.名称 , sum ( T1.票价 ) from 列车票价 as T1 join 列车 as T2 on 列车票价.列车id == 列车.词条id group by T1.列车id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 火车站 (
词条id,
名称,
所属城市,
是否有地铁站,
距机场距离,
距汽车站距离,
距市中心距离)
CREATE TABLE 列车 (
词条id,
名称,
类型,
始发站id,
到达站id,
出发时间,
到达时间)
CREATE TABLE 列车票价 (
日期,
列车id,
车票类型,
票价,
余票)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各列车各类型车票的价格中,都有哪些列车,它们都是什么类型的,以及票价最高多少
SELECT### Response: select T2.类型 , T2.名称 , max ( T1.票价 ) from 列车票价 as T1 join 列车 as T2 on 列车票价.列车id == 列车.词条id group by T1.列车id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 火车站 (
词条id,
名称,
所属城市,
是否有地铁站,
距机场距离,
距汽车站距离,
距市中心距离)
CREATE TABLE 列车 (
词条id,
名称,
类型,
始发站id,
到达站id,
出发时间,
到达时间)
CREATE TABLE 列车票价 (
日期,
列车id,
车票类型,
票价,
余票)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各列车各类型车票的价格中,都有哪些列车,它们都是什么类型的,以及票价平均多少
SELECT### Response: select T2.类型 , T2.名称 , avg ( T1.票价 ) from 列车票价 as T1 join 列车 as T2 on 列车票价.列车id == 列车.词条id group by T1.列车id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 火车站 (
词条id,
名称,
所属城市,
是否有地铁站,
距机场距离,
距汽车站距离,
距市中心距离)
CREATE TABLE 列车 (
词条id,
名称,
类型,
始发站id,
到达站id,
出发时间,
到达时间)
CREATE TABLE 列车票价 (
日期,
列车id,
车票类型,
票价,
余票)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各列车各类型车票的价格中,都有哪些列车,它们都是什么类型的,以及票价最低多少
SELECT### Response: select T2.类型 , T2.名称 , min ( T1.票价 ) from 列车票价 as T1 join 列车 as T2 on 列车票价.列车id == 列车.词条id group by T1.列车id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 公司 (
词条id,
名称,
总部地点,
成立时间,
创始人,
首席执行官,
年营业额,
员工数)
CREATE TABLE 品牌 (
词条id,
名称,
成立时间,
所属公司id,
法定代表人,
注册资本)
CREATE TABLE 公司品牌历年收入 (
年份,
品牌id,
营收,
利润,
营收同比增长,
利润同比增长)
CREATE TABLE 公司各品牌收入排名 (
公司id,
品牌id,
营收占比,
利润占比,
支出占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--各品牌都属于哪些公司,它们的总部都在哪,以及一共有多少注册资本
SELECT### Response: select T2.总部地点 , T2.名称 , sum ( T1.注册资本 ) from 品牌 as T1 join 公司 as T2 on 品牌.所属公司id == 公司.词条id group by T1.所属公司id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 公司 (
词条id,
名称,
总部地点,
成立时间,
创始人,
首席执行官,
年营业额,
员工数)
CREATE TABLE 品牌 (
词条id,
名称,
成立时间,
所属公司id,
法定代表人,
注册资本)
CREATE TABLE 公司品牌历年收入 (
年份,
品牌id,
营收,
利润,
营收同比增长,
利润同比增长)
CREATE TABLE 公司各品牌收入排名 (
公司id,
品牌id,
营收占比,
利润占比,
支出占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--各品牌都属于哪些公司,它们的总部都在哪,以及最多有多少注册资本
SELECT### Response: select T2.总部地点 , T2.名称 , max ( T1.注册资本 ) from 品牌 as T1 join 公司 as T2 on 品牌.所属公司id == 公司.词条id group by T1.所属公司id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 公司 (
词条id,
名称,
总部地点,
成立时间,
创始人,
首席执行官,
年营业额,
员工数)
CREATE TABLE 品牌 (
词条id,
名称,
成立时间,
所属公司id,
法定代表人,
注册资本)
CREATE TABLE 公司品牌历年收入 (
年份,
品牌id,
营收,
利润,
营收同比增长,
利润同比增长)
CREATE TABLE 公司各品牌收入排名 (
公司id,
品牌id,
营收占比,
利润占比,
支出占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--各品牌都属于哪些公司,它们的总部都在哪,以及最少有多少注册资本
SELECT### Response: select T2.总部地点 , T2.名称 , min ( T1.注册资本 ) from 品牌 as T1 join 公司 as T2 on 品牌.所属公司id == 公司.词条id group by T1.所属公司id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 公司 (
词条id,
名称,
总部地点,
成立时间,
创始人,
首席执行官,
年营业额,
员工数)
CREATE TABLE 品牌 (
词条id,
名称,
成立时间,
所属公司id,
法定代表人,
注册资本)
CREATE TABLE 公司品牌历年收入 (
年份,
品牌id,
营收,
利润,
营收同比增长,
利润同比增长)
CREATE TABLE 公司各品牌收入排名 (
公司id,
品牌id,
营收占比,
利润占比,
支出占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--各品牌都属于哪些公司,它们的总部都在哪,以及平均有多少注册资本
SELECT### Response: select T2.总部地点 , T2.名称 , avg ( T1.注册资本 ) from 品牌 as T1 join 公司 as T2 on 品牌.所属公司id == 公司.词条id group by T1.所属公司id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 篮球队 (
词条id,
队名,
所属地区,
成立时间,
主场馆,
容纳人数,
主教练,
赞助商家)
CREATE TABLE 篮球运动员 (
词条id,
姓名,
国籍,
民族,
出生地,
出生日期,
身高,
体重,
所属球队id,
场上位置)
CREATE TABLE 运动员赛事记录 (
球员id,
赛事,
类别)
CREATE TABLE CBA总冠军 (
赛季,
冠军球队id,
亚军球队id)
CREATE TABLE 最有价值球员 (
赛季,
球员id,
球队id)
-- Using valid SQLite, answer the following questions for the tables provided above.
--篮球球员属于球队都有哪些,它们都属于哪个地区,以及运动员的平均身高是多少
SELECT### Response: select T2.所属地区 , T2.队名 , avg ( T1.身高 ) from 篮球运动员 as T1 join 篮球队 as T2 on 篮球运动员.所属球队id == 篮球队.词条id group by T1.所属球队id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 篮球队 (
词条id,
队名,
所属地区,
成立时间,
主场馆,
容纳人数,
主教练,
赞助商家)
CREATE TABLE 篮球运动员 (
词条id,
姓名,
国籍,
民族,
出生地,
出生日期,
身高,
体重,
所属球队id,
场上位置)
CREATE TABLE 运动员赛事记录 (
球员id,
赛事,
类别)
CREATE TABLE CBA总冠军 (
赛季,
冠军球队id,
亚军球队id)
CREATE TABLE 最有价值球员 (
赛季,
球员id,
球队id)
-- Using valid SQLite, answer the following questions for the tables provided above.
--篮球球员属于球队都有哪些,它们都属于哪个地区,以及运动员身高最矮的是多少
SELECT### Response: select T2.所属地区 , T2.队名 , min ( T1.身高 ) from 篮球运动员 as T1 join 篮球队 as T2 on 篮球运动员.所属球队id == 篮球队.词条id group by T1.所属球队id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 篮球队 (
词条id,
队名,
所属地区,
成立时间,
主场馆,
容纳人数,
主教练,
赞助商家)
CREATE TABLE 篮球运动员 (
词条id,
姓名,
国籍,
民族,
出生地,
出生日期,
身高,
体重,
所属球队id,
场上位置)
CREATE TABLE 运动员赛事记录 (
球员id,
赛事,
类别)
CREATE TABLE CBA总冠军 (
赛季,
冠军球队id,
亚军球队id)
CREATE TABLE 最有价值球员 (
赛季,
球员id,
球队id)
-- Using valid SQLite, answer the following questions for the tables provided above.
--篮球球员属于球队都有哪些,它们都属于哪个地区,以及运动员身高最高的是多少
SELECT### Response: select T2.所属地区 , T2.队名 , max ( T1.身高 ) from 篮球运动员 as T1 join 篮球队 as T2 on 篮球运动员.所属球队id == 篮球队.词条id group by T1.所属球队id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 篮球队 (
词条id,
队名,
所属地区,
成立时间,
主场馆,
容纳人数,
主教练,
赞助商家)
CREATE TABLE 篮球运动员 (
词条id,
姓名,
国籍,
民族,
出生地,
出生日期,
身高,
体重,
所属球队id,
场上位置)
CREATE TABLE 运动员赛事记录 (
球员id,
赛事,
类别)
CREATE TABLE CBA总冠军 (
赛季,
冠军球队id,
亚军球队id)
CREATE TABLE 最有价值球员 (
赛季,
球员id,
球队id)
-- Using valid SQLite, answer the following questions for the tables provided above.
--篮球球员属于球队都有哪些,它们都属于哪个地区,以及运动员的总身高是多少
SELECT### Response: select T2.所属地区 , T2.队名 , sum ( T1.身高 ) from 篮球运动员 as T1 join 篮球队 as T2 on 篮球运动员.所属球队id == 篮球队.词条id group by T1.所属球队id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 车展 (
词条id,
名称,
车展时间,
参展天数,
车展地点,
位于城市,
参展品牌数)
CREATE TABLE 汽车品牌 (
词条id,
名称,
所属公司,
最低价格,
最高价格,
代言人)
CREATE TABLE 车展参展品牌 (
品牌id,
车展id,
站台模特,
热度排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各车展参展的品牌中,都有哪些车展,它们都在哪里举办的,以及参展品牌最小热度排名是多少
SELECT### Response: select T2.车展地点 , T2.名称 , min ( T1.热度排名 ) from 车展参展品牌 as T1 join 车展 as T2 on 车展参展品牌.车展id == 车展.词条id group by T1.车展id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 车展 (
词条id,
名称,
车展时间,
参展天数,
车展地点,
位于城市,
参展品牌数)
CREATE TABLE 汽车品牌 (
词条id,
名称,
所属公司,
最低价格,
最高价格,
代言人)
CREATE TABLE 车展参展品牌 (
品牌id,
车展id,
站台模特,
热度排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各车展参展的品牌中,都有哪些车展,它们都在哪里举办的,以及参展品牌最大热度排名是多少
SELECT### Response: select T2.车展地点 , T2.名称 , max ( T1.热度排名 ) from 车展参展品牌 as T1 join 车展 as T2 on 车展参展品牌.车展id == 车展.词条id group by T1.车展id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 车展 (
词条id,
名称,
车展时间,
参展天数,
车展地点,
位于城市,
参展品牌数)
CREATE TABLE 汽车品牌 (
词条id,
名称,
所属公司,
最低价格,
最高价格,
代言人)
CREATE TABLE 车展参展品牌 (
品牌id,
车展id,
站台模特,
热度排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各车展参展的品牌中,都有哪些车展,它们都在哪里举办的,以及参展品牌的总热度排名是多少
SELECT### Response: select T2.车展地点 , T2.名称 , sum ( T1.热度排名 ) from 车展参展品牌 as T1 join 车展 as T2 on 车展参展品牌.车展id == 车展.词条id group by T1.车展id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 车展 (
词条id,
名称,
车展时间,
参展天数,
车展地点,
位于城市,
参展品牌数)
CREATE TABLE 汽车品牌 (
词条id,
名称,
所属公司,
最低价格,
最高价格,
代言人)
CREATE TABLE 车展参展品牌 (
品牌id,
车展id,
站台模特,
热度排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各车展参展的品牌中,都有哪些车展,它们都在哪里举办的,以及参展品牌的平均热度排名是多少
SELECT### Response: select T2.车展地点 , T2.名称 , avg ( T1.热度排名 ) from 车展参展品牌 as T1 join 车展 as T2 on 车展参展品牌.车展id == 车展.词条id group by T1.车展id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 商场 (
词条id,
名称,
地址,
开业时间)
CREATE TABLE 商家 (
词条id,
名称,
类型)
CREATE TABLE 商家入驻商场 (
商家id,
商场id,
楼层,
占地面积)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各商场的商家中,都有哪些商场,它们都在什么地方,以及入驻商场平均占地多少
SELECT### Response: select T2.地址 , T2.名称 , avg ( T1.占地面积 ) from 商家入驻商场 as T1 join 商场 as T2 on 商家入驻商场.商场id == 商场.词条id group by T1.商场id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 商场 (
词条id,
名称,
地址,
开业时间)
CREATE TABLE 商家 (
词条id,
名称,
类型)
CREATE TABLE 商家入驻商场 (
商家id,
商场id,
楼层,
占地面积)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各商场的商家中,都有哪些商场,它们都在什么地方,以及入驻商场最多占地多少
SELECT### Response: select T2.地址 , T2.名称 , max ( T1.占地面积 ) from 商家入驻商场 as T1 join 商场 as T2 on 商家入驻商场.商场id == 商场.词条id group by T1.商场id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 商场 (
词条id,
名称,
地址,
开业时间)
CREATE TABLE 商家 (
词条id,
名称,
类型)
CREATE TABLE 商家入驻商场 (
商家id,
商场id,
楼层,
占地面积)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各商场的商家中,都有哪些商场,它们都在什么地方,以及入驻商场一共占地多少
SELECT### Response: select T2.地址 , T2.名称 , sum ( T1.占地面积 ) from 商家入驻商场 as T1 join 商场 as T2 on 商家入驻商场.商场id == 商场.词条id group by T1.商场id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 商场 (
词条id,
名称,
地址,
开业时间)
CREATE TABLE 商家 (
词条id,
名称,
类型)
CREATE TABLE 商家入驻商场 (
商家id,
商场id,
楼层,
占地面积)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各商场的商家中,都有哪些商场,它们都在什么地方,以及入驻商场最少占地多少
SELECT### Response: select T2.地址 , T2.名称 , min ( T1.占地面积 ) from 商家入驻商场 as T1 join 商场 as T2 on 商家入驻商场.商场id == 商场.词条id group by T1.商场id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 学校 (
词条id,
名称,
所在省份,
类型,
是否985,
是否211)
CREATE TABLE 省份 (
词条id,
省名,
2018年考生数量,
985高校数量,
211高校数量)
CREATE TABLE 各省高校招生计划 (
学校id,
省份id,
招生人数)
CREATE TABLE 专业 (
词条id,
专业名称,
学科类型,
学制)
CREATE TABLE 清华大学招生计划 (
专业id,
省份id,
招考类型,
学费,
招生人数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在清华大学各专业的招生计划中,都有哪些专业,它们的学科都是什么类型的,以及招生计划一共有多少学费
SELECT### Response: select T2.学科类型 , T2.专业名称 , sum ( T1.学费 ) from 清华大学招生计划 as T1 join 专业 as T2 on 清华大学招生计划.省份id == 专业.词条id group by T1.省份id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 学校 (
词条id,
名称,
所在省份,
类型,
是否985,
是否211)
CREATE TABLE 省份 (
词条id,
省名,
2018年考生数量,
985高校数量,
211高校数量)
CREATE TABLE 各省高校招生计划 (
学校id,
省份id,
招生人数)
CREATE TABLE 专业 (
词条id,
专业名称,
学科类型,
学制)
CREATE TABLE 清华大学招生计划 (
专业id,
省份id,
招考类型,
学费,
招生人数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在清华大学各专业的招生计划中,都有哪些专业,它们的学科都是什么类型的,以及招生计划中最多多少学费
SELECT### Response: select T2.学科类型 , T2.专业名称 , max ( T1.学费 ) from 清华大学招生计划 as T1 join 专业 as T2 on 清华大学招生计划.省份id == 专业.词条id group by T1.省份id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 学校 (
词条id,
名称,
所在省份,
类型,
是否985,
是否211)
CREATE TABLE 省份 (
词条id,
省名,
2018年考生数量,
985高校数量,
211高校数量)
CREATE TABLE 各省高校招生计划 (
学校id,
省份id,
招生人数)
CREATE TABLE 专业 (
词条id,
专业名称,
学科类型,
学制)
CREATE TABLE 清华大学招生计划 (
专业id,
省份id,
招考类型,
学费,
招生人数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在清华大学各专业的招生计划中,都有哪些专业,它们的学科都是什么类型的,以及招生计划中最少多少学费
SELECT### Response: select T2.学科类型 , T2.专业名称 , min ( T1.学费 ) from 清华大学招生计划 as T1 join 专业 as T2 on 清华大学招生计划.省份id == 专业.词条id group by T1.省份id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 学校 (
词条id,
名称,
所在省份,
类型,
是否985,
是否211)
CREATE TABLE 省份 (
词条id,
省名,
2018年考生数量,
985高校数量,
211高校数量)
CREATE TABLE 各省高校招生计划 (
学校id,
省份id,
招生人数)
CREATE TABLE 专业 (
词条id,
专业名称,
学科类型,
学制)
CREATE TABLE 清华大学招生计划 (
专业id,
省份id,
招考类型,
学费,
招生人数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在清华大学各专业的招生计划中,都有哪些专业,它们的学科都是什么类型的,以及招生计划平均有多少学费
SELECT### Response: select T2.学科类型 , T2.专业名称 , avg ( T1.学费 ) from 清华大学招生计划 as T1 join 专业 as T2 on 清华大学招生计划.省份id == 专业.词条id group by T1.省份id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 书籍 (
词条id,
名称,
作者,
作者国籍,
豆瓣评分,
评价人数,
5星占比,
1星占比)
CREATE TABLE 高分图书榜单 (
年份,
书籍id,
评分,
排名)
CREATE TABLE 最受关注图书榜单 (
年份,
书籍id,
关注数,
排名)
CREATE TABLE 最畅销图书榜单 (
年份,
书籍id,
购买数,
排名)
CREATE TABLE 购买平台 (
书籍id,
平台,
售价,
是否有货)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各平台图书售卖情况中,都有哪些书籍,它们都是谁写的,以及总共卖多少钱
SELECT### Response: select T2.作者 , T2.名称 , sum ( T1.售价 ) from 购买平台 as T1 join 书籍 as T2 on 购买平台.书籍id == 书籍.词条id group by T1.书籍id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 书籍 (
词条id,
名称,
作者,
作者国籍,
豆瓣评分,
评价人数,
5星占比,
1星占比)
CREATE TABLE 高分图书榜单 (
年份,
书籍id,
评分,
排名)
CREATE TABLE 最受关注图书榜单 (
年份,
书籍id,
关注数,
排名)
CREATE TABLE 最畅销图书榜单 (
年份,
书籍id,
购买数,
排名)
CREATE TABLE 购买平台 (
书籍id,
平台,
售价,
是否有货)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各平台图书售卖情况中,都有哪些书籍,它们都是谁写的,以及最低卖多少钱
SELECT### Response: select T2.作者 , T2.名称 , min ( T1.售价 ) from 购买平台 as T1 join 书籍 as T2 on 购买平台.书籍id == 书籍.词条id group by T1.书籍id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 书籍 (
词条id,
名称,
作者,
作者国籍,
豆瓣评分,
评价人数,
5星占比,
1星占比)
CREATE TABLE 高分图书榜单 (
年份,
书籍id,
评分,
排名)
CREATE TABLE 最受关注图书榜单 (
年份,
书籍id,
关注数,
排名)
CREATE TABLE 最畅销图书榜单 (
年份,
书籍id,
购买数,
排名)
CREATE TABLE 购买平台 (
书籍id,
平台,
售价,
是否有货)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各平台图书售卖情况中,都有哪些书籍,它们都是谁写的,以及平均卖多少钱
SELECT### Response: select T2.作者 , T2.名称 , avg ( T1.售价 ) from 购买平台 as T1 join 书籍 as T2 on 购买平台.书籍id == 书籍.词条id group by T1.书籍id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 书籍 (
词条id,
名称,
作者,
作者国籍,
豆瓣评分,
评价人数,
5星占比,
1星占比)
CREATE TABLE 高分图书榜单 (
年份,
书籍id,
评分,
排名)
CREATE TABLE 最受关注图书榜单 (
年份,
书籍id,
关注数,
排名)
CREATE TABLE 最畅销图书榜单 (
年份,
书籍id,
购买数,
排名)
CREATE TABLE 购买平台 (
书籍id,
平台,
售价,
是否有货)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各平台图书售卖情况中,都有哪些书籍,它们都是谁写的,以及最高卖多少钱
SELECT### Response: select T2.作者 , T2.名称 , max ( T1.售价 ) from 购买平台 as T1 join 书籍 as T2 on 购买平台.书籍id == 书籍.词条id group by T1.书籍id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 会议 (
词条id,
名称,
成立时间,
级别)
CREATE TABLE 各会议论文 (
会议id,
年份,
长文提交量,
长文录取率,
短文提交量,
短文录取率)
CREATE TABLE 各会议论文大洲分布 (
会议id,
年份,
大洲,
提交数量占比)
CREATE TABLE 各会议论文国家分布 (
会议id,
年份,
国家,
提交数量占比)
CREATE TABLE 2019年会议各方向分布 (
方向名称,
会议id,
长文提交量,
长文录取率,
短文提交量,
短文录取率)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各会议历年各洲提交情况中,都有哪些会议,它们的级别都是什么,以及提交量的最小占比是多少
SELECT### Response: select T2.级别 , T2.名称 , min ( T1.提交数量占比 ) from 各会议论文大洲分布 as T1 join 会议 as T2 on 各会议论文大洲分布.会议id == 会议.词条id group by T1.会议id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 会议 (
词条id,
名称,
成立时间,
级别)
CREATE TABLE 各会议论文 (
会议id,
年份,
长文提交量,
长文录取率,
短文提交量,
短文录取率)
CREATE TABLE 各会议论文大洲分布 (
会议id,
年份,
大洲,
提交数量占比)
CREATE TABLE 各会议论文国家分布 (
会议id,
年份,
国家,
提交数量占比)
CREATE TABLE 2019年会议各方向分布 (
方向名称,
会议id,
长文提交量,
长文录取率,
短文提交量,
短文录取率)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各会议历年各洲提交情况中,都有哪些会议,它们的级别都是什么,以及提交量的总占比是多少
SELECT### Response: select T2.级别 , T2.名称 , sum ( T1.提交数量占比 ) from 各会议论文大洲分布 as T1 join 会议 as T2 on 各会议论文大洲分布.会议id == 会议.词条id group by T1.会议id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 会议 (
词条id,
名称,
成立时间,
级别)
CREATE TABLE 各会议论文 (
会议id,
年份,
长文提交量,
长文录取率,
短文提交量,
短文录取率)
CREATE TABLE 各会议论文大洲分布 (
会议id,
年份,
大洲,
提交数量占比)
CREATE TABLE 各会议论文国家分布 (
会议id,
年份,
国家,
提交数量占比)
CREATE TABLE 2019年会议各方向分布 (
方向名称,
会议id,
长文提交量,
长文录取率,
短文提交量,
短文录取率)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各会议历年各洲提交情况中,都有哪些会议,它们的级别都是什么,以及提交量的平均占比是多少
SELECT### Response: select T2.级别 , T2.名称 , avg ( T1.提交数量占比 ) from 各会议论文大洲分布 as T1 join 会议 as T2 on 各会议论文大洲分布.会议id == 会议.词条id group by T1.会议id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 会议 (
词条id,
名称,
成立时间,
级别)
CREATE TABLE 各会议论文 (
会议id,
年份,
长文提交量,
长文录取率,
短文提交量,
短文录取率)
CREATE TABLE 各会议论文大洲分布 (
会议id,
年份,
大洲,
提交数量占比)
CREATE TABLE 各会议论文国家分布 (
会议id,
年份,
国家,
提交数量占比)
CREATE TABLE 2019年会议各方向分布 (
方向名称,
会议id,
长文提交量,
长文录取率,
短文提交量,
短文录取率)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各会议历年各洲提交情况中,都有哪些会议,它们的级别都是什么,以及提交量的最大占比是多少
SELECT### Response: select T2.级别 , T2.名称 , max ( T1.提交数量占比 ) from 各会议论文大洲分布 as T1 join 会议 as T2 on 各会议论文大洲分布.会议id == 会议.词条id group by T1.会议id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 电商 (
词条id,
名称,
所属公司,
类型,
影响力指数,
排名,
上线国家数量)
CREATE TABLE 电商覆盖国家 (
电商id,
支持国家,
上线时间,
负责的分公司名称)
CREATE TABLE 商家 (
词条id,
名称,
所属国家,
主营类别,
网店覆盖国家数量,
实体店数量,
入驻电商数量)
CREATE TABLE 商家网点覆盖国家 (
商家id,
国家,
实体店数量,
年平均营业额)
CREATE TABLE 商家交易额 (
商家id,
电商平台id,
上线品类数量,
促销品类数量,
平均折扣,
交易额,
占全年销售额比例)
CREATE TABLE 电商活动交易额 (
电商平台id,
活动日,
参加活动商家数量,
促销商品数量,
交易额)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各电商平台在活动日的交易额中,都有哪些电商,它们都属于哪个公司,以及最多有多少商家参加活动
SELECT### Response: select T2.所属公司 , T2.名称 , max ( T1.参加活动商家数量 ) from 电商活动交易额 as T1 join 电商 as T2 on 电商活动交易额.电商平台id == 电商.词条id group by T1.电商平台id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 电商 (
词条id,
名称,
所属公司,
类型,
影响力指数,
排名,
上线国家数量)
CREATE TABLE 电商覆盖国家 (
电商id,
支持国家,
上线时间,
负责的分公司名称)
CREATE TABLE 商家 (
词条id,
名称,
所属国家,
主营类别,
网店覆盖国家数量,
实体店数量,
入驻电商数量)
CREATE TABLE 商家网点覆盖国家 (
商家id,
国家,
实体店数量,
年平均营业额)
CREATE TABLE 商家交易额 (
商家id,
电商平台id,
上线品类数量,
促销品类数量,
平均折扣,
交易额,
占全年销售额比例)
CREATE TABLE 电商活动交易额 (
电商平台id,
活动日,
参加活动商家数量,
促销商品数量,
交易额)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在各电商平台在活动日的交易额中,都有哪些电商,它们都属于哪个公司,以及最少有多少商家参加活动
SELECT### Response: select T2.所属公司 , T2.名称 , min ( T1.参加活动商家数量 ) from 电商活动交易额 as T1 join 电商 as T2 on 电商活动交易额.电商平台id == 电商.词条id group by T1.电商平台id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 城市 (
词条id,
名称,
所属省份,
垃圾产出量(万吨),
垃圾场数量)
CREATE TABLE 城市垃圾来源 (
城市id,
来源,
产出吨数,
总量占比)
CREATE TABLE 垃圾分类的城市 (
城市id,
实施时间,
分类体系,
最低罚款数,
最高罚款数,
厨余垃圾运输车辆,
有害垃圾运输车辆,
覆盖家庭比例,
志愿者数量)
-- Using valid SQLite, answer the following questions for the tables provided above.
--垃圾产出总共至少50吨的有哪些城市,它们属于哪些省?
SELECT### Response: select T2.所属省份 , T2.名称 from 城市垃圾来源 as T1 join 城市 as T2 on 城市垃圾来源.城市id == 城市.词条id group by T1.城市id having sum ( T1.产出吨数 ) >= 50. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 城市 (
词条id,
名称,
所属省份,
垃圾产出量(万吨),
垃圾场数量)
CREATE TABLE 城市垃圾来源 (
城市id,
来源,
产出吨数,
总量占比)
CREATE TABLE 垃圾分类的城市 (
城市id,
实施时间,
分类体系,
最低罚款数,
最高罚款数,
厨余垃圾运输车辆,
有害垃圾运输车辆,
覆盖家庭比例,
志愿者数量)
-- Using valid SQLite, answer the following questions for the tables provided above.
--垃圾来源多于五个的有哪些市,它们属于哪些省?
SELECT### Response: select T2.所属省份 , T2.名称 from 城市垃圾来源 as T1 join 城市 as T2 on 城市垃圾来源.城市id == 城市.词条id group by T1.城市id having count ( * ) > 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 山峰 (
词条id,
名称,
所属山系,
海拔,
首次登顶时间,
排名)
CREATE TABLE 国家 (
词条id,
名称,
所属洲)
CREATE TABLE 山峰的国家 (
山峰id,
起点国家id,
终点国家id,
走向)
CREATE TABLE 景点 (
词条id,
名称,
山峰id,
门票价格,
游玩季节)
-- Using valid SQLite, answer the following questions for the tables provided above.
--有景点至少5个的有哪些山峰,它们属于哪些山系?
SELECT### Response: select T2.所属山系 , T2.名称 from 景点 as T1 join 山峰 as T2 on 景点.山峰id == 山峰.词条id group by T1.山峰id having count ( * ) >= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 汽车公司 (
词条id,
名称,
所属国家,
经营范围,
母公司,
主要车系数量,
世界500强排名,
主要荣誉)
CREATE TABLE 汽车公司中国事业部 (
公司id,
中国事业部名称,
位于城市,
所属省份,
总投资金额,
负责产品数量,
主要产品)
CREATE TABLE 汽车产品 (
词条id,
名称,
推出时间,
车型,
车款数量,
保值率,
生产公司id)
CREATE TABLE 车型 (
词条id,
名称,
排量,
油耗,
售价,
所属产品id,
关注指数,
累计销量,
安全排行,
性能排行,
油耗排行,
空间排行,
舒适排行)
-- Using valid SQLite, answer the following questions for the tables provided above.
--汽车产品平均有5种的汽车公司有哪些,它们属于哪个国家
SELECT### Response: select T2.所属国家 , T2.名称 from 汽车产品 as T1 join 汽车公司 as T2 on 汽车产品.生产公司id == 汽车公司.词条id group by T1.生产公司id having avg ( T1.车款数量 ) == 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 汽车公司 (
词条id,
名称,
所属国家,
经营范围,
母公司,
主要车系数量,
世界500强排名,
主要荣誉)
CREATE TABLE 汽车公司中国事业部 (
公司id,
中国事业部名称,
位于城市,
所属省份,
总投资金额,
负责产品数量,
主要产品)
CREATE TABLE 汽车产品 (
词条id,
名称,
推出时间,
车型,
车款数量,
保值率,
生产公司id)
CREATE TABLE 车型 (
词条id,
名称,
排量,
油耗,
售价,
所属产品id,
关注指数,
累计销量,
安全排行,
性能排行,
油耗排行,
空间排行,
舒适排行)
-- Using valid SQLite, answer the following questions for the tables provided above.
--车款加起来不足10个的汽车公司有哪些,它们属于哪个国家
SELECT### Response: select T2.所属国家 , T2.名称 from 汽车产品 as T1 join 汽车公司 as T2 on 汽车产品.生产公司id == 汽车公司.词条id group by T1.生产公司id having sum ( T1.车款数量 ) < 10. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 诗人 (
词条id,
姓名,
性别,
所处朝代,
年龄,
作品数量,
称号)
CREATE TABLE 诗词 (
词条id,
诗词名,
作者id,
文学体裁,
传播度)
CREATE TABLE 做官的诗人 (
诗人id,
所处年号,
做官时间)
CREATE TABLE 纪念景点 (
词条id,
名称,
所属城市,
地址,
纪念人物id)
-- Using valid SQLite, answer the following questions for the tables provided above.
--诗词至少5首的都有哪些诗人,分别是男是女
SELECT### Response: select T2.性别 , T2.姓名 from 诗词 as T1 join 诗人 as T2 on 诗词.作者id == 诗人.词条id group by T1.作者id having count ( * ) >= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 银行总部 (
词条id,
名称,
总部地点,
成立时间,
公司类型)
CREATE TABLE 年营业额 (
年份,
银行id,
营业额,
员工数,
世界五百强排名)
CREATE TABLE 城市 (
词条id,
名称,
所属省份,
所属区域)
CREATE TABLE 银行服务网点 (
银行id,
城市id,
建成数量,
规划数量)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些银行总部的银行服务网点一共建成了多于30个,它们都在哪里
SELECT### Response: select T2.总部地点 , T2.名称 from 银行服务网点 as T1 join 银行总部 as T2 on 银行服务网点.银行id == 银行总部.词条id group by T1.银行id having sum ( T1.建成数量 ) > 30. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 酒店集团 (
词条id,
名称,
总部所在省,
上级主管部门,
酒店数量,
客房数量,
省排名,
中国500最具价值品牌排名,
全球酒店集团300强排名)
CREATE TABLE 酒店 (
词条id,
名称,
酒店地址,
开业时间,
酒店星级,
所属集团id,
客房数量,
大厅容纳人数)
CREATE TABLE 机场 (
词条id,
名称,
所属城市,
类型)
CREATE TABLE 火车站 (
词条id,
名称,
所属城市,
类型)
CREATE TABLE 酒店距离机场路程 (
酒店id,
机场id,
距离,
打车费用,
高峰用时,
平时用时)
CREATE TABLE 酒店距离火车站路程 (
酒店id,
火车站id,
公交线路数,
地铁线路数,
地铁用时)
CREATE TABLE 酒店活动费用 (
酒店id,
活动类型,
人数规模,
费用)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些机场距离酒店的平均距离正好50公里,它们在哪座城市
SELECT### Response: select T2.所属城市 , T2.名称 from 酒店距离机场路程 as T1 join 机场 as T2 on 酒店距离机场路程.机场id == 机场.词条id group by T1.机场id having avg ( T1.距离 ) == 50000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 酒店集团 (
词条id,
名称,
总部所在省,
上级主管部门,
酒店数量,
客房数量,
省排名,
中国500最具价值品牌排名,
全球酒店集团300强排名)
CREATE TABLE 酒店 (
词条id,
名称,
酒店地址,
开业时间,
酒店星级,
所属集团id,
客房数量,
大厅容纳人数)
CREATE TABLE 机场 (
词条id,
名称,
所属城市,
类型)
CREATE TABLE 火车站 (
词条id,
名称,
所属城市,
类型)
CREATE TABLE 酒店距离机场路程 (
酒店id,
机场id,
距离,
打车费用,
高峰用时,
平时用时)
CREATE TABLE 酒店距离火车站路程 (
酒店id,
火车站id,
公交线路数,
地铁线路数,
地铁用时)
CREATE TABLE 酒店活动费用 (
酒店id,
活动类型,
人数规模,
费用)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些机场距离酒店的平均距离正好5公里,它们在哪座城市
SELECT### Response: select T2.所属城市 , T2.名称 from 酒店距离机场路程 as T1 join 机场 as T2 on 酒店距离机场路程.机场id == 机场.词条id group by T1.机场id having count ( * ) == 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 作者 (
词条id,
姓名,
年龄,
出版作品数,
网络作品数)
CREATE TABLE 出版图书 (
词条id,
书名,
作者id,
评分,
评价人数,
字数,
点击数,
类型)
CREATE TABLE 网络小说 (
词条id,
书名,
作者id,
评分,
类型,
状态,
价格)
CREATE TABLE 畅销榜 (
网络小说id,
周排名,
月排名,
总排名)
CREATE TABLE 收藏榜 (
网络小说id,
周排名,
月排名,
总排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些书拥有不超过5个网络小说,它们是什么类型的
SELECT### Response: select T2.类型 , T2.书名 from 畅销榜 as T1 join 网络小说 as T2 on 畅销榜.网络小说id == 网络小说.词条id group by T1.网络小说id having count ( * ) <= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 旅行社 (
词条id,
名称,
级别,
出境游国家数量,
国内游城市数量,
出境游路线数量,
国内游路线数量,
亚洲排名,
接待海外游客数量,
境外公司数量,
控股子公司数量,
有业务关系的旅行商数量,
免税店数量)
CREATE TABLE 出境游路线 (
词条id,
路线名称,
旅行社id,
出发城市,
天数,
成人价格,
儿童价格,
国家数量,
景点数,
门票总价格)
CREATE TABLE 出境游所含国家 (
路线id,
国家,
旅行天数,
景点数量)
CREATE TABLE 国内游路线 (
词条id,
路线名称,
旅行社id,
出发城市,
天数,
预售价格,
参团价格,
起团人数,
个人价格,
景点数)
CREATE TABLE 邮轮路线 (
词条id,
路线名称,
旅行社id,
出发城市,
天数,
内舱房价格,
海景房价格,
阳台房价格,
航行区域,
邮轮公司)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些旅行社的出境游路线多于5条,它们是什么级别的
SELECT### Response: select T2.级别 , T2.名称 from 出境游路线 as T1 join 旅行社 as T2 on 出境游路线.旅行社id == 旅行社.词条id group by T1.旅行社id having count ( * ) > 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 旅行社 (
词条id,
名称,
级别,
出境游国家数量,
国内游城市数量,
出境游路线数量,
国内游路线数量,
亚洲排名,
接待海外游客数量,
境外公司数量,
控股子公司数量,
有业务关系的旅行商数量,
免税店数量)
CREATE TABLE 出境游路线 (
词条id,
路线名称,
旅行社id,
出发城市,
天数,
成人价格,
儿童价格,
国家数量,
景点数,
门票总价格)
CREATE TABLE 出境游所含国家 (
路线id,
国家,
旅行天数,
景点数量)
CREATE TABLE 国内游路线 (
词条id,
路线名称,
旅行社id,
出发城市,
天数,
预售价格,
参团价格,
起团人数,
个人价格,
景点数)
CREATE TABLE 邮轮路线 (
词条id,
路线名称,
旅行社id,
出发城市,
天数,
内舱房价格,
海景房价格,
阳台房价格,
航行区域,
邮轮公司)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些旅行社的出境游路线的成人价平均多于1万,它们是什么级别的
SELECT### Response: select T2.级别 , T2.名称 from 出境游路线 as T1 join 旅行社 as T2 on 出境游路线.旅行社id == 旅行社.词条id group by T1.旅行社id having avg ( T1.成人价格 ) > 10000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 电视机品牌 (
词条id,
名称,
所属公司,
国家,
市场份额)
CREATE TABLE 电视机型号 (
词条id,
名称,
产品定位,
屏幕尺寸,
屏幕比例,
分辨率,
背光灯寿命,
定价,
品牌id)
CREATE TABLE 电视机平台售卖 (
型号id,
平台,
售价,
最高价格,
最低价格,
售卖量,
用户评分)
CREATE TABLE 各城市电视机售卖 (
城市,
所属省份,
电视机售卖量,
观看电视日平均用时)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些电视机品牌的型号不足5个,它们属于哪个公司
SELECT### Response: select T2.所属公司 , T2.名称 from 电视机型号 as T1 join 电视机品牌 as T2 on 电视机型号.品牌id == 电视机品牌.词条id group by T1.品牌id having count ( * ) < 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 电视机品牌 (
词条id,
名称,
所属公司,
国家,
市场份额)
CREATE TABLE 电视机型号 (
词条id,
名称,
产品定位,
屏幕尺寸,
屏幕比例,
分辨率,
背光灯寿命,
定价,
品牌id)
CREATE TABLE 电视机平台售卖 (
型号id,
平台,
售价,
最高价格,
最低价格,
售卖量,
用户评分)
CREATE TABLE 各城市电视机售卖 (
城市,
所属省份,
电视机售卖量,
观看电视日平均用时)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些电视机品牌的背光灯寿命一共至少20万小时,它们属于哪个公司
SELECT### Response: select T2.所属公司 , T2.名称 from 电视机型号 as T1 join 电视机品牌 as T2 on 电视机型号.品牌id == 电视机品牌.词条id group by T1.品牌id having sum ( T1.背光灯寿命 ) >= 200000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 文学奖 (
词条id,
名称,
设立时间,
设立原因,
举办间隔年限)
CREATE TABLE 文学奖项颁奖奖项 (
文学奖id,
奖项)
CREATE TABLE 文学作品 (
词条id,
名称,
作者,
创作年代,
首版时间,
字数)
CREATE TABLE 文学奖获奖名单 (
届数,
作品id,
作者,
出版社)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些文学奖的奖项不超过5个,它们因为什么原因设立
SELECT### Response: select T2.设立原因 , T2.名称 from 文学奖项颁奖奖项 as T1 join 文学奖 as T2 on 文学奖项颁奖奖项.文学奖id == 文学奖.词条id group by T1.文学奖id having count ( * ) <= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 篮球运动员 (
词条id,
中文名,
国籍,
出生地,
出生日期,
身高,
体重,
毕业院校,
场上位置)
CREATE TABLE 比赛场馆 (
词条id,
名称,
容纳人数)
CREATE TABLE 篮球俱乐部 (
词条id,
中文队名,
所属地区,
成立时间,
主场馆id,
赛区)
CREATE TABLE 俱乐部现役球员 (
球员id,
俱乐部id,
场上位置,
球衣号码,
是否主力)
CREATE TABLE 运动员转会 (
运动员id,
俱乐部id,
加入日期,
服役时间,
号码,
薪资)
CREATE TABLE 教练 (
词条id,
中文名,
国籍,
毕业院校,
执教时长,
年薪)
CREATE TABLE 俱乐部教练 (
教练id,
俱乐部id,
加入日期,
身份)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些篮球俱乐部参加的运动会不足5个,它们队伍的中文名是什么,以及它们属于哪个的地区
SELECT### Response: select T2.所属地区 , T2.中文队名 from 运动员转会 as T1 join 篮球俱乐部 as T2 on 运动员转会.俱乐部id == 篮球俱乐部.词条id group by T1.俱乐部id having count ( * ) < 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 篮球运动员 (
词条id,
中文名,
国籍,
出生地,
出生日期,
身高,
体重,
毕业院校,
场上位置)
CREATE TABLE 比赛场馆 (
词条id,
名称,
容纳人数)
CREATE TABLE 篮球俱乐部 (
词条id,
中文队名,
所属地区,
成立时间,
主场馆id,
赛区)
CREATE TABLE 俱乐部现役球员 (
球员id,
俱乐部id,
场上位置,
球衣号码,
是否主力)
CREATE TABLE 运动员转会 (
运动员id,
俱乐部id,
加入日期,
服役时间,
号码,
薪资)
CREATE TABLE 教练 (
词条id,
中文名,
国籍,
毕业院校,
执教时长,
年薪)
CREATE TABLE 俱乐部教练 (
教练id,
俱乐部id,
加入日期,
身份)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些篮球俱乐部的运动员转会服役时间一共不超过50年,它们队伍的中文名是什么,以及它们属于哪个的地区
SELECT### Response: select T2.所属地区 , T2.中文队名 from 运动员转会 as T1 join 篮球俱乐部 as T2 on 运动员转会.俱乐部id == 篮球俱乐部.词条id group by T1.俱乐部id having sum ( T1.服役时间 ) <= 50. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 峰会 (
词条id,
名称,
主办单位,
举办时间,
历时天数,
举办地点,
分论坛数量,
门票价格,
门票数量,
报名人数,
直播观看人数)
CREATE TABLE 嘉宾 (
词条id,
姓名,
任职单位,
职位)
CREATE TABLE 峰会嘉宾 (
嘉宾id,
峰会id,
演讲主题,
论坛,
开始时间,
演讲时长)
CREATE TABLE 峰会赞助公司 (
峰会id,
公司,
赞助级别)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些峰会的赞助公司不超过5个,它们是哪个单位主办的
SELECT### Response: select T2.主办单位 , T2.名称 from 峰会赞助公司 as T1 join 峰会 as T2 on 峰会赞助公司.峰会id == 峰会.词条id group by T1.峰会id having count ( * ) <= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 峰会 (
词条id,
名称,
主办单位,
举办时间,
历时天数,
举办地点,
分论坛数量,
门票价格,
门票数量,
报名人数,
直播观看人数)
CREATE TABLE 嘉宾 (
词条id,
姓名,
任职单位,
职位)
CREATE TABLE 峰会嘉宾 (
嘉宾id,
峰会id,
演讲主题,
论坛,
开始时间,
演讲时长)
CREATE TABLE 峰会赞助公司 (
峰会id,
公司,
赞助级别)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些峰会的赞助公司不足5个,它们是哪个单位主办的
SELECT### Response: select T2.主办单位 , T2.名称 from 峰会赞助公司 as T1 join 峰会 as T2 on 峰会赞助公司.峰会id == 峰会.词条id group by T1.峰会id having count ( * ) < 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 景区 (
词条id,
名称,
占地面积,
景点级别,
旺季门票价格,
淡季门票价格,
始建时间,
所属城市,
所属省份)
CREATE TABLE 景点 (
词条id,
名称,
地理位置)
CREATE TABLE 交通站 (
词条id,
名称,
类型,
景区id,
距离)
CREATE TABLE 景区景点 (
景点id,
景区id,
是否著名)
CREATE TABLE 临近景区 (
景区id,
相邻景区id,
距离)
CREATE TABLE 博物馆 (
词条id,
名称,
占地面积,
开馆时间,
所属城市,
票价)
CREATE TABLE 重点文物保护单位 (
词条id,
名称,
门票价格,
保护级别,
所属城市,
评定年份)
CREATE TABLE 动物园 (
词条id,
名称,
占地面积,
竣工时间,
门票价格,
动物种类,
所属城市)
CREATE TABLE 馆藏动物 (
动物名称,
动物园id,
数量)
CREATE TABLE 游乐园 (
词条id,
名称,
占地面积,
门票价格,
总投资,
所属城市)
CREATE TABLE 娱乐项目 (
项目名称,
游乐园id,
季节,
排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些景区的景点至少5个,它们都在哪座城市
SELECT### Response: select T2.所属城市 , T2.名称 from 景区景点 as T1 join 景区 as T2 on 景区景点.景区id == 景区.词条id group by T1.景区id having count ( * ) >= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 景区 (
词条id,
名称,
占地面积,
景点级别,
旺季门票价格,
淡季门票价格,
始建时间,
所属城市,
所属省份)
CREATE TABLE 景点 (
词条id,
名称,
地理位置)
CREATE TABLE 交通站 (
词条id,
名称,
类型,
景区id,
距离)
CREATE TABLE 景区景点 (
景点id,
景区id,
是否著名)
CREATE TABLE 临近景区 (
景区id,
相邻景区id,
距离)
CREATE TABLE 博物馆 (
词条id,
名称,
占地面积,
开馆时间,
所属城市,
票价)
CREATE TABLE 重点文物保护单位 (
词条id,
名称,
门票价格,
保护级别,
所属城市,
评定年份)
CREATE TABLE 动物园 (
词条id,
名称,
占地面积,
竣工时间,
门票价格,
动物种类,
所属城市)
CREATE TABLE 馆藏动物 (
动物名称,
动物园id,
数量)
CREATE TABLE 游乐园 (
词条id,
名称,
占地面积,
门票价格,
总投资,
所属城市)
CREATE TABLE 娱乐项目 (
项目名称,
游乐园id,
季节,
排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些景区的景点不足5个,它们都在哪座城市
SELECT### Response: select T2.所属城市 , T2.名称 from 景区景点 as T1 join 景区 as T2 on 景区景点.景区id == 景区.词条id group by T1.景区id having count ( * ) < 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 理财公司 (
词条id,
公司名称,
创立时间,
官网,
所属集团)
CREATE TABLE 银行 (
词条id,
名称,
总部地点,
所属城市,
所属省份,
成立时间,
公司类型)
CREATE TABLE 理财公司合作银行 (
公司id,
银行id,
合作时间,
是否有电子银行)
CREATE TABLE 理财产品 (
产品,
公司id,
支持银行id,
年化收益率,
期限,
起投金额)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些理财公司的理财产品的年化收益率加起来多于50%,它们的官网是哪个
SELECT### Response: select T2.官网 , T2.公司名称 from 理财产品 as T1 join 理财公司 as T2 on 理财产品.公司id == 理财公司.词条id group by T1.公司id having sum ( T1.年化收益率 ) > 0.5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 理财公司 (
词条id,
公司名称,
创立时间,
官网,
所属集团)
CREATE TABLE 银行 (
词条id,
名称,
总部地点,
所属城市,
所属省份,
成立时间,
公司类型)
CREATE TABLE 理财公司合作银行 (
公司id,
银行id,
合作时间,
是否有电子银行)
CREATE TABLE 理财产品 (
产品,
公司id,
支持银行id,
年化收益率,
期限,
起投金额)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些理财公司的理财产品的平均年化收益率正好5%,它们的官网是哪个
SELECT### Response: select T2.官网 , T2.公司名称 from 理财产品 as T1 join 理财公司 as T2 on 理财产品.公司id == 理财公司.词条id group by T1.公司id having avg ( T1.年化收益率 ) == 0.05. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 电视剧 (
词条id,
剧名,
首播时间,
集数)
CREATE TABLE 小说 (
词条id,
小说名,
作者,
字数,
状态)
CREATE TABLE 改编的电视剧 (
小说id,
电视剧id,
评分)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些小说改编成电视剧多于5部,它们的作者都是谁
SELECT### Response: select T2.作者 , T2.小说名 from 改编的电视剧 as T1 join 小说 as T2 on 改编的电视剧.小说id == 小说.词条id group by T1.小说id having count ( * ) > 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 电视剧 (
词条id,
剧名,
首播时间,
集数)
CREATE TABLE 小说 (
词条id,
小说名,
作者,
字数,
状态)
CREATE TABLE 改编的电视剧 (
小说id,
电视剧id,
评分)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些小说改编成电视剧至少5部,它们的作者都是谁
SELECT### Response: select T2.作者 , T2.小说名 from 改编的电视剧 as T1 join 小说 as T2 on 改编的电视剧.小说id == 小说.词条id group by T1.小说id having count ( * ) >= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 汉字 (
词条id,
汉字,
部首,
笔画)
CREATE TABLE 姓氏 (
姓氏id,
源自姓氏id,
人口,
占比)
CREATE TABLE 姓氏分布区域 (
姓氏id,
区域,
人口占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些汉字的姓氏分布区域多于5个,它们的部首都是什么
SELECT### Response: select T2.部首 , T2.汉字 from 姓氏分布区域 as T1 join 汉字 as T2 on 姓氏分布区域.姓氏id == 汉字.词条id group by T1.姓氏id having count ( * ) > 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 汉字 (
词条id,
汉字,
部首,
笔画)
CREATE TABLE 姓氏 (
姓氏id,
源自姓氏id,
人口,
占比)
CREATE TABLE 姓氏分布区域 (
姓氏id,
区域,
人口占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些汉字的姓氏分布区域不超过5个,它们的部首都是什么
SELECT### Response: select T2.部首 , T2.汉字 from 姓氏分布区域 as T1 join 汉字 as T2 on 姓氏分布区域.姓氏id == 汉字.词条id group by T1.姓氏id having count ( * ) <= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 北京小区 (
词条id,
名称,
所属区域,
楼栋数,
户数,
周边小学数量,
周边超市数量,
周边医院数量)
CREATE TABLE 小区各月成交量 (
小区id,
月份,
成交量,
成交量同比增长,
成交均价,
成交价同比增长)
CREATE TABLE 成交房屋 (
房屋编号id,
建筑面积,
使用面积,
卧室数量,
厅数量,
总价,
单价,
所属小区id)
CREATE TABLE 房屋中介 (
词条id,
名称,
门店数量,
房屋经纪人数量,
覆盖城市数量,
购房成交总量,
租房成交总量,
成交排名,
评分)
CREATE TABLE 中介成交 (
中介id,
小区id,
年份,
购房成交量,
成交量占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些北京小区在中介成交的购房总量多于50套,它们属于哪个地区
SELECT### Response: select T2.所属区域 , T2.名称 from 中介成交 as T1 join 北京小区 as T2 on 中介成交.小区id == 北京小区.词条id group by T1.小区id having sum ( T1.购房成交量 ) > 50. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 北京小区 (
词条id,
名称,
所属区域,
楼栋数,
户数,
周边小学数量,
周边超市数量,
周边医院数量)
CREATE TABLE 小区各月成交量 (
小区id,
月份,
成交量,
成交量同比增长,
成交均价,
成交价同比增长)
CREATE TABLE 成交房屋 (
房屋编号id,
建筑面积,
使用面积,
卧室数量,
厅数量,
总价,
单价,
所属小区id)
CREATE TABLE 房屋中介 (
词条id,
名称,
门店数量,
房屋经纪人数量,
覆盖城市数量,
购房成交总量,
租房成交总量,
成交排名,
评分)
CREATE TABLE 中介成交 (
中介id,
小区id,
年份,
购房成交量,
成交量占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些北京小区在中介成交的购房量平均不足50套,它们属于哪个地区
SELECT### Response: select T2.所属区域 , T2.名称 from 中介成交 as T1 join 北京小区 as T2 on 中介成交.小区id == 北京小区.词条id group by T1.小区id having avg ( T1.购房成交量 ) < 50. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 公司 (
词条id,
名称,
行业,
校招人数)
CREATE TABLE 学校 (
词条id,
名称,
所在城市,
毕业人数)
CREATE TABLE 学校各专业 (
学校id,
专业,
毕业人数,
专业全国排名,
平均薪资)
CREATE TABLE 公司对口专业 (
公司id,
专业,
对应岗位,
拟招聘人数,
基本工资,
工资幅度)
CREATE TABLE 公司宣讲会 (
公司id,
学校id,
宣讲时间,
拟招聘人数,
参加笔试人数,
参加面试人数,
实际招聘人数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些公司一共打算招聘不足2千人,它们属于什么行业的
SELECT### Response: select T2.行业 , T2.名称 from 公司宣讲会 as T1 join 公司 as T2 on 公司宣讲会.公司id == 公司.词条id group by T1.公司id having sum ( T1.拟招聘人数 ) < 2000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 公司 (
词条id,
名称,
行业,
校招人数)
CREATE TABLE 学校 (
词条id,
名称,
所在城市,
毕业人数)
CREATE TABLE 学校各专业 (
学校id,
专业,
毕业人数,
专业全国排名,
平均薪资)
CREATE TABLE 公司对口专业 (
公司id,
专业,
对应岗位,
拟招聘人数,
基本工资,
工资幅度)
CREATE TABLE 公司宣讲会 (
公司id,
学校id,
宣讲时间,
拟招聘人数,
参加笔试人数,
参加面试人数,
实际招聘人数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些公司平均打算招聘不超过50人,它们属于什么行业的
SELECT### Response: select T2.行业 , T2.名称 from 公司宣讲会 as T1 join 公司 as T2 on 公司宣讲会.公司id == 公司.词条id group by T1.公司id having avg ( T1.拟招聘人数 ) <= 50. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 省份 (
词条id,
名称,
南北区域,
东西区域,
5区域)
CREATE TABLE 平均身高和寿命 (
省份id,
性别,
平均身高,
平均寿命)
CREATE TABLE 各省美女比例 (
省份id,
评价者来自区域,
美女比例,
美女平均颜值分数)
CREATE TABLE 各省市容评分 (
省份id,
评价者来自区域,
市容评分,
市民素质评分)
CREATE TABLE 民风彪悍十大城市 (
城市名称,
所属省份id,
排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些省进过民风彪悍十大城市正好5次,它们分别属于南方还是北方
SELECT### Response: select T2.南北区域 , T2.名称 from 民风彪悍十大城市 as T1 join 省份 as T2 on 民风彪悍十大城市.所属省份id == 省份.词条id group by T1.所属省份id having count ( * ) == 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 省份 (
词条id,
名称,
南北区域,
东西区域,
5区域)
CREATE TABLE 平均身高和寿命 (
省份id,
性别,
平均身高,
平均寿命)
CREATE TABLE 各省美女比例 (
省份id,
评价者来自区域,
美女比例,
美女平均颜值分数)
CREATE TABLE 各省市容评分 (
省份id,
评价者来自区域,
市容评分,
市民素质评分)
CREATE TABLE 民风彪悍十大城市 (
城市名称,
所属省份id,
排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些省进过民风彪悍十大城市不超过五次,它们分别属于南方还是北方
SELECT### Response: select T2.南北区域 , T2.名称 from 民风彪悍十大城市 as T1 join 省份 as T2 on 民风彪悍十大城市.所属省份id == 省份.词条id group by T1.所属省份id having count ( * ) <= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 城市 (
词条id,
名称,
气候地带,
所属国家,
所属洲)
CREATE TABLE 动物 (
词条id,
中文学名,
所属纲,
所属科,
食性,
濒危级别,
保护级别)
CREATE TABLE 动物分布城市 (
动物id,
城市id,
现存数量)
CREATE TABLE 动物电影 (
词条id,
影片名,
动物id,
拍摄国家,
类型)
CREATE TABLE 动物寓言故事 (
动物id,
寓言故事,
形象)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些动物一共现存至少50万,它们的中文学名是什么,以及都属于哪个纲
SELECT### Response: select T2.所属纲 , T2.中文学名 from 动物分布城市 as T1 join 动物 as T2 on 动物分布城市.动物id == 动物.词条id group by T1.动物id having sum ( T1.现存数量 ) >= 500000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 城市 (
词条id,
名称,
气候地带,
所属国家,
所属洲)
CREATE TABLE 动物 (
词条id,
中文学名,
所属纲,
所属科,
食性,
濒危级别,
保护级别)
CREATE TABLE 动物分布城市 (
动物id,
城市id,
现存数量)
CREATE TABLE 动物电影 (
词条id,
影片名,
动物id,
拍摄国家,
类型)
CREATE TABLE 动物寓言故事 (
动物id,
寓言故事,
形象)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些动物一共现存不足50万,它们的中文学名是什么,以及都属于哪个纲
SELECT### Response: select T2.所属纲 , T2.中文学名 from 动物分布城市 as T1 join 动物 as T2 on 动物分布城市.动物id == 动物.词条id group by T1.动物id having sum ( T1.现存数量 ) < 500000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 航空公司 (
词条id,
名称,
国内通航城市数量,
国际通航城市数量,
机队规模,
运送旅客人数,
飞机餐用户满意度)
CREATE TABLE 机场 (
词条id,
名称,
所属地区,
机位数量,
跑道长度,
跑道数量,
国内航线数量,
国际航线数量,
通航城市,
旅客吞量,
航站楼数量)
CREATE TABLE 航空公司主运营基地 (
航空公司id,
机场id)
CREATE TABLE 航空公司机队 (
航空公司id,
飞机型号,
数量)
CREATE TABLE 航班信息 (
日期,
出发机场id,
到达机场id,
起飞时间,
航班号,
航空公司id,
机龄,
经济舱价格,
头等舱价格,
经济舱余票,
头等舱余票,
历经时间)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些机场主运营基地不足5个,它们属于哪个地区
SELECT### Response: select T2.所属地区 , T2.名称 from 航空公司主运营基地 as T1 join 机场 as T2 on 航空公司主运营基地.机场id == 机场.词条id group by T1.机场id having count ( * ) < 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 航空公司 (
词条id,
名称,
国内通航城市数量,
国际通航城市数量,
机队规模,
运送旅客人数,
飞机餐用户满意度)
CREATE TABLE 机场 (
词条id,
名称,
所属地区,
机位数量,
跑道长度,
跑道数量,
国内航线数量,
国际航线数量,
通航城市,
旅客吞量,
航站楼数量)
CREATE TABLE 航空公司主运营基地 (
航空公司id,
机场id)
CREATE TABLE 航空公司机队 (
航空公司id,
飞机型号,
数量)
CREATE TABLE 航班信息 (
日期,
出发机场id,
到达机场id,
起飞时间,
航班号,
航空公司id,
机龄,
经济舱价格,
头等舱价格,
经济舱余票,
头等舱余票,
历经时间)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些机场主运营基地正好5个,它们属于哪个地区
SELECT### Response: select T2.所属地区 , T2.名称 from 航空公司主运营基地 as T1 join 机场 as T2 on 航空公司主运营基地.机场id == 机场.词条id group by T1.机场id having count ( * ) == 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 城市 (
词条id,
名称,
所属省份,
地区生产总值,
生产总值增长率,
第一产业总值,
第二产业总值,
第三产业总值)
CREATE TABLE 城市金融产业 (
城市id,
金融业增加值,
增长率,
金融机构数量,
外币存款余额,
存款余额增长率,
贷款余额,
贷款余额增长率)
CREATE TABLE 城市贸易产业 (
城市id,
行业,
进口额,
进口额增长率,
出口额,
出口额增长率)
CREATE TABLE 城市第一产业 (
城市id,
产业类型,
收入,
收入增长率,
产量,
产量增长率)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些城市总进口额不超过10亿,它们属于哪个省
SELECT### Response: select T2.所属省份 , T2.名称 from 城市贸易产业 as T1 join 城市 as T2 on 城市贸易产业.城市id == 城市.词条id group by T1.城市id having sum ( T1.进口额 ) <= 1000000000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 篮球队 (
词条id,
队名,
所属地区,
成立时间,
主场馆,
容纳人数,
主教练,
赞助商家)
CREATE TABLE 篮球运动员 (
词条id,
姓名,
国籍,
民族,
出生地,
出生日期,
身高,
体重,
所属球队id,
场上位置)
CREATE TABLE 运动员赛事记录 (
球员id,
赛事,
类别)
CREATE TABLE CBA总冠军 (
赛季,
冠军球队id,
亚军球队id)
CREATE TABLE 最有价值球员 (
赛季,
球员id,
球队id)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些篮球队获得的CBA冠军正好五个,它们属于哪个地区
SELECT### Response: select T2.所属地区 , T2.队名 from CBA总冠军 as T1 join 篮球队 as T2 on CBA总冠军.亚军球队id == 篮球队.词条id group by T1.亚军球队id having count ( * ) == 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 篮球队 (
词条id,
队名,
所属地区,
成立时间,
主场馆,
容纳人数,
主教练,
赞助商家)
CREATE TABLE 篮球运动员 (
词条id,
姓名,
国籍,
民族,
出生地,
出生日期,
身高,
体重,
所属球队id,
场上位置)
CREATE TABLE 运动员赛事记录 (
球员id,
赛事,
类别)
CREATE TABLE CBA总冠军 (
赛季,
冠军球队id,
亚军球队id)
CREATE TABLE 最有价值球员 (
赛季,
球员id,
球队id)
-- Using valid SQLite, answer the following questions for the tables provided above.
--获得CBA冠军不足5次的篮球队有哪些,它们属于哪个地区
SELECT### Response: select T2.所属地区 , T2.队名 from CBA总冠军 as T1 join 篮球队 as T2 on CBA总冠军.冠军球队id == 篮球队.词条id group by T1.冠军球队id having count ( * ) < 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 中国地铁 (
年份,
总里程,
开通城市数量)
CREATE TABLE 城市 (
词条id,
城市名称,
所属省份)
CREATE TABLE 城市地铁里程 (
城市id,
地铁运营里程,
在建里程,
规划里程,
已运营线路数)
CREATE TABLE 城市地铁日均客运量 (
城市id,
日均客运量(万人次),
每日每公里客运量(万人次),
每公里运营成本,
每公里运营收入)
CREATE TABLE 城市地铁票价 (
城市id,
2元可乘坐里程,
3元可乘坐里程,
4元可乘坐里程,
5元可乘坐里程)
-- Using valid SQLite, answer the following questions for the tables provided above.
--平均地铁运营里程不超过50公里的有哪些市,它们属于哪些省
SELECT### Response: select T2.所属省份 , T2.城市名称 from 城市地铁里程 as T1 join 城市 as T2 on 城市地铁里程.城市id == 城市.词条id group by T1.城市id having avg ( T1.地铁运营里程 ) <= 50000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 皇帝 (
词条id,
姓名,
年号,
所处朝代,
子女数量,
皇后数量,
妃子数量)
CREATE TABLE 皇后和妃子 (
词条id,
谥号,
夫君id,
年龄,
皇子数量,
公主数量)
CREATE TABLE 皇帝皇后合葬 (
皇帝id,
皇后id,
葬地)
CREATE TABLE 皇帝皇后影视形象 (
作品,
皇帝id,
皇帝饰演者,
皇后id,
皇后饰演者)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些皇帝的皇后和妃子总年龄不超过60岁,他们的年号都是什么
SELECT### Response: select T2.年号 , T2.姓名 from 皇后和妃子 as T1 join 皇帝 as T2 on 皇后和妃子.夫君id == 皇帝.词条id group by T1.夫君id having sum ( T1.年龄 ) <= 60. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 事业群 (
词条id,
名称,
负责人,
员工数量,
目标营收,
成本支出)
CREATE TABLE 部门 (
词条id,
部门名称,
职责,
所属群id)
CREATE TABLE 员工 (
词条id,
姓名,
职称,
薪资,
年龄,
工龄,
所属部门id)
CREATE TABLE 部门人员 (
部门id,
年份,
员工数量,
离职人数,
招聘人数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--平均员工人数正好25人的部门有哪些,以及它们都有什么职责
SELECT### Response: select T2.职责 , T2.部门名称 from 部门人员 as T1 join 部门 as T2 on 部门人员.部门id == 部门.词条id group by T1.部门id having avg ( T1.员工数量 ) == 25. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 事业群 (
词条id,
名称,
负责人,
员工数量,
目标营收,
成本支出)
CREATE TABLE 部门 (
词条id,
部门名称,
职责,
所属群id)
CREATE TABLE 员工 (
词条id,
姓名,
职称,
薪资,
年龄,
工龄,
所属部门id)
CREATE TABLE 部门人员 (
部门id,
年份,
员工数量,
离职人数,
招聘人数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些部门的人员至少5人,它们都有什么职责
SELECT### Response: select T2.职责 , T2.部门名称 from 部门人员 as T1 join 部门 as T2 on 部门人员.部门id == 部门.词条id group by T1.部门id having count ( * ) >= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 台风 (
词条id,
名称,
登陆地点,
登陆时间,
登陆强度,
持续天数,
影响地区数,
死亡人数,
经济损失)
CREATE TABLE 台风影响的中国省份 (
台风id,
省份,
登陆强度,
死亡人数,
失踪人数)
CREATE TABLE 台风影响的国家 (
台风id,
国家,
经济损失)
-- Using valid SQLite, answer the following questions for the tables provided above.
--影响的国家至少5个的台风有哪些,以及它们是在哪登陆的
SELECT### Response: select T2.登陆地点 , T2.名称 from 台风影响的国家 as T1 join 台风 as T2 on 台风影响的国家.台风id == 台风.词条id group by T1.台风id having count ( * ) >= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 明星 (
词条id,
姓名,
国籍,
性别,
职业,
年龄,
薪酬,
票房)
CREATE TABLE 2018年财富排名 (
明星id,
排名,
资产)
CREATE TABLE 2017年财富排名 (
明星id,
排名,
资产)
-- Using valid SQLite, answer the following questions for the tables provided above.
--财富排名低于5的有哪些明星,以及他们是哪国的
SELECT### Response: select T2.国籍 , T2.姓名 from 2017年财富排名 as T1 join 明星 as T2 on 2017年财富排名.明星id == 明星.词条id group by T1.明星id having count ( * ) < 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 明星 (
词条id,
姓名,
国籍,
性别,
职业,
年龄,
薪酬,
票房)
CREATE TABLE 2018年财富排名 (
明星id,
排名,
资产)
CREATE TABLE 2017年财富排名 (
明星id,
排名,
资产)
-- Using valid SQLite, answer the following questions for the tables provided above.
--财富排名多于5的有哪些明星,以及他们是哪国的
SELECT### Response: select T2.国籍 , T2.姓名 from 2017年财富排名 as T1 join 明星 as T2 on 2017年财富排名.明星id == 明星.词条id group by T1.明星id having count ( * ) > 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 影院 (
词条id,
名称,
地址,
与当前距离,
用户评分)
CREATE TABLE 电影 (
词条id,
名称,
拍摄国家,
类型,
片长,
豆瓣评分)
CREATE TABLE 影院上映电影 (
电影id,
影院id,
上映时间,
票价,
余票数量)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些影院的平均票价多于50元,它们都坐落在哪
SELECT### Response: select T2.地址 , T2.名称 from 影院上映电影 as T1 join 影院 as T2 on 影院上映电影.影院id == 影院.词条id group by T1.影院id having avg ( T1.票价 ) > 50. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 影院 (
词条id,
名称,
地址,
与当前距离,
用户评分)
CREATE TABLE 电影 (
词条id,
名称,
拍摄国家,
类型,
片长,
豆瓣评分)
CREATE TABLE 影院上映电影 (
电影id,
影院id,
上映时间,
票价,
余票数量)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些影院的平均票价至少40元,它们都坐落在哪
SELECT### Response: select T2.地址 , T2.名称 from 影院上映电影 as T1 join 影院 as T2 on 影院上映电影.影院id == 影院.词条id group by T1.影院id having avg ( T1.票价 ) >= 40. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 学校 (
词条id,
名称,
类型,
国家,
世界排名)
CREATE TABLE 课程 (
词条id,
名称,
所属专业,
适合学者类型)
CREATE TABLE 平台 (
词条id,
名称,
课程数量,
合作学校数量,
是否免费)
CREATE TABLE 平台合作学校 (
平台id,
学校id,
合作课程数量)
CREATE TABLE 学校的开源课程 (
词条id,
开源课程名称,
课程id,
学校id,
课时,
主讲教师)
CREATE TABLE 平台课程 (
开源课程id,
平台id,
是否直播,
课程时长,
价格)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些学校的平均课时正好50个,它们都是什么类型的
SELECT### Response: select T2.类型 , T2.名称 from 学校的开源课程 as T1 join 学校 as T2 on 学校的开源课程.学校id == 学校.词条id group by T1.学校id having avg ( T1.课时 ) == 50. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 学校 (
词条id,
名称,
类型,
国家,
世界排名)
CREATE TABLE 课程 (
词条id,
名称,
所属专业,
适合学者类型)
CREATE TABLE 平台 (
词条id,
名称,
课程数量,
合作学校数量,
是否免费)
CREATE TABLE 平台合作学校 (
平台id,
学校id,
合作课程数量)
CREATE TABLE 学校的开源课程 (
词条id,
开源课程名称,
课程id,
学校id,
课时,
主讲教师)
CREATE TABLE 平台课程 (
开源课程id,
平台id,
是否直播,
课程时长,
价格)
-- Using valid SQLite, answer the following questions for the tables provided above.
--总课时多于一百个的学校有哪些,以及它们都是什么类型的
SELECT### Response: select T2.类型 , T2.名称 from 学校的开源课程 as T1 join 学校 as T2 on 学校的开源课程.学校id == 学校.词条id group by T1.学校id having sum ( T1.课时 ) > 100. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 运动项目 (
词条id,
名称,
起源国家,
比赛形式,
比赛人数,
加入奥运会年份)
CREATE TABLE 项目流行国家 (
项目id,
国家,
所获金牌总数,
所获奖牌总数)
CREATE TABLE 运动项目奖牌数 (
项目id,
赛事类型,
小项目总数,
奖牌总数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--总奖牌小项目加起来至少50个的运动项目有哪些,以及它们都是在哪个国家起源的
SELECT### Response: select T2.起源国家 , T2.名称 from 运动项目奖牌数 as T1 join 运动项目 as T2 on 运动项目奖牌数.项目id == 运动项目.词条id group by T1.项目id having sum ( T1.小项目总数 ) >= 50. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 电商 (
词条id,
名称,
所属公司,
类型,
影响力指数,
排名,
上线国家数量)
CREATE TABLE 电商覆盖国家 (
电商id,
支持国家,
上线时间,
负责的分公司名称)
CREATE TABLE 商家 (
词条id,
名称,
所属国家,
主营类别,
网店覆盖国家数量,
实体店数量,
入驻电商数量)
CREATE TABLE 商家网点覆盖国家 (
商家id,
国家,
实体店数量,
年平均营业额)
CREATE TABLE 商家交易额 (
商家id,
电商平台id,
上线品类数量,
促销品类数量,
平均折扣,
交易额,
占全年销售额比例)
CREATE TABLE 电商活动交易额 (
电商平台id,
活动日,
参加活动商家数量,
促销商品数量,
交易额)
-- Using valid SQLite, answer the following questions for the tables provided above.
--覆盖不超过5个国家的电商有哪些,以及它们都属于哪个公司
SELECT### Response: select T2.所属公司 , T2.名称 from 电商覆盖国家 as T1 join 电商 as T2 on 电商覆盖国家.电商id == 电商.词条id group by T1.电商id having count ( * ) <= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 电商 (
词条id,
名称,
所属公司,
类型,
影响力指数,
排名,
上线国家数量)
CREATE TABLE 电商覆盖国家 (
电商id,
支持国家,
上线时间,
负责的分公司名称)
CREATE TABLE 商家 (
词条id,
名称,
所属国家,
主营类别,
网店覆盖国家数量,
实体店数量,
入驻电商数量)
CREATE TABLE 商家网点覆盖国家 (
商家id,
国家,
实体店数量,
年平均营业额)
CREATE TABLE 商家交易额 (
商家id,
电商平台id,
上线品类数量,
促销品类数量,
平均折扣,
交易额,
占全年销售额比例)
CREATE TABLE 电商活动交易额 (
电商平台id,
活动日,
参加活动商家数量,
促销商品数量,
交易额)
-- Using valid SQLite, answer the following questions for the tables provided above.
--覆盖了多于5个国家的电商有哪些,以及它们都属于哪个公司
SELECT### Response: select T2.所属公司 , T2.名称 from 电商覆盖国家 as T1 join 电商 as T2 on 电商覆盖国家.电商id == 电商.词条id group by T1.电商id having count ( * ) > 5. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.