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,
名称,
所属国家,
经营范围,
母公司,
主要车系数量,
世界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家汽车公司,或者所有公司平均生产7个车系
SELECT### Response: select 所属国家 from 汽车公司 group by 所属国家 having count ( * ) >= 5 or avg ( 主要车系数量 ) == 7. |
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家汽车公司,或者所有公司平均生产车系低于7个
SELECT### Response: select 所属国家 from 汽车公司 group by 所属国家 having count ( * ) < 5 or avg ( 主要车系数量 ) < 7. |
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.
--哪些公司生产的汽车品牌平均最低价格为35万元,或者平均最高价格不低于50万元
SELECT### Response: select 所属公司 from 汽车品牌 group by 所属公司 having avg ( 最低价格 ) == 350000 or avg ( 最高价格 ) >= 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,
上映时间,
票价,
余票数量)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个国家拍摄的所有电影平均片长不长于100分钟,或者豆瓣评分加起来不低于100分
SELECT### Response: select 拍摄国家 from 电影 group by 拍摄国家 having avg ( 片长 ) <= 100 or sum ( 豆瓣评分 ) >= 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,
名称,
所属国家id,
年利润,
世界排名)
CREATE TABLE 中国最赚钱公司 (
词条id,
名称,
位于城市,
所属省份,
年营业额,
国内排名,
世界排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在中国最赚钱公司名单中,哪些城市拥有超过5家公司,或者年营业额总和低于4000亿元
SELECT### Response: select 位于城市 from 中国最赚钱公司 group by 位于城市 having count ( * ) > 5 or sum ( 年营业额 ) < 400000000000. |
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家公司,或者平均年营业额为400亿元
SELECT### Response: select 位于城市 from 中国最赚钱公司 group by 位于城市 having avg ( 年营业额 ) == 40000000000 or 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 流动人口年龄 (
年份,
年龄段,
占比)
CREATE TABLE 流动人口学历 (
年份,
学历,
占比)
CREATE TABLE 城市酒吧活力 (
城市id,
酒吧数量,
排名,
周末客流量,
节假日客流量,
平日客流量)
CREATE TABLE 酒吧顾客年龄 (
顾客年龄段,
占比)
CREATE TABLE 城市美食 (
城市id,
美食名称,
搜索指数,
关注排名)
CREATE TABLE 城市文化 (
城市id,
文化名称,
关注热度,
关注排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些城市id其外来人口来自省份多于5个,或者流入人口总占比高于40%
SELECT### Response: select 城市id from 人口来源城市 group by 城市id having sum ( 流入人口占比 ) > 0.4 or 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 流动人口年龄 (
年份,
年龄段,
占比)
CREATE TABLE 流动人口学历 (
年份,
学历,
占比)
CREATE TABLE 城市酒吧活力 (
城市id,
酒吧数量,
排名,
周末客流量,
节假日客流量,
平日客流量)
CREATE TABLE 酒吧顾客年龄 (
顾客年龄段,
占比)
CREATE TABLE 城市美食 (
城市id,
美食名称,
搜索指数,
关注排名)
CREATE TABLE 城市文化 (
城市id,
文化名称,
关注热度,
关注排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些城市id其外来人口来自省份不多于5个,或者流入人口总占比低于10%
SELECT### Response: select 城市id from 人口来源城市 group by 城市id having sum ( 流入人口占比 ) < 0.1 or 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 奢侈品用户在意维度分布 (
年龄段,
看中维度,
人数占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个年龄段的购买者购买奢侈品多于5个品牌,或者平均购买人数为15000
SELECT### Response: select 年龄段 from 奢侈品购买人群 group by 年龄段 having avg ( 购买人数 ) == 15000 or 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.
--哪些活动日所有电商平台参加活动的商家平均低于1000家,或者促销商品平均数不高于20000件
SELECT### Response: select 活动日 from 电商活动交易额 group by 活动日 having avg ( 参加活动商家数量 ) < 1000 or avg ( 促销商品数量 ) <= 20000. |
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个,或者总销售量不低于100万台
SELECT### Response: select 季度 from 产品销售 group by 季度 having sum ( 销售量 ) >= 1000000 or 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,
宣讲时间,
拟招聘人数,
参加笔试人数,
参加面试人数,
实际招聘人数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个专业所拥有的学校不低于5所,或者平均毕业不低于2000人
SELECT### Response: select 专业 from 学校各专业 group by 专业 having count ( * ) >= 5 or avg ( 毕业人数 ) >= 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.
--哪些专业在所对应的所有学校中,平均每所学校毕业了1000人,或者平均薪资加起来不低于50000元
SELECT### Response: select 专业 from 学校各专业 group by 专业 having avg ( 毕业人数 ) == 1000 or sum ( 平均薪资 ) >= 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,
名称,
所属公司,
年化收益率,
存储时间)
CREATE TABLE 理财产品与银行 (
产品id,
银行id,
单笔最高限额,
每日限转次数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪种公司类型拥有银行高于5家,或者年营业额总和低于2000亿元
SELECT### Response: select 公司类型 from 银行 group by 公司类型 having count ( * ) > 5 or sum ( 年营业额 ) < 200000000000. |
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家,或者平均年营业额不高于200亿元
SELECT### Response: select 公司类型 from 银行 group by 公司类型 having count ( * ) < 5 or avg ( 年营业额 ) <= 20000000000. |
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,
赢方兵力,
败方将军id,
败方兵力)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些朝代所有战役平均持续时间为2年,或者一共有不低于300000的人参加战役
SELECT### Response: select 朝代 from 战役 group by 朝代 having avg ( 历时时间 ) == 2 or sum ( 参战人数 ) >= 300000. |
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.
--哪些城市id拥有5家餐饮公司,或者所有餐饮公司总经营时间不超过300年
SELECT### Response: select 总部城市id from 餐饮公司 group by 总部城市id having sum ( 经营年数 ) <= 300 or 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,
出版社id,
出版册数,
出版时间)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些作者撰写多于5本外文书籍,或者书籍平均拥有5万字
SELECT### Response: select 原著作者 from 外文书籍 group by 原著作者 having avg ( 字数 ) == 50000 or count ( * ) > 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 40城消费力排名 (
城市,
所在省份,
社消总额(亿),
总额排名,
增速,
增速排名,
人均社消(万),
总GDP(亿),
人均GDP(万),
常住人口(万),
参考房价)
CREATE TABLE 各城市消费结构 (
城市,
人均可支配收入,
餐饮消费占比,
奢侈品消费占比,
旅游占比,
人均网购消费额,
电子产品消费占比)
CREATE TABLE 生态文明消费 (
环保消费品,
增长率)
CREATE TABLE 品牌消费 (
品牌,
类型,
销量占比,
销量排名)
CREATE TABLE 商品种类消费增速 (
种类,
2013年增速,
2015年增速,
2017年增速)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在40城消费力排行榜中,哪些省份所管辖城市平均社消总额等于或超过100亿,或者平均GDP不低于50亿
SELECT### Response: select 所在省份 from 40城消费力排名 group by 所在省份 having avg ( 社消总额(亿) ) >= 100 or avg ( 总GDP(亿) ) >= 50. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 40城消费力排名 (
城市,
所在省份,
社消总额(亿),
总额排名,
增速,
增速排名,
人均社消(万),
总GDP(亿),
人均GDP(万),
常住人口(万),
参考房价)
CREATE TABLE 各城市消费结构 (
城市,
人均可支配收入,
餐饮消费占比,
奢侈品消费占比,
旅游占比,
人均网购消费额,
电子产品消费占比)
CREATE TABLE 生态文明消费 (
环保消费品,
增长率)
CREATE TABLE 品牌消费 (
品牌,
类型,
销量占比,
销量排名)
CREATE TABLE 商品种类消费增速 (
种类,
2013年增速,
2015年增速,
2017年增速)
-- Using valid SQLite, answer the following questions for the tables provided above.
--在40城消费力排行榜中,哪些省份所管辖城市平均社消总额等于100亿,或者平均房价高于5万
SELECT### Response: select 所在省份 from 40城消费力排名 group by 所在省份 having avg ( 社消总额(亿) ) == 100 or avg ( 参考房价 ) > 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,
名称,
所属国家,
世界排名,
独立科研机构数量,
重点学科数量)
CREATE TABLE 高校获奖名单 (
高校id,
奖项id,
人数,
排名)
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所,或者一共设立的独立科研机构低于100家
SELECT### Response: select 所属国家 from 高校 group by 所属国家 having count ( * ) <= 5 or sum ( 独立科研机构数量 ) < 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,
奖项id,
人数,
排名)
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.
--哪些国家一共设立的独立科研机构高于100家,或者一共拥有的重点学科低于500个
SELECT### Response: select 所属国家 from 高校 group by 所属国家 having sum ( 独立科研机构数量 ) > 100 or sum ( 重点学科数量 ) < 500. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 车型 (
词条id,
名称,
上牌时间,
上牌地,
里程数,
排量,
过户记录,
所属公司)
CREATE TABLE 车型平台售卖 (
车型id,
平台,
售价,
服务费比例)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个平台售卖的车型不低于5种,售价加起来不低于500万
SELECT### Response: select 平台 from 车型平台售卖 group by 平台 having count ( * ) >= 5 or sum ( 售价 ) >= 5000000. |
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,
参加比赛id,
成绩)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个学术方向举办比赛超过5场,或者奖金总数小于10万
SELECT### Response: select 方向 from 比赛 group by 方向 having sum ( 奖金数 ) < 100000 or 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,
参加比赛id,
成绩)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个学术方向举办比赛5场,或者平均奖金小于1万
SELECT### Response: select 方向 from 比赛 group by 方向 having avg ( 奖金数 ) < 10000 or 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个,或者车款总量不低于50000
SELECT### Response: select 车型 from 汽车产品 group by 车型 having sum ( 车款数量 ) >= 50000 or 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家酒店有,或者平均价钱不低于1000元每晚
SELECT### Response: select 房型 from 酒店客房 group by 房型 having count ( * ) == 5 or avg ( 价格 ) >= 1000. |
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个,或者所占市场份额一共不低于30%
SELECT### Response: select 所属公司 from 电视机品牌 group by 所属公司 having sum ( 市场份额 ) >= 0.3 or 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,
宣讲时间,
拟招聘人数,
参加笔试人数,
参加面试人数,
实际招聘人数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些行业拥有公司不超5家,或者校园一共招聘高于5000人
SELECT### Response: select 行业 from 公司 group by 行业 having count ( * ) <= 5 or sum ( 校招人数 ) > 5000. |
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个,或者总的年薪不低于1000亿元
SELECT### Response: select 国籍 from 教练 group by 国籍 having sum ( 年薪 ) >= 100000000000 or 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 流动人口年龄 (
年份,
年龄段,
占比)
CREATE TABLE 流动人口学历 (
年份,
学历,
占比)
CREATE TABLE 城市酒吧活力 (
城市id,
酒吧数量,
排名,
周末客流量,
节假日客流量,
平日客流量)
CREATE TABLE 酒吧顾客年龄 (
顾客年龄段,
占比)
CREATE TABLE 城市美食 (
城市id,
美食名称,
搜索指数,
关注排名)
CREATE TABLE 城市文化 (
城市id,
文化名称,
关注热度,
关注排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些城市id欢迎的美食为5种,或者平均搜索美食指数为7.0
SELECT### Response: select 城市id from 城市美食 group by 城市id having avg ( 搜索指数 ) == 7.0 or count ( * ) == 5. |
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.
--哪些平台销售书籍多于5本,或者平均售价不超30元
SELECT### Response: select 平台 from 购买平台 group by 平台 having count ( * ) > 5 or avg ( 售价 ) <= 30. |
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 热门出境游城市 (
城市,
所在国家,
国内游客数量,
排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些省份管辖城市不到5个,或者城市平均占地面积不高于30万平方千米
SELECT### Response: select 所属省份 from 城市 group by 所属省份 having count ( * ) < 5 or avg ( 城市面积 ) <= 300000. |
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,
页数,
定价,
出版社,
出版时间,
开本)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些出版社出版的所有文集页数加起来不高于300000页,或者所有定价加起来高于50万元
SELECT### Response: select 出版社 from 文集 group by 出版社 having sum ( 页数 ) <= 300000 or sum ( 定价 ) > 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,
名称,
产品定位,
屏幕尺寸,
屏幕比例,
分辨率,
背光灯寿命,
定价,
品牌id)
CREATE TABLE 电视机平台售卖 (
型号id,
平台,
售价,
最高价格,
最低价格,
售卖量,
用户评分)
CREATE TABLE 各城市电视机售卖 (
城市,
所属省份,
电视机售卖量,
观看电视日平均用时)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些平台售卖的电视机型号等于或超过5种,售价加起来超过50万元
SELECT### Response: select 平台 from 电视机平台售卖 group by 平台 having count ( * ) >= 5 or sum ( 售价 ) > 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,
唱片公司,
签约时间)
CREATE TABLE 金曲奖提名名单 (
奖届id,
奖项名称,
提名歌手id,
提名作品)
CREATE TABLE 金曲奖获奖名单 (
奖届id,
奖项名称,
获奖歌手id,
歌手唱片公司)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些地方出生的歌手所出专辑总量不低于50万本,或者平均开了20场演唱会
SELECT### Response: select 出生地 from 歌手 group by 出生地 having sum ( 专辑数量 ) >= 500000 or avg ( 演唱会总场次 ) >= 20. |
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,
歌手唱片公司)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些地方出生的歌手所出专辑平均高于100张,或者平均歌曲数量低于200
SELECT### Response: select 出生地 from 歌手 group by 出生地 having avg ( 专辑数量 ) > 100 or avg ( 歌曲数量 ) < 200. |
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个,或者一共接待海外游客不多于300万
SELECT### Response: select 级别 from 旅行社 group by 级别 having avg ( 出境游国家数量 ) <= 5 or sum ( 接待海外游客数量 ) <= 3000000. |
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个做过官的诗人,或者所有诗人平均做官时间为3年
SELECT### Response: select 所处年号 from 做官的诗人 group by 所处年号 having count ( * ) < 5 or avg ( 做官时间 ) == 3. |
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.
--哪些朝代拥有皇帝最多5个,或者每个皇帝平均有多于20个子女
SELECT### Response: select 所处朝代 from 皇帝 group by 所处朝代 having count ( * ) <= 5 or avg ( 子女数量 ) > 20. |
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.
--哪些朝代拥有皇帝最多5个,或者所有皇帝子女加起来至少100个
SELECT### Response: select 所处朝代 from 皇帝 group by 所处朝代 having sum ( 子女数量 ) >= 100 or 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 流动人口年龄 (
年份,
年龄段,
占比)
CREATE TABLE 流动人口学历 (
年份,
学历,
占比)
CREATE TABLE 城市酒吧活力 (
城市id,
酒吧数量,
排名,
周末客流量,
节假日客流量,
平日客流量)
CREATE TABLE 酒吧顾客年龄 (
顾客年龄段,
占比)
CREATE TABLE 城市美食 (
城市id,
美食名称,
搜索指数,
关注排名)
CREATE TABLE 城市文化 (
城市id,
文化名称,
关注热度,
关注排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个城市id的人口流向省份不超过5个,或者流出人口总占比不低于20%
SELECT### Response: select 城市id from 人口去向城市 group by 城市id having count ( * ) <= 5 or sum ( 流出人口占比 ) >= 0.2. |
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个,或者品牌平均注册资本不超过30万元
SELECT### Response: select 法定代表人 from 品牌 group by 法定代表人 having count ( * ) < 5 or avg ( 注册资本 ) <= 300000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 各省份报名人数 (
省份,
岗位数,
招考人数,
报名人数,
0报名职位数量,
合格人数,
0合格职位数量,
竞争比)
CREATE TABLE 各职位报名人数 (
职位名称,
部门名称,
所属地区,
招考人数,
报考人数,
合格人数)
CREATE TABLE 各国野鸡大学数量 (
国家,
大学数量,
野鸡大学数量)
CREATE TABLE 中国各城市野鸡大学数量 (
城市,
野鸡大学数量,
占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些部门招聘职位一共招考人数高于200名,或者平均报考人数低于10000人
SELECT### Response: select 部门名称 from 各职位报名人数 group by 部门名称 having sum ( 招考人数 ) > 200 or avg ( 报考人数 ) < 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 匹数对应面积 (
匹数,
最小面积,
最大面积)
CREATE TABLE 空调各季度售卖 (
型号id,
季度,
售价,
最高价格,
最低价格,
售卖量)
CREATE TABLE 空调各城市售卖 (
城市,
空调售卖量,
空调日平均用时)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些季度售卖的空调型号不超过5种,售价加起来不低于50万元
SELECT### Response: select 季度 from 空调各季度售卖 group by 季度 having count ( * ) <= 5 or sum ( 售价 ) >= 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,
路线名称,
旅行社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个,或者所有路线总旅行时间低于50天
SELECT### Response: select 国家 from 出境游所含国家 group by 国家 having count ( * ) <= 5 or sum ( 旅行天数 ) < 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,
路线名称,
旅行社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天,或者平均所含景点不超过5个
SELECT### Response: select 国家 from 出境游所含国家 group by 国家 having sum ( 旅行天数 ) <= 50 or avg ( 景点数量 ) <= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 40城消费力排名 (
城市,
所在省份,
社消总额(亿),
总额排名,
增速,
增速排名,
人均社消(万),
总GDP(亿),
人均GDP(万),
常住人口(万),
参考房价)
CREATE TABLE 各城市消费结构 (
城市,
人均可支配收入,
餐饮消费占比,
奢侈品消费占比,
旅游占比,
人均网购消费额,
电子产品消费占比)
CREATE TABLE 生态文明消费 (
环保消费品,
增长率)
CREATE TABLE 品牌消费 (
品牌,
类型,
销量占比,
销量排名)
CREATE TABLE 商品种类消费增速 (
种类,
2013年增速,
2015年增速,
2017年增速)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些品牌消费类型超过5种,或者所有销量占比加起来至少80%
SELECT### Response: select 品牌 from 品牌消费 group by 品牌 having count ( * ) > 5 or sum ( 销量占比 ) >= 0.8. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 40城消费力排名 (
城市,
所在省份,
社消总额(亿),
总额排名,
增速,
增速排名,
人均社消(万),
总GDP(亿),
人均GDP(万),
常住人口(万),
参考房价)
CREATE TABLE 各城市消费结构 (
城市,
人均可支配收入,
餐饮消费占比,
奢侈品消费占比,
旅游占比,
人均网购消费额,
电子产品消费占比)
CREATE TABLE 生态文明消费 (
环保消费品,
增长率)
CREATE TABLE 品牌消费 (
品牌,
类型,
销量占比,
销量排名)
CREATE TABLE 商品种类消费增速 (
种类,
2013年增速,
2015年增速,
2017年增速)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些品牌消费类型超过5种,或者所有销量占比加起来低于80%
SELECT### Response: select 品牌 from 品牌消费 group by 品牌 having count ( * ) > 5 or sum ( 销量占比 ) < 0.8. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 地产集团 (
词条id,
名称,
位于城市,
所属省份,
年销售额,
销售额同比增长,
销售额市场占比,
商品房销售面积,
销售面积同比增长,
销售面积,
市场占比)
CREATE TABLE 2019年房地产企业500强 (
集团id,
总排名,
发展潜力排名,
成长速度排名,
综合发展排名,
创新能力排名)
CREATE TABLE 2019年房地产企业运营100强 (
集团id,
运营效率排名,
区域运营排名,
稳健运营排名,
商业地产运营排名,
社区文化运营排名,
长租公寓运营排名)
CREATE TABLE 房地产各城市排名 (
集团id,
城市,
排名,
销售面积,
销售额)
CREATE TABLE 房产公司典型项目 (
项目名称,
所属集团id,
位于城市,
占地面积,
总户数,
户型面积)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些城市开发的房地产典型项目超过5个,或者所有项目平均占地超过10万平方米
SELECT### Response: select 位于城市 from 房产公司典型项目 group by 位于城市 having avg ( 占地面积 ) >= 100000 or 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 火星探测国家 (
探测器,
发射时间,
国家,
结果)
CREATE TABLE 月球探测国家 (
飞行器,
时间,
国家,
有无航天员,
探测目的)
CREATE TABLE 载人飞船 (
飞船名称,
发射时间,
发射数量,
国家,
航天员数量,
航天员出舱时间)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些导演执导最多5部行星相关电影,或者所执导电影豆瓣平均评分低于8分
SELECT### Response: select 导演 from 行星相关电影 group by 导演 having count ( * ) <= 5 or avg ( 豆瓣评分 ) < 8. |
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 中国花卉园博会 (
时间,
届数,
举办城市,
地点,
展园数量,
参与机构数量)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些城市举办的中国花卉园博会总的展园低于200个,或者所有参与机构加起来最少1000家
SELECT### Response: select 举办城市 from 中国花卉园博会 group by 举办城市 having sum ( 展园数量 ) < 200 or sum ( 参与机构数量 ) >= 1000. |
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家,或者所有商家网店一共覆盖国家超过20个
SELECT### Response: select 所属国家 from 商家 group by 所属国家 having count ( * ) > 5 or sum ( 网店覆盖国家数量 ) > 20. |
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场,或者平均售出票数多于1000张
SELECT### Response: select 城市 from 戏剧演出活动 group by 城市 having count ( * ) >= 5 or avg ( 售出票数 ) > 1000. |
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.
--哪些国家拥有的篮球运动员最多50名,或者平均身高高于190cm
SELECT### Response: select 国籍 from 篮球运动员 group by 国籍 having count ( * ) <= 50 or avg ( 身高 ) > 190. |
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种,或者平均购买人数占比低于15%
SELECT### Response: select 年龄段 from 网红食品购买者 group by 年龄段 having avg ( 人数占比 ) < 0.15 or count ( * ) < 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 学校 (
词条id,
名称,
类型,
所在城市,
所属省份,
是否985院校,
是否211院校,
2016届平均月薪,
2014届平均月薪,
2012届平均月薪)
CREATE TABLE 学校毕业人数 (
学校id,
学历,
2016届人数,
2014届人数,
2012届人数)
CREATE TABLE 专业 (
词条id,
名称,
学科类型,
冷热门)
CREATE TABLE 学校专业 (
专业id,
学校id,
是否重点专业)
CREATE TABLE 专业就业情况 (
专业id,
2016届平均月薪,
2014届平均月薪,
2012届平均月薪,
2016届就业率,
2014届就业率,
2012届就业率)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些学校类型在2016届平均月薪高于6000元,或者2014届平均月薪低于4000元
SELECT### Response: select 类型 from 学校 group by 类型 having avg ( 2016届平均月薪 ) > 6000 or avg ( 2014届平均月薪 ) < 4000. |
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 历届马拉松纪录 (
年份,
城市,
参赛者最小年龄,
参赛者最大年龄,
全程最少时间)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些赛程所对应的马拉松低于5场,或者平均报名人数高于1000人
SELECT### Response: select 赛程 from 马拉松赛程 group by 赛程 having count ( * ) < 5 or avg ( 报名人数 ) > 1000. |
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.
--哪些地点举办的车展平均持续20天,或者一共有少于50个参展品牌
SELECT### Response: select 车展地点 from 车展 group by 车展地点 having avg ( 参展天数 ) == 20 or sum ( 参展品牌数 ) < 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,
菜名,
口味,
月销售量,
必点比例)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪种菜系对应的饭店不超过5家,或者口味平均评分高于8
SELECT### Response: select 菜系 from 饭店 group by 菜系 having count ( * ) < 5 or avg ( 口味评分 ) > 8. |
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,
歌手唱片公司)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个主持人主持的金曲奖多于5届,或者平均奖项数低于20个
SELECT### Response: select 主持人 from 各届金曲奖 group by 主持人 having avg ( 奖项数量 ) < 20 or 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)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个国家出生的建筑师少于5名,或者平均拥有作品低于5个
SELECT### Response: select 国籍 from 建筑师 group by 国籍 having count ( * ) < 5 or avg ( 作品数量 ) < 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.
--哪些语言主笔的期刊有5本,或者平均出版刊数最多1500刊
SELECT### Response: select 语言 from 期刊 group by 语言 having count ( * ) == 5 or avg ( 出版刊数 ) <= 1500. |
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.
--哪些语言主笔的期刊超过5本,或者平均出版刊数低于100刊
SELECT### Response: select 语言 from 期刊 group by 语言 having count ( * ) > 5 or avg ( 出版刊数 ) < 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,
年龄段,
人数占比)
CREATE TABLE 网红食品分布城市 (
类型id,
省份,
销售量占比,
商家占比,
安全事件关注度)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些省份销售的所有网红食品销售量总占比最高30%,或者各类食品平均拥有商家占比高于5%
SELECT### Response: select 省份 from 网红食品分布城市 group by 省份 having sum ( 销售量占比 ) <= 0.3 or avg ( 商家占比 ) > 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,
演讲主题,
论坛,
开始时间,
演讲时长)
CREATE TABLE 峰会赞助公司 (
峰会id,
公司,
赞助级别)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些论坛主讲嘉宾超过5个,或者总的演讲时长不到300分钟
SELECT### Response: select 论坛 from 峰会嘉宾 group by 论坛 having count ( * ) > 5 or sum ( 演讲时长 ) < 300. |
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首,或者诗词平均传播度不低于8
SELECT### Response: select 文学体裁 from 诗词 group by 文学体裁 having avg ( 传播度 ) >= 8 or 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 2019年房地产企业500强 (
集团id,
总排名,
发展潜力排名,
成长速度排名,
综合发展排名,
创新能力排名)
CREATE TABLE 2019年房地产企业运营100强 (
集团id,
运营效率排名,
区域运营排名,
稳健运营排名,
商业地产运营排名,
社区文化运营排名,
长租公寓运营排名)
CREATE TABLE 房地产各城市排名 (
集团id,
城市,
排名,
销售面积,
销售额)
CREATE TABLE 房产公司典型项目 (
项目名称,
所属集团id,
位于城市,
占地面积,
总户数,
户型面积)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些城市至少拥有5个房产集团,或者平均销售面积高于10万平方米
SELECT### Response: select 城市 from 房地产各城市排名 group by 城市 having count ( * ) >= 5 or avg ( 销售面积 ) > 100000. |
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种,或者各戏剧平均拥有戏迷大于5000人
SELECT### Response: select 城市 from 戏剧分布城市 group by 城市 having avg ( 戏迷数量 ) > 5000 or 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.
--哪些国家在各类项目平均获得50块金牌,或者平均最少获得100块奖牌
SELECT### Response: select 国家 from 项目流行国家 group by 国家 having avg ( 所获金牌总数 ) == 50 or avg ( 所获奖牌总数 ) >= 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,
名称,
类型,
始发站id,
到达站id,
出发时间,
到达时间)
CREATE TABLE 列车票价 (
日期,
列车id,
车票类型,
票价,
余票)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些城市的火车站距机场平均距离为10公里,或者距市中心距离之和不超过30公里
SELECT### Response: select 所属城市 from 火车站 group by 所属城市 having avg ( 距机场距离 ) == 10 or sum ( 距市中心距离 ) <= 30. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 智能手机公司 (
词条id,
名称,
所属国家,
年营业额,
年利润,
世界排名)
CREATE TABLE 智能手机全球出货量 (
公司id,
2017年出货量,
2017年市场占比,
2018年出货量,
2018年市场占比,
占比提升幅度)
CREATE TABLE 智能手机部署国家 (
公司id,
部署国家,
部署年份,
销售量排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个国家拥有智能手机公司多于5家,或者平均年营业额低于10亿元
SELECT### Response: select 所属国家 from 智能手机公司 group by 所属国家 having avg ( 年营业额 ) < 1000000000 or 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,
铜牌获得者id)
CREATE TABLE 球员夺冠次数 (
球员id,
赛事id,
冠军次数,
亚军次数,
季军次数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个国家参加的赛事多于5个,或者平均获得10个冠军
SELECT### Response: select 国家名称 from 冠军国家 group by 国家名称 having count ( * ) > 5 or avg ( 冠军数量 ) == 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,
名称,
主频尺寸,
像素,
内存容量,
操作系统,
解锁方式,
售价,
售出量,
品牌id)
CREATE TABLE 型号使用人群 (
型号id,
人群,
使用占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪种操作系统使用的手机少于5种型号,或者平均售价不超1999元
SELECT### Response: select 操作系统 from 手机型号 group by 操作系统 having count ( * ) < 5 or avg ( 售价 ) <= 1999. |
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种姓氏,或者所有姓氏人口总占比最高30%
SELECT### Response: select 区域 from 姓氏分布区域 group by 区域 having sum ( 人口占比 ) <= 0.3 or 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,
人群,
使用占比)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个创始人创办的公司多于5家,或者其所有公司年营业额加起来低于100亿
SELECT### Response: select 创始人 from 公司 group by 创始人 having count ( * ) > 5 or sum ( 年营业额 ) < 10000000000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 水果 (
词条id,
名称,
特性,
适合季节,
每100克热量,
每100克水分)
CREATE TABLE 省份 (
词条id,
名称,
气候,
所属区域)
CREATE TABLE 水果产地 (
水果id,
省份id,
是否特产,
年平均产量,
销售形式)
CREATE TABLE 水果销售城市 (
水果id,
原产省份id,
销往省份id,
年销售量)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪种特性包含的水果每100克总热量高于1000焦,或者每100克总含水分不少于80克
SELECT### Response: select 特性 from 水果 group by 特性 having sum ( 每100克热量 ) > 1000 or sum ( 每100克水分 ) >= 80. |
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,
姓名,
所处朝代id,
出生时间,
去世时间,
职业)
CREATE TABLE 大臣辅佐的皇帝 (
大臣id,
皇帝id,
辅佐时间)
-- Using valid SQLite, answer the following questions for the tables provided above.
--朝代人口总数不小于100万并且平均国土面积不小于100万平方千米的朝代的都城
SELECT### Response: select 都城 from 朝代 group by 都城 having sum ( 人口数量 ) >= 1000000 and avg ( 国土面积 ) >= 1000000000000. |
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,
姓名,
所处朝代id,
出生时间,
去世时间,
职业)
CREATE TABLE 大臣辅佐的皇帝 (
大臣id,
皇帝id,
辅佐时间)
-- Using valid SQLite, answer the following questions for the tables provided above.
--平均人口数量小于100万并且平均国土面积小于100万平方千米的朝代的都城
SELECT### Response: select 都城 from 朝代 group by 都城 having avg ( 人口数量 ) < 1000000 and avg ( 国土面积 ) < 1000000000000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 滴滴打车出行 (
季节,
是否工作日,
温度,
湿度,
风速,
日订单数量,
人均打车次数,
平均等待时间)
CREATE TABLE 共享单车出行 (
季节,
是否工作日,
温度,
湿度,
风速,
人均骑车次数,
人均骑车距离)
-- Using valid SQLite, answer the following questions for the tables provided above.
--有哪些季节,滴滴打车出行中平均温度等于25度,平均湿度等于70%
SELECT### Response: select 季节 from 滴滴打车出行 group by 季节 having avg ( 温度 ) == 25 and avg ( 湿度 ) == 0.7. |
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.
--哪些出发城市,出镜游路线中景点门票成人价格总和不大于100,儿童价格总和不小于80
SELECT### Response: select 出发城市 from 出境游路线 group by 出发城市 having sum ( 成人价格 ) <= 100 and sum ( 儿童价格 ) >= 80. |
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,平均出资比例等于50%
SELECT### Response: select 股东公司 from 基金公司的股东公司 group by 股东公司 having count ( * ) < 5 and avg ( 出资比例 ) == 0.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,并且主要车系总数量不小于50
SELECT### Response: select 所属国家 from 汽车公司 group by 所属国家 having count ( * ) < 5 and sum ( 主要车系数量 ) >= 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.
--有哪些国家拍摄的电影,片长总和大于20小时,豆瓣评分总和大于70
SELECT### Response: select 拍摄国家 from 电影 group by 拍摄国家 having sum ( 片长 ) > 20 and sum ( 豆瓣评分 ) > 70. |
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,年营业额平均值不小于1000万的公司位于的城市
SELECT### Response: select 位于城市 from 中国最赚钱公司 group by 位于城市 having count ( * ) > 5 and avg ( 年营业额 ) > 10000000. |
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 流动人口年龄 (
年份,
年龄段,
占比)
CREATE TABLE 流动人口学历 (
年份,
学历,
占比)
CREATE TABLE 城市酒吧活力 (
城市id,
酒吧数量,
排名,
周末客流量,
节假日客流量,
平日客流量)
CREATE TABLE 酒吧顾客年龄 (
顾客年龄段,
占比)
CREATE TABLE 城市美食 (
城市id,
美食名称,
搜索指数,
关注排名)
CREATE TABLE 城市文化 (
城市id,
文化名称,
关注热度,
关注排名)
-- Using valid SQLite, answer the following questions for the tables provided above.
--人口来源城市数小于5,平均流入人口占比不大于30%的城市
SELECT### Response: select 城市id from 人口来源城市 group by 城市id having count ( * ) < 5 and avg ( 流入人口占比 ) <= 0.3. |
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,且参加活动商家总数量大于1000
SELECT### Response: select 活动日 from 电商活动交易额 group by 活动日 having count ( * ) > 5 and sum ( 参加活动商家数量 ) > 1000. |
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.
--产品总销售量不大于5000,销售量总增长不大于2000的季度
SELECT### Response: select 季度 from 产品销售 group by 季度 having sum ( 销售量 ) <= 5000 and sum ( 销售量增长 ) <= 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,
菜系id,
口味)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些菜品起源地,菜品数不小于5,平均菜品做法数量等于3
SELECT### Response: select 起源地 from 菜品 group by 起源地 having count ( * ) >= 5 and avg ( 版本数量 ) == 3. |
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.
--哪些菜品起源地菜品数不小于5,平均菜品做法的数量大于3
SELECT### Response: select 起源地 from 菜品 group by 起源地 having count ( * ) >= 5 and avg ( 版本数量 ) > 3. |
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,
赢方兵力,
败方将军id,
败方兵力)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个朝代战役的历时时间平均值小于三个月,且参战人数总和大于等于10万
SELECT### Response: select 朝代 from 战役 group by 朝代 having avg ( 历时时间 ) < 3 and sum ( 参战人数 ) >= 100000. |
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,
赢方兵力,
败方将军id,
败方兵力)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪个朝代中战役的数量小于5,且战役的历时时间总和大于一年
SELECT### Response: select 朝代 from 战役 group by 朝代 having count ( * ) < 5 and sum ( 历时时间 ) > 1. |
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,
出版社id,
出版册数,
出版时间)
-- Using valid SQLite, answer the following questions for the tables provided above.
--有哪些原著作者,外文书籍数量为5,且书籍总字数不小于20万
SELECT### Response: select 原著作者 from 外文书籍 group by 原著作者 having count ( * ) == 5 and sum ( 字数 ) >= 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,
译者id,
出版社id,
出版册数,
出版时间)
-- Using valid SQLite, answer the following questions for the tables provided above.
--有哪些原著作者,外文书籍数量为5,且书籍总字数小于30万
SELECT### Response: select 原著作者 from 外文书籍 group by 原著作者 having count ( * ) == 5 and sum ( 字数 ) < 300000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 40城消费力排名 (
城市,
所在省份,
社消总额(亿),
总额排名,
增速,
增速排名,
人均社消(万),
总GDP(亿),
人均GDP(万),
常住人口(万),
参考房价)
CREATE TABLE 各城市消费结构 (
城市,
人均可支配收入,
餐饮消费占比,
奢侈品消费占比,
旅游占比,
人均网购消费额,
电子产品消费占比)
CREATE TABLE 生态文明消费 (
环保消费品,
增长率)
CREATE TABLE 品牌消费 (
品牌,
类型,
销量占比,
销量排名)
CREATE TABLE 商品种类消费增速 (
种类,
2013年增速,
2015年增速,
2017年增速)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些省份中消费力排名数量大于5,且平均社会消总额等于40亿
SELECT### Response: select 所在省份 from 40城消费力排名 group by 所在省份 having count ( * ) > 5 and avg ( 社消总额(亿) ) == 4000000000. |
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,
姓名,
性别,
国籍,
出生日期,
职业)
CREATE TABLE 毕业院校 (
科学家id,
高校id,
获得学位)
CREATE TABLE 诺贝尔奖科学家名单 (
年份,
奖项id,
科学家id,
理由)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些国家高校数少于5,独立科研机构总数量不少于10
SELECT### Response: select 所属国家 from 高校 group by 所属国家 having count ( * ) < 5 and sum ( 独立科研机构数量 ) >= 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,
平台,
售价,
服务费比例)
-- Using valid SQLite, answer the following questions for the tables provided above.
--哪些售车平台,平台售卖数量等于5,且总售价不小于10万
SELECT### Response: select 平台 from 车型平台售卖 group by 平台 having count ( * ) == 5 and sum ( 售价 ) >= 100000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 各省中小学假期 (
省份,
年级,
寒假天数,
暑假天数)
CREATE TABLE 大学假期 (
学校,
所属省份,
寒假天数,
暑假天数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--有哪些省份,中小学假期数大于5,平均寒假天数少于30天
SELECT### Response: select 省份 from 各省中小学假期 group by 省份 having count ( * ) > 5 and avg ( 寒假天数 ) < 30. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE 各省中小学假期 (
省份,
年级,
寒假天数,
暑假天数)
CREATE TABLE 大学假期 (
学校,
所属省份,
寒假天数,
暑假天数)
-- Using valid SQLite, answer the following questions for the tables provided above.
--有哪些省份,中小学假期数小于5,平均寒假天数不少于30天
SELECT### Response: select 省份 from 各省中小学假期 group by 省份 having count ( * ) < 5 and avg ( 寒假天数 ) >= 30. |
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,
是否对比论文)
-- Using valid SQLite, answer the following questions for the tables provided above.
--论文数量不多于5,且平均引用量不多于10的会议名称
SELECT### Response: select 会议名称 from 论文 group by 会议名称 having count ( * ) <= 5 and avg ( 引用量 ) <= 10. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.