jtjt520j/CSpider_for_Qwen huggingface dataset:
问题: 显示每个比赛的名称和日期及其赛道名称。

SQL: SELECT T1.name ,  T1.date ,  T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id
问题: 比赛的名称和日期，以及举行比赛的赛道的名称？

SQL: SELECT T1.name ,  T1.date ,  T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id
问题: 显示有1个比赛的赛道的名称和位置。

SQL: SELECT T2.name ,  T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id HAVING count(*)  =  1
问题: 有1个比赛的赛道的名称和位置是什么？

SQL: SELECT T2.name ,  T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id HAVING count(*)  =  1
问题: 找到有超过90000个座位的赛道和少于70000个座位的赛道的位置。

SQL: SELECT LOCATION FROM track WHERE seating  >  90000 INTERSECT SELECT LOCATION FROM track WHERE seating  <  70000
问题: 哪些地方有超过90000个座位的赛道和少于70000个座位的赛道？

SQL: SELECT LOCATION FROM track WHERE seating  >  90000 INTERSECT SELECT LOCATION FROM track WHERE seating  <  70000
问题: 有多少会员有黑会员卡？

SQL: SELECT count(*) FROM member WHERE Membership_card  =  '黑卡'
问题: 找到每个住址的会员的数量。

SQL: SELECT count(*) ,  address FROM member GROUP BY address
问题: 请告诉我地址在“金华”或“湖州”的会员的名字。

SQL: SELECT name FROM member WHERE address  =  '金华' OR address  =  '湖州'
问题: 查找30岁以下或持有黑会员卡的会员的ID和姓名。

SQL: SELECT name ,  member_id FROM member WHERE Membership_card  =  '黑卡' OR age  <  30
问题: 查找每个会员的购买时间、年龄和地址，并按照购买时间的顺序显示结果。

SQL: SELECT Time_of_purchase ,  age ,  address FROM member ORDER BY Time_of_purchase
问题: 哪一张会员卡有超过5名会员？

SQL: SELECT Membership_card FROM member GROUP BY Membership_card HAVING count(*)  >  5
问题: 哪个地址既有会员年龄小于30岁，又有会员超过40岁？

SQL: SELECT address FROM member WHERE age  <  30 INTERSECT SELECT address FROM member WHERE age  >  40
问题: 住在“金华”的会员和住在“湖州”的会员都持有的卡都有哪些？

SQL: SELECT membership_card FROM member WHERE address  =  '金华' INTERSECT SELECT membership_card FROM member WHERE address  =  '湖州'
问题: 有多少会员不住在“金华”？

SQL: SELECT count(*) FROM member WHERE address != '金华'
问题: 哪个地址没有黑色会员卡的会员？

SQL: SELECT address FROM member EXCEPT SELECT address FROM member WHERE Membership_card  =  '黑卡'
问题: 按照开业时间排列显示商店地址。

SQL: SELECT address FROM shop ORDER BY open_year
问题: 所有商店的平均分和平均员工数是多少？

SQL: SELECT avg(num_of_staff) ,  avg(score) FROM shop
问题: 找出得分低于平均分的商店的ID和地址。

SQL: SELECT shop_id ,  address FROM shop WHERE score  <  (SELECT avg(score) FROM shop)
问题: 找到没有快乐时间的商店的地址和员工数量。

SQL: SELECT address ,  num_of_staff FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM happy_hour)
问题: 五月份有一个欢乐时间的商店的ID和地址是什么？

SQL: SELECT t1.address ,  t1.shop_id FROM shop AS t1 JOIN happy_hour AS t2 ON t1.shop_id  =  t2.shop_id WHERE MONTH  =  '五月'
问题: 哪个商店的开心时间最多？列出它的ID和快乐时间的数量。

SQL: SELECT shop_id ,  count(*) FROM happy_hour GROUP BY shop_id ORDER BY count(*) DESC LIMIT 1
问题: 哪一个月有最多的快乐时间？

SQL: SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY count(*) DESC LIMIT 1
问题: 哪几个月有超过2个快乐时间？

SQL: SELECT MONTH FROM happy_hour GROUP BY MONTH HAVING count(*)  >  2
问题: 有多少张专辑？

SQL: SELECT count(*) FROM ALBUM
问题: 找到专辑的数量。

SQL: SELECT count(*) FROM ALBUM
问题: 列出所有音乐流派的名称。

SQL: SELECT Name FROM GENRE
问题: 不同音乐流派的名字是什么？

SQL: SELECT Name FROM GENRE
问题: 查找“广东”州所有客户信息。

SQL: SELECT * FROM CUSTOMER WHERE State  =  "广东"
问题: “广东”州客户的所有客户信息是什么？

SQL: SELECT * FROM CUSTOMER WHERE State  =  "广东"
问题: 住在“青岛”市的员工的名字和姓是什么？

SQL: SELECT FirstName ,  LastName FROM EMPLOYEE WHERE City  =  "青岛"
问题: 查找居住在“青岛”市的雇员的全名。

SQL: SELECT FirstName ,  LastName FROM EMPLOYEE WHERE City  =  "青岛"
问题: 不同发票的收费国家有哪些？

SQL: SELECT distinct(BillingCountry) FROM INVOICE
问题: 查找所有发票不同的收费国家。

SQL: SELECT distinct(BillingCountry) FROM INVOICE
问题: 找出所有名字中有“a”的艺术家的名字。

SQL: SELECT Name FROM ARTIST WHERE Name LIKE "安"
问题: 名字中有字母“a”的艺术家有哪些？

SQL: SELECT Name FROM ARTIST WHERE Name LIKE "安"
问题: 找到“吴亦凡”艺术家的所有专辑的标题。

SQL: SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "吴亦凡"
问题: “吴亦凡”艺术家的专辑的标题是什么？

SQL: SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "吴亦凡"
问题: “陈奕迅”艺术家有多少张专辑？

SQL: SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "陈奕迅"
问题: 找到“陈奕迅”艺术家的专辑数量。

SQL: SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "陈奕迅"
问题: “奇幻旅程”专辑是哪一位艺术家？

SQL: SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T1.Title  =  "奇幻旅程"
问题: 找到制作“奇幻旅程”专辑艺术家的名字。

SQL: SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T1.Title  =  "奇幻旅程"
问题: 哪位艺术家的专辑最多？

SQL: SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1
问题: 专辑数量最多的艺人叫什么名字？

SQL: SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1
问题: 找出包含“你”这个词的所有曲目的名字。

SQL: SELECT Name FROM TRACK WHERE Name LIKE '你'
问题: 包含了“你”这个词的曲目的名字是什么？

SQL: SELECT Name FROM TRACK WHERE Name LIKE '你'
问题: 所有歌曲的平均单价是多少？

SQL: SELECT AVG(UnitPrice) FROM TRACK
问题: 找到歌曲的平均单价。

SQL: SELECT AVG(UnitPrice) FROM TRACK
问题: 最长和最短的歌曲的持续时间是多少毫秒？

SQL: SELECT max(Milliseconds) ,  min(Milliseconds) FROM TRACK
问题: 找到毫秒下歌曲的最大和最小持续时间。

SQL: SELECT max(Milliseconds) ,  min(Milliseconds) FROM TRACK
问题: 显示专辑名称、ID和每张专辑的曲目数量。

SQL: SELECT T1.Title ,  T2.AlbumID ,  COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId  =  T2.AlbumId GROUP BY T2.AlbumID
问题: 不同专辑的名称和ID是什么？每个专辑有多少首曲目？

SQL: SELECT T1.Title ,  T2.AlbumID ,  COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId  =  T2.AlbumId GROUP BY T2.AlbumID
问题: 所有曲目中最常见的类型是什么？

SQL: SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1
问题: 找出所有曲目中最常见的类型的名称。

SQL: SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1
问题: 在所有歌曲中最常见的媒体类型是什么？

SQL: SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId  =  T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1
问题: 在所有音乐中，什么类型的媒体类型是最不常见的？

SQL: SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId  =  T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1
问题: 显示包含单价大于1的曲目的专辑的名称和ID。

SQL: SELECT T1.Title ,  T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId  =  T2.AlbumId WHERE T2.UnitPrice  >  1 GROUP BY T2.AlbumID
问题: 包含单价大于1的歌曲的专辑的标题和ID是什么？

SQL: SELECT T1.Title ,  T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId  =  T2.AlbumId WHERE T2.UnitPrice  >  1 GROUP BY T2.AlbumID
问题: 摇滚流派有多少曲目？

SQL: SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "摇滚"
问题: 计算摇滚类型的歌曲的数量。

SQL: SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "摇滚"
问题: 属于爵士乐风格的曲目的平均单价是多少？

SQL: SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "爵士"
问题: 找到爵士乐曲目的平均单价。

SQL: SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "爵士"
问题: 电子邮件为“luisg@embraer.com.br”的客户的名字和姓是什么？

SQL: SELECT FirstName ,  LastName FROM CUSTOMER WHERE Email  =  "luisg@embraer.com.br"
问题: 查找电子邮件“luisg@embraer.com.br”的客户的全名。

SQL: SELECT FirstName ,  LastName FROM CUSTOMER WHERE Email  =  "luisg@embraer.com.br"
问题: 有多少客户有电子邮件包含"gmail.com"？

SQL: SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE "qq.com"
问题: 计算包含"gmail.com"的电子邮件的客户数量。

SQL: SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE "qq.com"
问题: 帮助过名为“小红”的客户的员工的名字和姓氏是什么？

SQL: SELECT T2.FirstName ,  T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId WHERE T1.FirstName  =  "小红"
问题: 查找帮助客户“小红”的员工的全名。

SQL: SELECT T2.FirstName ,  T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId WHERE T1.FirstName  =  "小红"
问题: 帮助住在邮政编码为“70174”的客户的员工住在哪个城市？

SQL: SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId WHERE T1.PostalCode  =  "70174"
问题: 找到帮助使用邮政编码“70174”的客户的雇员相对应的城市。

SQL: SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId WHERE T1.PostalCode  =  "70174"
问题: 员工住多少个不同的城市？

SQL: SELECT COUNT(DISTINCT city) FROM EMPLOYEE
问题: 找到员工居住的不同城市的数量。

SQL: SELECT COUNT(DISTINCT city) FROM EMPLOYEE
问题: 查找与名为“卢”姓为“军”的客户相对应的所有发票日期。

SQL: SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.FirstName  =  "卢" AND LastName  =  "军"
问题: 名是“卢”姓是“军”的客户的发票日期是什么？

SQL: SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.FirstName  =  "卢" AND LastName  =  "军"
问题: 查找所有发票总额没有大于20的客户姓氏。

SQL: SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T2.total  >  20
问题: 发票总额不超过20的客户的姓氏是什么？

SQL: SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T2.total  >  20
问题: 查找居住在“巴西”的有发票的所有客户的名字。

SQL: SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "巴西"
问题: 对于来自“巴西”有发票的顾客，他们有什么不同的名字？

SQL: SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "巴西"
问题: 查找所有居住在“德国”有发票的客户的地址。

SQL: SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "德国"
问题: 在“德国”居住的有发票的客户地址是什么？

SQL: SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "德国"
问题: 列出所有员工的电话号码。

SQL: SELECT Phone FROM EMPLOYEE
问题: 每个员工的电话号码是什么？

SQL: SELECT Phone FROM EMPLOYEE
问题: 有多少歌是“AAC”媒体类型？

SQL: SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId  =  T2.MediaTypeId WHERE T1.Name  =  "AAC"
问题: 计算媒体类型为“AAC”的歌曲数。

SQL: SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId  =  T2.MediaTypeId WHERE T1.Name  =  "AAC"
问题: 属于“拉丁”和“流行”音乐的曲目平均持续时间是几毫秒？

SQL: SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "拉丁" OR T1.Name  =  "流行"
问题: 找到“拉丁”和“流行”歌曲的平均毫秒长度。

SQL: SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "拉丁" OR T1.Name  =  "流行"
问题: 请出示为至少10位客户服务的员工姓名和ID。

SQL: SELECT T1.FirstName ,  T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*)  >=  10
问题: 为10个或更多客户服务的员工的名字和支持代表ID的是什么？

SQL: SELECT T1.FirstName ,  T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*)  >=  10
问题: 请显示为不超过20名顾客服务的雇员的姓氏。

SQL: SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*)  <=  20
问题: 服务最多20名顾客的员工的姓氏是什么？

SQL: SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*)  <=  20
问题: 请按字母顺序列出所有唱片的标题。

SQL: SELECT Title FROM ALBUM ORDER BY Title
问题: 所有的专辑标题是什么，按字母顺序排列？

SQL: SELECT Title FROM ALBUM ORDER BY Title
问题: 请按字母顺序列出至少有3张专辑的所有艺术家的姓名和ID。

SQL: SELECT T2.Name ,  T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*)  >=  3 ORDER BY T2.Name
问题: 按字母顺序排列，有3张或更多张专辑的艺术家的名字和ID是什么？

SQL: SELECT T2.Name ,  T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*)  >=  3 ORDER BY T2.Name
问题: 找到没有任何专辑的艺术家的名字。

SQL: SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId
问题: 没有发行任何专辑的艺术家的名字是什么？

SQL: SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId
问题: 摇滚歌曲的平均单价是多少？

SQL: SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "摇滚"
问题: 找出摇滚流派的歌曲的平均单价。

SQL: SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "摇滚"
问题: 最长和最短的流行歌曲的持续时间是多少毫秒？

SQL: SELECT max(Milliseconds) ,  min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "流行"
问题: 找出流行音乐的最大和最小毫秒长度。

SQL: SELECT max(Milliseconds) ,  min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "流行"
问题: 住在“长沙”市的员工的出生日期是多少？

SQL: SELECT BirthDate FROM EMPLOYEE WHERE City  =  "长沙"
问题: 查找在“长沙”市居住的雇员的出生日期。

SQL: SELECT BirthDate FROM EMPLOYEE WHERE City  =  "长沙"
问题: 所有歌曲的不同单价是多少？

SQL: SELECT distinct(UnitPrice) FROM TRACK
问题: 找到歌曲的不同单价。

SQL: SELECT distinct(UnitPrice) FROM TRACK
问题: 有多少艺术家没有专辑？

SQL: SELECT count(*) FROM ARTIST WHERE artistid NOT IN(SELECT artistid FROM ALBUM)
问题: 数出没有发行专辑的艺术家的数量。

SQL: SELECT count(*) FROM ARTIST WHERE artistid NOT IN(SELECT artistid FROM ALBUM)
问题: 包含“雷鬼”和“摇滚”流派曲目的专辑的名称是什么？

SQL: SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId  =  T2.AlbumId JOIN Genre AS T3 ON T2.GenreID  =  T3.GenreID WHERE T3.Name  =  '雷鬼' INTERSECT SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId  =  T2.AlbumId JOIN Genre AS T3 ON T2.GenreID  =  T3.GenreID WHERE T3.Name  =  '摇滚'
问题: 查找包含“雷鬼”和“摇滚”音乐曲目的专辑标题。

SQL: SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId  =  T2.AlbumId JOIN Genre AS T3 ON T2.GenreID  =  T3.GenreID WHERE T3.Name  =  '雷鬼' INTERSECT SELECT T1.Title FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId  =  T2.AlbumId JOIN Genre AS T3 ON T2.GenreID  =  T3.GenreID WHERE T3.Name  =  '摇滚'
问题: 找到所有的电话号码。

SQL: SELECT customer_phone FROM available_policies
问题: 所有电话号码是多少？

SQL: SELECT customer_phone FROM available_policies
问题: “人寿保险”保险单下的客户电话号码是多少？

SQL: SELECT customer_phone FROM available_policies WHERE policy_type_code  =  "人寿保险"
问题: 使用代号为“人寿保险”的保险单的客户的电话号码是多少？

SQL: SELECT customer_phone FROM available_policies WHERE policy_type_code  =  "人寿保险"
问题: 哪种保险单类型在数据库中的记录最多？

SQL: SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1
问题: 哪些保险单类型在保险单中出现最多？

SQL: SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1
问题: 最流行的保险单类型的所有的客户电话号码是什么？

SQL: SELECT customer_phone FROM available_policies WHERE policy_type_code  =  (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1)
问题: 查找使用可用保险单中最常见保险单类型的客户的电话号码。

SQL: SELECT customer_phone FROM available_policies WHERE policy_type_code  =  (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1)
问题: 查找超过4个客户使用的保险单类型。

SQL: SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*)  >  4
问题: 查找超过4个客户使用的保险单类型。显示他们的类型代码。

SQL: SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*)  >  4
问题: 找到总计和平均结算金额。

SQL: SELECT sum(settlement_amount) ,  avg(settlement_amount) FROM settlements
问题: 返回所有结算金额的总和和平均数。

SQL: SELECT sum(settlement_amount) ,  avg(settlement_amount) FROM settlements
问题: 查找在首次丢失通知中已经使用了2次以上的服务的名称。

SQL: SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id  =  t2.service_id GROUP BY t1.service_id HAVING count(*)  >  2
问题: 在首次丢失通知中，哪些服务已经使用了两次以上？返回服务名称。

SQL: SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id  =  t2.service_id GROUP BY t1.service_id HAVING count(*)  >  2
问题: 总结算金额最大的索赔的有效日期是哪一天？

SQL: SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id  =  t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) DESC LIMIT 1
问题: 找到总结算金额最大的索赔。返回索赔的生效日期。

SQL: SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id  =  t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) DESC LIMIT 1
问题: 有多少名为“李帅”的保险单被列出？

SQL: SELECT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.customer_name  =  "李帅"
问题: 对名为“李帅”的客户使用的保险单总数进行计数。

SQL: SELECT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.customer_name  =  "李帅"
问题: 列出最多保险单的客户名称是什么？

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1
问题: 哪个客户使用最多的保险单？给我客户的名字。

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1
问题: 名为“李帅”的客户的所有保险单类型是什么？

SQL: SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id JOIN available_policies AS t3 ON t2.policy_id  =  t3.policy_id WHERE t1.customer_name  =  "李帅"
问题: 请告诉我“李帅”客户使用的保险单的类型。

SQL: SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id JOIN available_policies AS t3 ON t2.policy_id  =  t3.policy_id WHERE t1.customer_name  =  "李帅"
问题: 被列出的保险单最多的客户的保险单类型有哪些？

SQL: SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id JOIN available_policies AS t3 ON t2.policy_id  =  t3.policy_id WHERE t1.customer_name  =  (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1)
问题: 列出保险单中登记次数最多的客户的所有保险单类型。

SQL: SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id JOIN available_policies AS t3 ON t2.policy_id  =  t3.policy_id WHERE t1.customer_name  =  (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1)
问题: 按字母顺序，列出所有的服务。

SQL: SELECT service_name FROM services ORDER BY service_name
问题: 给我一个按字母顺序排序的所有服务名称的列表。

SQL: SELECT service_name FROM services ORDER BY service_name
问题: 有多少服务？

SQL: SELECT count(*) FROM services
问题: 计算可用服务的总数。

SQL: SELECT count(*) FROM services
问题: 查找没有首次丢失通知记录的用户的姓名。

SQL: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id  =  t2.customer_id
问题: 哪些客户没有第一份丢失记录通知？给我客户的名字。

SQL: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id  =  t2.customer_id
问题: 查找已经使用服务“取消保单”或服务“升级保单”的客户的名称。

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id  =  t2.customer_id JOIN services AS t3 ON t2.service_id  =  t3.service_id WHERE t3.service_name  =  "取消保单" OR t3.service_name  =  "升级保单"
问题: 哪些客户使用了名为“取消保单”或“升级保单”的服务？给我客户的名字。

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id  =  t2.customer_id JOIN services AS t3 ON t2.service_id  =  t3.service_id WHERE t3.service_name  =  "取消保单" OR t3.service_name  =  "升级保单"
问题: 查找同时使用服务“取消保单”和服务“新开保单”的客户的名称。

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id  =  t2.customer_id JOIN services AS t3 ON t2.service_id  =  t3.service_id WHERE t3.service_name  =  "取消保单" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id  =  t2.customer_id JOIN services AS t3 ON t2.service_id  =  t3.service_id WHERE t3.service_name  =  "新开保单"
问题: 哪些客户使用了名为“取消保单”的服务和"新开保单"的服务？给我客户的名字。

SQL: SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id  =  t2.customer_id JOIN services AS t3 ON t2.service_id  =  t3.service_id WHERE t3.service_name  =  "取消保单" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id  =  t2.customer_id JOIN services AS t3 ON t2.service_id  =  t3.service_id WHERE t3.service_name  =  "新开保单"
问题: 查找名字包含“楠”的客户ID。

SQL: SELECT customer_id FROM customers WHERE customer_name LIKE "楠"
问题: 名字中有“楠”的客户的ID是什么？

SQL: SELECT customer_id FROM customers WHERE customer_name LIKE "楠"
问题: 记录的最大和最低结算金额是多少？

SQL: SELECT max(settlement_amount) ,  min(settlement_amount) FROM settlements
问题: 求最大结算金额和最小结算金额。

SQL: SELECT max(settlement_amount) ,  min(settlement_amount) FROM settlements
问题: 以ID的增加顺序列出所有客户。

SQL: SELECT customer_id ,  customer_name FROM customers ORDER BY customer_id ASC
问题: 客户ID的有序列表是什么？

SQL: SELECT customer_id ,  customer_name FROM customers ORDER BY customer_id ASC
问题: 检索名字包含“楠”的客户相关联的所有保险单的开始和结束日期

SQL: SELECT t2.date_opened ,  t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.customer_name LIKE "楠"
问题: 那些名字中有“楠”的客户使用的所有保险单的开始和结束日期是什么？

SQL: SELECT t2.date_opened ,  t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.customer_name LIKE "楠"
问题: 有多少种酶？

SQL: SELECT count(*) FROM enzyme
问题: 酶的总数是多少？

SQL: SELECT count(*) FROM enzyme
问题: 以字母降序顺序列出酶的名称。

SQL: SELECT name FROM enzyme ORDER BY name DESC
问题: 酶的名称有哪些，按降序排列？

SQL: SELECT name FROM enzyme ORDER BY name DESC
问题: 列出能起作用的酶的名称和位置。

SQL: SELECT name ,  LOCATION FROM enzyme
问题: 列出的所有酶的名称和位置是什么？

SQL: SELECT name ,  LOCATION FROM enzyme
问题: 人类在线孟德尔遗传酶（OMIM）的最大值是多少？

SQL: SELECT max(OMIM) FROM enzyme
问题: 数据库中最大的OMIM值是多少？

SQL: SELECT max(OMIM) FROM enzyme
问题: 在“贵阳”位置起作用的酶有关的产物、染色体和卟啉是什么？

SQL: SELECT product ,  chromosome ,  porphyria FROM enzyme WHERE LOCATION  =  '贵阳'
问题: 位于“贵阳”的酶的产物、染色体和卟啉是什么？

SQL: SELECT product ,  chromosome ,  porphyria FROM enzyme WHERE LOCATION  =  '贵阳'
问题: 不产生“淀粉酶”的酶的名称是什么？

SQL: SELECT name FROM enzyme WHERE product != '淀粉酶'
问题: 产物不是“淀粉酶”的酶的名称是什么？

SQL: SELECT name FROM enzyme WHERE product != '淀粉酶'
问题: 在FDA记录中有“是”的药物的名称和商标名称是什么？

SQL: SELECT name ,  trade_name FROM medicine WHERE FDA_approved  =  '是'
问题: FDA批准的药品名称和商标名称是什么？

SQL: SELECT name ,  trade_name FROM medicine WHERE FDA_approved  =  '是'
问题: 有一种名为“氨磺必利”的能起到“抑制剂”的作用的药物，其中酶的名称是什么？

SQL: SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id  =  T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id  =  T3.id WHERE T3.name  =  '氨磺必利' AND T2.interaction_type  =  '抑制剂'
问题: 用作“抑制剂”的药物“氨磺必利”所利用的酶的名称是什么?

SQL: SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id  =  T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id  =  T3.id WHERE T3.name  =  '氨磺必利' AND T2.interaction_type  =  '抑制剂'
问题: 可以与两种或更多种酶相互作用的药物的ID和名称是什么？

SQL: SELECT T1.id ,  T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
问题: 对于每个药物ID，可以与一种以上酶相互作用的药物的名称是什么？

SQL: SELECT T1.id ,  T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
问题: 按照与它们相互作用的酶数量的降序排列，药品的ID、名称和FDA批准状况的是什么？

SQL: SELECT T1.id ,  T1.Name ,  T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id ORDER BY count(*) DESC
问题: 按酶相互作用数量递减的顺序，药物的ID、名称和FDA批准状态是什么？

SQL: SELECT T1.id ,  T1.Name ,  T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id GROUP BY T1.id ORDER BY count(*) DESC
问题: 那种可以与最多的药物进行“催化剂”相互作用的酶的ID和名称是什么？

SQL: SELECT T1.id ,  T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id  =  T2.enzyme_id WHERE T2.interaction_type  =  '催化剂' GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
问题: 能作为“催化剂”与最多的药物相互作用的酶的ID和名称是什么？

SQL: SELECT T1.id ,  T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id  =  T2.enzyme_id WHERE T2.interaction_type  =  '催化剂' GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
问题: “ALA合酶”和药物“阿立哌唑”的相互作用类型是什么？

SQL: SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id  =  T2.id JOIN enzyme AS T3 ON T1.enzyme_id  =  T3.id WHERE T3.name  =  'ALA合酶' AND T2.name  =  '阿立哌唑'