jtjt520j/CSpider_for_Qwen huggingface dataset:
问题: 最多去一次的旅游景点的名称和ID是什么？

SQL: SELECT T1.Name ,  T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  <=  1
问题: “步行”可以到达或者地址在 “石象路7号” 的旅游景点叫什么名字？

SQL: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "石象路7号" OR T2.How_to_Get_There  =  "步行"
问题: 找出旅游景点的名字，既可以通过“步行”，或者地址在 “石象路7号”。

SQL: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "石象路7号" OR T2.How_to_Get_There  =  "步行"
问题: 那些以停车或购物为特色的旅游景点叫什么名字？

SQL: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  "park" UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  "shopping"
问题: 找出有停车或购物作为特色细节的旅游景点。景点名称是什么？

SQL: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  "park" UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  "shopping"
问题: “公共汽车”能到达或地址在 “长江路292号” 的旅游景点叫什么名字？

SQL: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "长江路292号" OR T2.How_to_Get_There  =  "公共汽车"
问题: 找出旅游景点的名称，可以乘坐“公共汽车”或地址在 “长江路292号” 。

SQL: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "长江路292号" OR T2.How_to_Get_There  =  "公共汽车"
问题: “维华”和 “慧兰” 参观的旅游景点名称是什么？

SQL: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "维华" INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "慧兰"
问题: 游客“维华”和“慧兰”参观哪些景点？告诉我景点的名字。

SQL: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "维华" INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "慧兰"
问题: “张颖”参观但 “李强” 没有参观的旅游景点叫什么名字？

SQL: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "李强" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "张颖"
问题: 找出叫“张颖”的游客但 “李强” 没去的旅游景点的名字。

SQL: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "李强" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "张颖"
问题: 有多少游客没有去参观？

SQL: SELECT count(*) FROM Visitors WHERE Tourist_ID NOT IN ( SELECT Tourist_ID FROM Visits )
问题: 统计没有参观任何地方的游客人数。

SQL: SELECT count(*) FROM Visitors WHERE Tourist_ID NOT IN ( SELECT Tourist_ID FROM Visits )
问题: 有多少视频游戏存在？

SQL: SELECT count(*) FROM Video_games
问题: 你有多少个电子游戏？

SQL: SELECT count(*) FROM Video_games
问题: 有多少种电子游戏类型？

SQL: SELECT count(DISTINCT gtype) FROM Video_games
问题: 不同游戏类型的计数是多少？

SQL: SELECT count(DISTINCT gtype) FROM Video_games
问题: 显示所有视频游戏类型。

SQL: SELECT DISTINCT gtype FROM Video_games
问题: 电子游戏有什么不同的类型？

SQL: SELECT DISTINCT gtype FROM Video_games
问题: 按照他们名字的顺序显示所有的电子游戏和他们的类型。

SQL: SELECT gname ,  gtype FROM Video_games ORDER BY gname
问题: 所有的电子游戏的名称和字母顺序的类型是什么？

SQL: SELECT gname ,  gtype FROM Video_games ORDER BY gname
问题: 显示所有“收集卡片”类型的视频游戏。

SQL: SELECT gname FROM Video_games WHERE gtype  =  "收集卡片"
问题: 所有“收集卡片”类型的电子游戏的名字是什么？

SQL: SELECT gname FROM Video_games WHERE gtype  =  "收集卡片"
问题: “使命召唤”的类型是什么？

SQL: SELECT gtype FROM Video_games WHERE gname  =  "使命召唤"
问题: “使命召唤”是什么类型的游戏？

SQL: SELECT gtype FROM Video_games WHERE gname  =  "使命召唤"
问题: 有多少视频游戏是“大型多人在线游戏”？

SQL: SELECT count(*) FROM Video_games WHERE gtype  =  "大型多人在线游戏"
问题: 计算“大型多人在线游戏”类型的游戏数量。

SQL: SELECT count(*) FROM Video_games WHERE gtype  =  "大型多人在线游戏"
问题: 显示所有视频游戏类型和每种类型的视频游戏的数量。

SQL: SELECT gtype ,  count(*) FROM Video_games GROUP BY gtype
问题: 有什么类型的电子游戏和每种类型有多少？

SQL: SELECT gtype ,  count(*) FROM Video_games GROUP BY gtype
问题: 哪种游戏类型有最多的游戏？

SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1
问题: 什么类型的游戏最多？

SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1
问题: 哪种游戏类型的游戏数量最少？

SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1
问题: 什么类型的游戏最少？

SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1
问题: 显示所有住在“慧园”的学生的 ID 。

SQL: SELECT StuID FROM Student WHERE city_code  =  "慧园"
问题: 生活在“慧园”中的所有学生的ID是什么？

SQL: SELECT StuID FROM Student WHERE city_code  =  "慧园"
问题: 显示所有导师是1121号的学生的ID 。

SQL: SELECT StuID FROM Student WHERE Advisor  =  1121
问题: 有1121号导师的学生的ID是什么？

SQL: SELECT StuID FROM Student WHERE Advisor  =  1121
问题: 显示主修课程编号是600的学生的名字。

SQL: SELECT Fname FROM Student WHERE Major  =  600
问题: 所有主修课程编号是600课程的学生的名字是什么？

SQL: SELECT Fname FROM Student WHERE Major  =  600
问题: 显示不同专业的平均年龄、最小年龄和最大年龄。

SQL: SELECT major ,  avg(age) ,  min(age) ,  max(age) FROM Student GROUP BY major
问题: 每个专业的平均年龄、最小年龄和最大年龄是多少？

SQL: SELECT major ,  avg(age) ,  min(age) ,  max(age) FROM Student GROUP BY major
问题: 显示所有至少有两个学生的导师。

SQL: SELECT advisor FROM Student GROUP BY advisor HAVING count(*)  >=  2
问题: 什么是导师？

SQL: SELECT advisor FROM Student GROUP BY advisor HAVING count(*)  >=  2
问题: 我们有多少运动？

SQL: SELECT count(DISTINCT sportname) FROM Sportsinfo
问题: 我们提供多少种不同类型的运动？

SQL: SELECT count(DISTINCT sportname) FROM Sportsinfo
问题: 有多少学生参加体育活动？

SQL: SELECT count(DISTINCT StuID) FROM Sportsinfo
问题: 有多少不同的学生参与体育运动？

SQL: SELECT count(DISTINCT StuID) FROM Sportsinfo
问题: 列出所有获得奖学金的学生的ID 。

SQL: SELECT StuID FROM Sportsinfo WHERE onscholarship  =  "Y"
问题: 所有获得奖学金的运动生的ID是什么？

SQL: SELECT StuID FROM Sportsinfo WHERE onscholarship  =  "Y"
问题: 显示所有获得奖学金的学生的姓氏。

SQL: SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.onscholarship  =  "Y"
问题: 所有奖学金学生的姓氏是什么？

SQL: SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.onscholarship  =  "Y"
问题: 所有学生玩多少种游戏？

SQL: SELECT sum(gamesplayed) FROM Sportsinfo
问题: 游戏的总数是多少？

SQL: SELECT sum(gamesplayed) FROM Sportsinfo
问题: 所有有奖学金学生的“足球”比赛共有多少场比赛？

SQL: SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname  =  "足球" AND onscholarship  =  "Y"
问题: 有奖学金学生的所有“足球”比赛的总数是多少？

SQL: SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname  =  "足球" AND onscholarship  =  "Y"
问题: 显示所有体育名称和学生人数。

SQL: SELECT sportname ,  count(*) FROM Sportsinfo GROUP BY sportname
问题: 每项运动有多少学生玩？

SQL: SELECT sportname ,  count(*) FROM Sportsinfo GROUP BY sportname
问题: 显示所有学生ID与运动的数量和游戏的总数

SQL: SELECT StuID ,  count(*) ,  sum(gamesplayed) FROM Sportsinfo GROUP BY StuID
问题: 所有学生的ID和他们参加了多少运动和游戏？

SQL: SELECT StuID ,  count(*) ,  sum(gamesplayed) FROM Sportsinfo GROUP BY StuID
问题: 显示所有参加运动项目每周超过10小时的学生的ID。

SQL: SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek)  >  10
问题: 每周参加所有运动项目上超过10个小时的学生的ID是什么？

SQL: SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek)  >  10
问题: 运动次数最多的学生的名字和姓氏是什么？

SQL: SELECT T2.Fname ,  T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1
问题: 运动最多次数的学生的名字和姓氏是什么？

SQL: SELECT T2.Fname ,  T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1
问题: 哪项运动获得奖学金的学生参加最多？

SQL: SELECT sportname FROM Sportsinfo WHERE onscholarship  =  "Y" GROUP BY sportname ORDER BY count(*) DESC LIMIT 1
问题: 有奖学金的学生最多参加的运动是什么？

SQL: SELECT sportname FROM Sportsinfo WHERE onscholarship  =  "Y" GROUP BY sportname ORDER BY count(*) DESC LIMIT 1
问题: 显示没有任何运动的学生ID 。

SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo
问题: 不参加体育运动的学生的ID是什么？

SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo
问题: 显示有奖学金且主修编号是600课程的学生ID 。

SQL: SELECT StuID FROM Student WHERE major  =  600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship  =  "Y"
问题: 主修编号是600课程且有奖学金的学生的ID是什么？

SQL: SELECT StuID FROM Student WHERE major  =  600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship  =  "Y"
问题: 显示是女性和踢“足球”的学生ID。

SQL: SELECT StuID FROM Student WHERE sex  =  "F" INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname  =  "足球"
问题: 所有女生踢“足球”的ID是什么？

SQL: SELECT StuID FROM Student WHERE sex  =  "F" INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname  =  "足球"
问题: 展示所有不踢“足球”的男学生ID 。

SQL: SELECT StuID FROM Student WHERE sex  =  "M" EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname  =  "足球"
问题: 不踢“足球”的所有男生的ID是什么？

SQL: SELECT StuID FROM Student WHERE sex  =  "M" EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname  =  "足球"
问题: 显示每周的总小时数和学生“韩”“江城”玩游戏的次数。

SQL: SELECT sum(hoursperweek) ,  sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.Fname  =  "江城" AND T2.Lname  =  "韩"
问题: “韩”“江城”每次工作的总小时数和玩游戏的次数是多少？

SQL: SELECT sum(hoursperweek) ,  sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.Fname  =  "江城" AND T2.Lname  =  "韩"
问题: 显示每周的总小时数和20岁以下学生玩游戏的数目。

SQL: SELECT sum(hoursperweek) ,  sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.age  <  20
问题: 每周的总小时数和20岁以下的学生游戏次数是多少？

SQL: SELECT sum(hoursperweek) ,  sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.age  <  20
问题: 有多少学生玩电子游戏？

SQL: SELECT count(DISTINCT StuID) FROM Plays_games
问题: 有多少不同的学生玩游戏？

SQL: SELECT count(DISTINCT StuID) FROM Plays_games
问题: 显示不玩电子游戏的学生的ID。

SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games
问题: 所有不是电子游戏玩家的学生的ID是什么？

SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games
问题: 显示玩电子游戏和运动的学生ID。

SQL: SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games
问题: 玩电子游戏和体育运动的学生的ID是什么？

SQL: SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games
问题: 显示所有游戏的ID和玩的小时数。

SQL: SELECT gameid ,  sum(hours_played) FROM Plays_games GROUP BY gameid
问题: 每个游戏的ID和每个游戏玩的总小时数？

SQL: SELECT gameid ,  sum(hours_played) FROM Plays_games GROUP BY gameid
问题: 显示所有学生ID和玩的小时数。

SQL: SELECT Stuid ,  sum(hours_played) FROM Plays_games GROUP BY Stuid
问题: 所有学生的ID和玩的小时数是多少？

SQL: SELECT Stuid ,  sum(hours_played) FROM Plays_games GROUP BY Stuid
问题: 显示玩最多小时数的游戏名称。

SQL: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_played) DESC LIMIT 1
问题: 玩的最多的游戏名字是什么？

SQL: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_played) DESC LIMIT 1
问题: 显示所有至少玩1000小时的游戏名称。

SQL: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid GROUP BY T1.gameid HAVING sum(hours_played)  >=  1000
问题: 已经玩了至少玩1000个小时的所有游戏的名字是什么？

SQL: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid GROUP BY T1.gameid HAVING sum(hours_played)  >=  1000
问题: 显示 “张”“晴” 所玩的所有游戏名称

SQL: SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid JOIN Student AS T3 ON T3.Stuid  =  T1.Stuid WHERE T3.Lname  =  "张" AND T3.Fname  =  "晴"
问题: “张”“晴” 玩的所有游戏的名字是什么？

SQL: SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid JOIN Student AS T3 ON T3.Stuid  =  T1.Stuid WHERE T3.Lname  =  "张" AND T3.Fname  =  "晴"
问题: 找出踢“足球”或“曲棍球”的学生的名字和姓氏。

SQL: SELECT T2.lname ,  T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.SportName  =  "足球" OR T1.SportName  =  "曲棍球"
问题: 所有踢“足球”或“曲棍球”的学生的名字和姓氏是什么？

SQL: SELECT T2.lname ,  T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.SportName  =  "足球" OR T1.SportName  =  "曲棍球"
问题: 找出同时踢“足球”和“曲棍球”的学生的名字和年龄。

SQL: SELECT fname ,  age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName  =  "足球" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName  =  "曲棍球")
问题: 所有同时踢“足球”和“曲棍球”的学生的名字和年龄是多少？

SQL: SELECT fname ,  age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName  =  "足球" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName  =  "曲棍球")
问题: 找出同时玩“使命召唤”和“绝地求生”游戏的学生的姓氏和性别。

SQL: SELECT lname ,  sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID  =  T2.GameID WHERE T2.Gname  =  "使命召唤" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID  =  T2.GameID WHERE T2.Gname  =  "绝地求生")
问题: 所有同时演奏“使命召唤”和“绝地求生”的学生的姓氏和性别是什么？

SQL: SELECT lname ,  sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID  =  T2.GameID WHERE T2.Gname  =  "使命召唤" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID  =  T2.GameID WHERE T2.Gname  =  "绝地求生")
问题: 查找所有客户的姓名。

SQL: SELECT customer_name FROM customers
问题: 所有顾客的名字是什么？

SQL: SELECT customer_name FROM customers
问题: 返回不同客户的总数。

SQL: SELECT count(*) FROM customers
问题: 每一个订单所订购的物品的平均数量是多少？

SQL: SELECT avg(order_quantity) FROM order_items
问题: 找出每个订单的平均订单数量。

SQL: SELECT avg(order_quantity) FROM order_items
问题: 使用支付方式为“现金”的客户姓名是什么？

SQL: SELECT customer_name FROM customers WHERE payment_method  =  "现金"
问题: 哪些客户使用“现金”支付方式？返回客户姓名。

SQL: SELECT customer_name FROM customers WHERE payment_method  =  "现金"
问题: 找出ID在10到20之间的客户的成为客户的日期。

SQL: SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20
问题: ID介于10和20之间的客户成为客户的日期是什么时候？

SQL: SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20
问题: 客户使用最多种是什么付款方式？

SQL: SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1
问题: 找出最常用的支付方式。

SQL: SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1
问题: 使用最流行的支付方式的客户姓名是什么？

SQL: SELECT customer_name FROM customers WHERE payment_method  =  (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1)
问题: 查找使用最常用支付方式的客户姓名。

SQL: SELECT customer_name FROM customers WHERE payment_method  =  (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1)
问题: 所有的付款方式是什么？

SQL: SELECT DISTINCT payment_method FROM customers
问题: 返回客户使用的所有不同的付款方式。

SQL: SELECT DISTINCT payment_method FROM customers
问题: 所有产品的细节是什么？

SQL: SELECT DISTINCT product_details FROM products
问题: 返回所有产品的细节。

SQL: SELECT DISTINCT product_details FROM products
问题: 查找所有名为“少奇”的客户的名字。

SQL: SELECT customer_name FROM customers WHERE customer_name LIKE "%少奇%"
问题: 哪个客户的名字包含“少奇”？找出全名。

SQL: SELECT customer_name FROM customers WHERE customer_name LIKE "%少奇%"
问题: 查找详细信息中包含“拿铁”或“美式咖啡”的产品的细节

SQL: SELECT product_details FROM products WHERE product_details LIKE "%拿铁%" OR product_details LIKE "%美式咖啡%"
问题: 哪个产品的细节包含单词“拿铁”或“美式咖啡”？返回完整的细节。

SQL: SELECT product_details FROM products WHERE product_details LIKE "%拿铁%" OR product_details LIKE "%美式咖啡%"
问题: 名为“王俊元”的客户的地址是什么？

SQL: SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id WHERE t1.customer_name  =  "王俊元"
问题: 返回名为“王俊元”的客户的地址内容。

SQL: SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id WHERE t1.customer_name  =  "王俊元"
问题: 住在“西安”的城市有多少顾客？

SQL: SELECT count(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id WHERE t3.city  =  "西安"
问题: 找出居住在这个叫做“西安”的城市的顾客的数量。

SQL: SELECT count(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id WHERE t3.city  =  "西安"
问题: 找出住在“河北”的客户的名字？

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id WHERE t3.state_province_county  =  "河北"
问题: 住在“河北”省的客户的名字是什么？

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id WHERE t3.state_province_county  =  "河北"
问题: 找出没有顾客居住的城市的列表。

SQL: SELECT city FROM addresses WHERE city NOT IN ( SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id)
问题: 没有顾客居住的城市是什么？

SQL: SELECT city FROM addresses WHERE city NOT IN ( SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id)
问题: 哪个城市的顾客最多？

SQL: SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id GROUP BY t3.city ORDER BY count(*) DESC LIMIT 1
问题: 找出最多顾客居住的城市。

SQL: SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id GROUP BY t3.city ORDER BY count(*) DESC LIMIT 1
问题: 检索所有城市的列表。

SQL: SELECT DISTINCT city FROM addresses
问题: 列出所有不同的城市

SQL: SELECT DISTINCT city FROM addresses
问题: 找出邮政编码是255的城市。

SQL: SELECT city FROM addresses WHERE zip_postcode  =  255
问题: 邮政编码是255是哪个城市？

SQL: SELECT city FROM addresses WHERE zip_postcode  =  255
问题: 找出以“4”开头的邮政编码所有城市的省和市。

SQL: SELECT state_province_county ,  country FROM addresses WHERE zip_postcode LIKE "%4%"
问题: 所有以“4”开头的邮政编码城市的省和市是什么？

SQL: SELECT state_province_county ,  country FROM addresses WHERE zip_postcode LIKE "%4%"
问题: 列出有超过4个地址的国家名单。

SQL: SELECT country FROM addresses GROUP BY country HAVING count(address_id)  >  4
问题: 哪些国家有列出超过四个不同的地址？

SQL: SELECT country FROM addresses GROUP BY country HAVING count(address_id)  >  4
问题: 列出所有少于5次使用的联系人信道代码。

SQL: SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING count(customer_id)  <  5
问题: 哪些联系信道代码使用少于5次？

SQL: SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING count(customer_id)  <  5
问题: 哪个联系渠道已经被叫“杨超越”所使用？

SQL: SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.customer_name  =  "杨超越"
问题: 找出名为“杨超越”的客户使用的联系渠道代码。

SQL: SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.customer_name  =  "杨超越"
问题: “杨超越”使用的最新联系人频道的激活日期是什么？

SQL: SELECT max(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.customer_name  =  "杨超越"
问题: 返回由名为“杨超越”的客户使用的最新联系渠道的激活日期。

SQL: SELECT max(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.customer_name  =  "杨超越"
问题: 数据库中联系通道的平均时间跨度是多少？

SQL: SELECT avg(active_to_date - active_from_date) FROM customer_contact_channels
问题: 计算联系通道的平均有效时间跨度。

SQL: SELECT avg(active_to_date - active_from_date) FROM customer_contact_channels
问题: 最长时间处于活动状态的客户联系渠道的信道代码和联系号码是什么？

SQL: SELECT channel_code ,  contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date  =  (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)
问题: 返回活动持续时间最长的客户联系渠道的信道代码和联系号码。

SQL: SELECT channel_code ,  contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date  =  (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)
问题: 找出使用电子邮件作为联系渠道的客户的姓名和活动日期。

SQL: SELECT t1.customer_name ,  t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id  =  t2.customer_id WHERE t2.channel_code  =  "Email"
问题: 联系渠道代码是电子邮件的客户的姓名和活动日期是什么？

SQL: SELECT t1.customer_name ,  t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id  =  t2.customer_id WHERE t2.channel_code  =  "Email"
问题: 订单数量最多的客户叫什么名字？

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id WHERE t3.order_quantity  =  ( SELECT max(order_quantity) FROM order_items)
问题: 找出订单最大订货量的客户。

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id WHERE t3.order_quantity  =  ( SELECT max(order_quantity) FROM order_items)
问题: 购买了最多商品的顾客的名字是什么？

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) DESC LIMIT 1
问题: 给我订购了最多的物品总数的客户的名字。

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) DESC LIMIT 1
问题: 购买数量最少的物品的顾客的付款方式是什么？

SQL: SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) LIMIT 1
问题: 请告诉我订货量最少的客户所使用的付款方式。

SQL: SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) LIMIT 1
问题: “路一鸣”总共买了多少种产品？

SQL: SELECT count(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id WHERE t1.customer_name  =  "路一鸣"
问题: 找出迄今为止“路一鸣”购买的不同产品的数量。

SQL: SELECT count(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id WHERE t1.customer_name  =  "路一鸣"
问题: “路一鸣”购买的产品总量是多少？

SQL: SELECT sum(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id WHERE t1.customer_name  =  "路一鸣"
问题: 请告诉我顾客“路一鸣”购买的产品的总数量。

SQL: SELECT sum(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id JOIN order_items AS t3 ON t2.order_id  =  t3.order_id WHERE t1.customer_name  =  "路一鸣"
问题: 有多少客户至少有一个订单状态是“取消”？

SQL: SELECT count(DISTINCT customer_id) FROM customer_orders WHERE order_status  =  "取消"
问题: 返回具有至少一个“取消”状态的订单的客户数量。

SQL: SELECT count(DISTINCT customer_id) FROM customer_orders WHERE order_status  =  "取消"
问题: 多少订单有“第二次”的细节？

SQL: SELECT count(*) FROM customer_orders WHERE order_details  =  "第二次"