jtjt520j/CSpider_for_Qwen huggingface dataset:
问题: 查找最近创建的文档中索赔的总金额。

SQL: SELECT sum(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id  =  t2.claim_id WHERE t2.created_date  =  (SELECT created_date FROM claims_documents ORDER BY created_date LIMIT 1)
问题: 在最近创建的文档中总共有多少索赔？

SQL: SELECT sum(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id  =  t2.claim_id WHERE t2.created_date  =  (SELECT created_date FROM claims_documents ORDER BY created_date LIMIT 1)
问题: 在一次索赔中索赔额最大的客户叫什么名字？

SQL: SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id  =  t2.policy_id JOIN customers AS t3 ON t2.customer_id  =  t3.customer_id WHERE t1.amount_claimed  =  (SELECT max(amount_claimed) FROM claim_headers)
问题: 哪一个客户在单一索赔中提出的索赔数额最大？返回客户详细信息。

SQL: SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id  =  t2.policy_id JOIN customers AS t3 ON t2.customer_id  =  t3.customer_id WHERE t1.amount_claimed  =  (SELECT max(amount_claimed) FROM claim_headers)
问题: 在一次索赔中支付最低金额的客户叫什么名字？

SQL: SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id  =  t2.policy_id JOIN customers AS t3 ON t2.customer_id  =  t3.customer_id WHERE t1.amount_piad  =  (SELECT min(amount_piad) FROM claim_headers)
问题: 哪一个客户在一个索赔中做出了最小的索赔额？返回客户详细信息。

SQL: SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id  =  t2.policy_id JOIN customers AS t3 ON t2.customer_id  =  t3.customer_id WHERE t1.amount_piad  =  (SELECT min(amount_piad) FROM claim_headers)
问题: 查找没有相关保险单的客户名称。

SQL: SELECT customer_details FROM customers EXCEPT SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id
问题: 没有任何保险单的客户的名字是什么？

SQL: SELECT customer_details FROM customers EXCEPT SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id
问题: 总共有多少个索赔处理阶段？

SQL: SELECT count(*) FROM claims_processing_stages
问题: 查找索赔处理中不同阶段的数量。

SQL: SELECT count(*) FROM claims_processing_stages
问题: 索赔处理阶段的索赔最多的名称是什么？

SQL: SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id  =  t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY count(*) DESC LIMIT 1
问题: 哪个索赔处理阶段索赔最多？显示索赔状态名称。

SQL: SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id  =  t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY count(*) DESC LIMIT 1
问题: 查找名字包含“楠”的客户的名字。

SQL: SELECT customer_details FROM customers WHERE customer_details LIKE "楠"
问题: 哪些客户有包含“楠”的名字？返回客户详细信息。

SQL: SELECT customer_details FROM customers WHERE customer_details LIKE "楠"
问题: 找出有“代理”保险单的客户的名字。

SQL: SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.policy_type_code  =  "代理"
问题: 哪些客户拥有保险代号为“代理”的保险单？给我客户的详细资料。

SQL: SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.policy_type_code  =  "代理"
问题: 查找具有“代理”保险单“统一”保险单的客户的名字。

SQL: SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.policy_type_code  =  "代理" OR t1.policy_type_code  =  "统一"
问题: 哪些客户有类型代号为“代理”或“统一”的保险单？返回客户详细信息。

SQL: SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.policy_type_code  =  "代理" OR t1.policy_type_code  =  "统一"
问题: 查找所有客户和员工的姓名。

SQL: SELECT customer_details FROM customers UNION SELECT staff_details FROM staff
问题: 顾客和员工的名字是什么？

SQL: SELECT customer_details FROM customers UNION SELECT staff_details FROM staff
问题: 查找每个保险单类型及其类型代码的记录数。

SQL: SELECT policy_type_code ,  count(*) FROM policies GROUP BY policy_type_code
问题: 对于每个保险单类型，在记录中返回其类型代码及其数量。

SQL: SELECT policy_type_code ,  count(*) FROM policies GROUP BY policy_type_code
问题: 查找保险单中涉及最多的客户的名称。

SQL: SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1
问题: 哪个客户有最多的保险单？给我客户的详细资料。

SQL: SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1
问题: “开放”索赔状态的描述是什么？

SQL: SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name  =  "开放"
问题: 找到为“开放”的索赔状态描述。

SQL: SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name  =  "开放"
问题: 有多少种不同的索赔结果代码？

SQL: SELECT count(DISTINCT claim_outcome_code) FROM claims_processing
问题: 计算不同的索赔结果代码的数量。

SQL: SELECT count(DISTINCT claim_outcome_code) FROM claims_processing
问题: 哪个客户与最新的保险单相关联？

SQL: SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.start_date  =  (SELECT max(start_date) FROM policies)
问题: 找到最近开始的保险单的客户。

SQL: SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.start_date  =  (SELECT max(start_date) FROM policies)
问题: 显示帐号数量。

SQL: SELECT count(*) FROM Accounts
问题: 有多少个帐户？

SQL: SELECT count(*) FROM Accounts
问题: 有多少客户开户？

SQL: SELECT count(DISTINCT customer_id) FROM Accounts
问题: 计算有账户的客户数。

SQL: SELECT count(DISTINCT customer_id) FROM Accounts
问题: 显示所有帐户的ID、开户日期、帐户名称和其他帐户详细信息。

SQL: SELECT account_id ,  date_account_opened ,  account_name ,  other_account_details FROM Accounts
问题: 所有帐户的ID，开户日期，名称，以及其他细节是什么？

SQL: SELECT account_id ,  date_account_opened ,  account_name ,  other_account_details FROM Accounts
问题: 显示名字为“余”的客户的所有帐户的ID、帐户名称和其他帐户详细信息。

SQL: SELECT T1.account_id ,  T1.date_account_opened ,  T1.account_name ,  T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  '余'
问题: 与名为“余”的客户对应的帐户的ID、名称、开户日期和其他细节是什么？

SQL: SELECT T1.account_id ,  T1.date_account_opened ,  T1.account_name ,  T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  '余'
问题: 显示所有名为“菲菲”姓氏为“余”的客户的帐户名称和帐户其他详细资料。

SQL: SELECT T1.account_name ,  T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "余" AND T2.customer_last_name  =  "菲菲"
问题: 与名为“余” “菲菲”的客户对应的帐户的名称和其他细节是什么？

SQL: SELECT T1.account_name ,  T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "余" AND T2.customer_last_name  =  "菲菲"
问题: 显示用帐户名“900”的客户的名字和姓氏。

SQL: SELECT T2.customer_first_name ,  T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.account_name  =  "900"
问题: 账户名称“900”的客户全名是什么？

SQL: SELECT T2.customer_first_name ,  T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.account_name  =  "900"
问题: 计算没有账户的客户数。

SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)
问题: 显示具有帐户的所有客户的名字、姓氏和电话号码。

SQL: SELECT DISTINCT T1.customer_first_name ,  T1.customer_last_name ,  T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
问题: 对于有账户的客户，有哪些不同的名字、姓氏和电话号码？

SQL: SELECT DISTINCT T1.customer_first_name ,  T1.customer_last_name ,  T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
问题: 显示没有账户的客户ID。

SQL: SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts
问题: 没有账户的客户有哪些客户ID？

SQL: SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts
问题: 每个客户有多少个帐户？列出号码和客户ID。

SQL: SELECT count(*) ,  customer_id FROM Accounts GROUP BY customer_id
问题: 计算对应于每个客户ID的帐户数。

SQL: SELECT count(*) ,  customer_id FROM Accounts GROUP BY customer_id
问题: 有最多账户的客户ID，名字和姓氏的是什么。

SQL: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
问题: 返回帐号最多的客户的ID和全名。

SQL: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
问题: 显示所有客户的ID、姓名和姓氏以及帐户数量。

SQL: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name ,  count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id
问题: 所有客户的全名和ID是什么？每个客户有多少个账户？

SQL: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name ,  count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id
问题: 显示至少2个帐户的所有客户的名字和ID。

SQL: SELECT T2.customer_first_name ,  T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2
问题: 有两个或两个以上账户的客户的名字和ID是什么？

SQL: SELECT T2.customer_first_name ,  T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2
问题: 显示客户数量。

SQL: SELECT count(*) FROM Customers
问题: 显示每个性别的顾客数量。

SQL: SELECT gender ,  count(*) FROM Customers GROUP BY gender
问题: 每个性别有多少顾客？

SQL: SELECT gender ,  count(*) FROM Customers GROUP BY gender
问题: 我们有多少交易？

SQL: SELECT count(*) FROM Financial_transactions
问题: 统计交易数量。

SQL: SELECT count(*) FROM Financial_transactions
问题: 每个账户有多少交易？显示号码和账号ID。

SQL: SELECT count(*) ,  account_id FROM Financial_transactions
问题: 计算对应于每个帐户ID的金融交易数量。

SQL: SELECT count(*) ,  account_id FROM Financial_transactions
问题: “337”号账户有多少交易？

SQL: SELECT count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id WHERE T2.account_name  =  "337"
问题: 计算名称为“337”的帐户拥有的金融交易的数量。

SQL: SELECT count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id WHERE T2.account_name  =  "337"
问题: 平均值、最小值、最大值和总交易量是多少？

SQL: SELECT avg(transaction_amount) ,  min(transaction_amount) ,  max(transaction_amount) ,   sum(transaction_amount) FROM Financial_transactions
问题: 返回平均值、最小值、最大值和总交易量。

SQL: SELECT avg(transaction_amount) ,  min(transaction_amount) ,  max(transaction_amount) ,   sum(transaction_amount) FROM Financial_transactions
问题: 显示所有大于平均值的交易的ID。

SQL: SELECT transaction_id FROM Financial_transactions WHERE transaction_amount  >  (SELECT avg(transaction_amount) FROM Financial_transactions)
问题: 金额大于平均交易金额的交易的ID是什么？

SQL: SELECT transaction_id FROM Financial_transactions WHERE transaction_amount  >  (SELECT avg(transaction_amount) FROM Financial_transactions)
问题: 显示交易类型和交易总量。

SQL: SELECT transaction_type ,  sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type
问题: 每个交易类型的总交易金额是多少？

SQL: SELECT transaction_type ,  sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type
问题: 显示帐户名称、ID和每个帐户的交易数量。

SQL: SELECT T2.account_name ,  T1.account_id ,  count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id
问题: 返回每个帐户的名称和ID，以及交易的数量。

SQL: SELECT T2.account_name ,  T1.account_id ,  count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id
问题: 显示有最多数量交易的帐户ID。

SQL: SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1
问题: 交易最多的账户ID是什么？

SQL: SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1
问题: 显示至少有4个交易的帐户ID和名称。

SQL: SELECT T1.account_id ,  T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id HAVING count(*)  >=  4
问题: 有4个或更多交易的账户的ID和名称是什么？

SQL: SELECT T1.account_id ,  T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id HAVING count(*)  >=  4
问题: 显示所有产品尺寸。

SQL: SELECT DISTINCT product_size FROM Products
问题: 不同的产品尺寸是什么？

SQL: SELECT DISTINCT product_size FROM Products
问题: 显示所有产品颜色。

SQL: SELECT DISTINCT product_color FROM Products
问题: 不同的产品颜色是什么？

SQL: SELECT DISTINCT product_color FROM Products
问题: 显示发票号码和每张发票的交易数量。

SQL: SELECT invoice_number ,  count(*) FROM Financial_transactions GROUP BY invoice_number
问题: 每个发票号码对应多少个交易？

SQL: SELECT invoice_number ,  count(*) FROM Financial_transactions GROUP BY invoice_number
问题: 最多交易的发票号码和发票日期是多少？

SQL: SELECT T2.invoice_number ,  T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number  =  T2.invoice_number GROUP BY T1.invoice_number ORDER BY count(*) DESC LIMIT 1
问题: 与交易次数最多的发票对应的发票号和发票日期是什么？

SQL: SELECT T2.invoice_number ,  T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number  =  T2.invoice_number GROUP BY T1.invoice_number ORDER BY count(*) DESC LIMIT 1
问题: 我们有多少发票？

SQL: SELECT count(*) FROM Invoices
问题: 计算发票数量。

SQL: SELECT count(*) FROM Invoices
问题: 显示所有发票的日期和订单ID和细节。

SQL: SELECT T1.invoice_date ,  T1.order_id ,  T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id  =  T2.order_id
问题: 所有发票的发票日期、订单ID和订单细节是什么？

SQL: SELECT T1.invoice_date ,  T1.order_id ,  T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id  =  T2.order_id
问题: 显示订单ID和每个订单的发票数量。

SQL: SELECT order_id ,  count(*) FROM Invoices GROUP BY order_id
问题: 每个订单ID对应多少发票？

SQL: SELECT order_id ,  count(*) FROM Invoices GROUP BY order_id
问题: 有两个以上的发票的订单的订单ID和订单详细信息是什么？

SQL: SELECT T2.order_id ,  T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id  =  T2.order_id GROUP BY T2.order_id HAVING count(*)  >  2
问题: 返回用两个或多个发票的订单ID和订单的详细信息。

SQL: SELECT T2.order_id ,  T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id  =  T2.order_id GROUP BY T2.order_id HAVING count(*)  >  2
问题: 订单数最多的客户的姓氏、ID和电话号码是多少？

SQL: SELECT T2.customer_last_name ,  T1.customer_id ,  T2.phone_number FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
问题: 返回订单数量最多的客户的姓氏、ID和电话号码。

SQL: SELECT T2.customer_last_name ,  T1.customer_id ,  T2.phone_number FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
问题: 显示没有订单的所有产品名称。

SQL: SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id
问题: 没有被订购过的产品名称是什么？

SQL: SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id
问题: 显示所有产品名称和每个产品名称所订购的总数量。

SQL: SELECT T2.product_name ,  sum(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id  =  T2.product_id GROUP BY T2.product_name
问题: 不同的产品名称是什么，每个产品订购的数量之和是多少？

SQL: SELECT T2.product_name ,  sum(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id  =  T2.product_id GROUP BY T2.product_name
问题: 显示订单ID和每个订单中的项目数量。

SQL: SELECT order_id ,  count(*) FROM Order_items GROUP BY order_id
问题: 每个订单ID对应多少个订单项？

SQL: SELECT order_id ,  count(*) FROM Order_items GROUP BY order_id
问题: 显示产品ID和包含每个产品的唯一订单的数量。

SQL: SELECT product_id ,  count(DISTINCT order_id) FROM Order_items GROUP BY product_id
问题: 每个产品有多少个不同的订单ID？

SQL: SELECT product_id ,  count(DISTINCT order_id) FROM Order_items GROUP BY product_id
问题: 显示所有产品名称和对每个产品有订单的客户数量。

SQL: SELECT T2.product_name ,  count(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id  =  T2.product_id JOIN Orders AS T3 ON T3.order_id  =  T1.order_id GROUP BY T2.product_name
问题: 不同产品的名称是什么，以及订购了每种产品的客户数量。

SQL: SELECT T2.product_name ,  count(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id  =  T2.product_id JOIN Orders AS T3 ON T3.order_id  =  T1.order_id GROUP BY T2.product_name
问题: 显示订单ID和每个订单的产品数量。

SQL: SELECT order_id ,  count(DISTINCT product_id) FROM Order_items GROUP BY order_id
问题: 每个订单ID对应多少个不同的产品？

SQL: SELECT order_id ,  count(DISTINCT product_id) FROM Order_items GROUP BY order_id
问题: 显示订单ID和每个订单的总数量。

SQL: SELECT order_id ,  sum(product_quantity) FROM Order_items GROUP BY order_id
问题: 给出所有订单的订单ID，以及每个订单中的总产品数量。

SQL: SELECT order_id ,  sum(product_quantity) FROM Order_items GROUP BY order_id
问题: 有多少产品不包括在任何订单中？

SQL: SELECT count(*) FROM products WHERE product_id NOT IN ( SELECT product_id FROM Order_items )
问题: 计算从未订购的产品的数量。

SQL: SELECT count(*) FROM products WHERE product_id NOT IN ( SELECT product_id FROM Order_items )
问题: 1850年之前有多少教堂开放？

SQL: SELECT count(*) FROM Church WHERE Open_Date  <  1850
问题: 展示所有教堂的名称、开放日期和组织者。

SQL: SELECT name ,  open_date ,  organized_by FROM Church
问题: 以开放日期的降序列出所有教堂名称。

SQL: SELECT name FROM church ORDER BY open_date DESC
问题: 显示至少有两个教堂开放的年份。

SQL: SELECT open_date FROM church GROUP BY open_date HAVING count(*)  >=  2
问题: 展示1830至1840年间开办的教堂的组织者和姓名。

SQL: SELECT organized_by ,  name FROM church WHERE open_date BETWEEN 1830 AND 1840
问题: 展示所有的开放年和在那一年开办的教堂数量。

SQL: SELECT open_date ,  count(*) FROM church GROUP BY open_date
问题: 为最近开办的三个教堂显示名字和开放年。

SQL: SELECT name ,  open_date FROM church ORDER BY open_date DESC LIMIT 3
问题: 我们的记录中有多少女性年龄超过30岁？

SQL: SELECT count(*) FROM people WHERE is_male  =  '女' AND age  >  30
问题: 展示30岁以上和25岁以下的人来自的国家。

SQL: SELECT country FROM people WHERE age  <  25 INTERSECT SELECT country FROM people WHERE age  >  30
问题: 显示所有人的最小、最大和平均年龄。

SQL: SELECT min(age) ,  max(age) ,  avg(age) FROM people
问题: 显示所有年龄小于平均值的人的姓名和国家。

SQL: SELECT name ,  country FROM people WHERE age  <  (SELECT avg(age) FROM people)
问题: 显示在2014年后的所有婚礼的一对男女的名字。

SQL: SELECT T2.name ,  T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id  =  T2.people_id JOIN people AS T3 ON T1.female_id  =  T3.people_id WHERE T1.year  >  2014
问题: 显示所有没有婚礼的男性的姓名和年龄。

SQL: SELECT name ,  age FROM people WHERE is_male  =  'T' AND people_id NOT IN (SELECT male_id FROM wedding)
问题: 显示除了在第2015年举行婚礼的那些教堂外，其他所有教堂的名字。

SQL: SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id  =  T2.church_id WHERE T2.year  =  2015
问题: 显示所有举办过至少两次婚礼的教堂名称。

SQL: SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id  =  T2.church_id GROUP BY T1.church_id HAVING count(*)  >=  2
问题: 显示在2016年有婚礼的所有“加拿大”女性的名字。

SQL: SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id  =  T2.people_id WHERE T1.year  =  2016 AND T2.is_male  =  '女' AND T2.country  =  '加拿大'
问题: 在2016年有多少婚礼？

SQL: SELECT count(*) FROM wedding WHERE YEAR  =  2016
问题: 显示所有为30岁以上的人举行婚礼的教堂名字。

SQL: SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id  =  T2.people_id JOIN people AS T3 ON T1.female_id  =  T3.people_id JOIN church AS T4 ON T4.church_id  =  T1.church_id WHERE T2.age  >  30 OR T3.age  >  30
问题: 展示所有国家和每个国家的人数。

SQL: SELECT country ,  count(*) FROM people GROUP BY country
问题: 2016年有多少教堂举行婚礼？

SQL: SELECT COUNT (DISTINCT church_id) FROM wedding WHERE YEAR  =  2016
问题: 我们有多少艺术家？

SQL: SELECT count(*) FROM artist
问题: 统计艺术家的数量。

SQL: SELECT count(*) FROM artist
问题: 显示按加入年份排序的所有艺术家的姓名，年龄和国家。

SQL: SELECT name ,  age ,  country FROM artist ORDER BY Year_Join
问题: 按他们加入的年份排序的艺术家的姓名、年龄和国家是什么？

SQL: SELECT name ,  age ,  country FROM artist ORDER BY Year_Join
问题: 艺术家的不同国家是什么样的？

SQL: SELECT DISTINCT country FROM artist
问题: 返回艺术家的不同国家。

SQL: SELECT DISTINCT country FROM artist
问题: 显示不是来自“美国”的所有艺术家的名字和加入的年份。

SQL: SELECT name ,  year_join FROM artist WHERE country != '美国'
问题: 不是“美国”的艺术家的姓名和加入年份是什么？

SQL: SELECT name ,  year_join FROM artist WHERE country != '美国'
问题: 有多少艺术家年龄在46岁以上而且是正在1990年以后加入？

SQL: SELECT count(*) FROM artist WHERE age  >  46 AND year_join  >  1990
问题: 统计超过46岁并在1990岁后加入的艺术家的数量。

SQL: SELECT count(*) FROM artist WHERE age  >  46 AND year_join  >  1990
问题: “美国”所有艺术家的平均年龄和最小年龄是多少？

SQL: SELECT avg(age) ,  min(age) FROM artist WHERE country  =  '美国'
问题: 返回来自“美国”艺术家的平均年龄和最小年龄。

SQL: SELECT avg(age) ,  min(age) FROM artist WHERE country  =  '美国'
问题: 最新加入的艺术家的名字是什么？

SQL: SELECT name FROM artist ORDER BY year_join DESC LIMIT 1
问题: 返回最新加入的艺术家的姓名。

SQL: SELECT name FROM artist ORDER BY year_join DESC LIMIT 1
问题: 2005年或以后有多少展览？

SQL: SELECT count(*) FROM exhibition WHERE YEAR  >=  2005
问题: 统计在2005或之后发的展览数量。

SQL: SELECT count(*) FROM exhibition WHERE YEAR  >=  2005
问题: 显示票价低于15的所有展览的主题和年份。

SQL: SELECT theme ,  YEAR FROM exhibition WHERE ticket_price  <  15
问题: 所有门票价格低于15的展览的主题和年份是什么？

SQL: SELECT theme ,  YEAR FROM exhibition WHERE ticket_price  <  15
问题: 显示所有艺术家的名字和每个艺术家的展览的数量。

SQL: SELECT T2.name ,  count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id
问题: 每个艺术家都有多少展览？

SQL: SELECT T2.name ,  count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id
问题: 展览最多的的艺术家名字和国家是什么？

SQL: SELECT T2.name , T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id ORDER BY count(*) DESC LIMIT 1
问题: 返回展览次数最多的艺术家相对应的姓名和国家。

SQL: SELECT T2.name , T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id ORDER BY count(*) DESC LIMIT 1
问题: 显示没有任何展览的艺术家名字。

SQL: SELECT name FROM artist WHERE artist_id NOT IN (SELECT artist_id FROM exhibition)
问题: 那些没有展览的艺术家的名字是什么？

SQL: SELECT name FROM artist WHERE artist_id NOT IN (SELECT artist_id FROM exhibition)
问题: 门票价格高于平均水平的展览的主题和艺术家的名字是什么？

SQL: SELECT T1.theme ,  T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id WHERE T1.ticket_price  >  (SELECT avg(ticket_price) FROM exhibition)
问题: 返回票价高于平均水平的艺术家姓名及其展览主题。

SQL: SELECT T1.theme ,  T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id WHERE T1.ticket_price  >  (SELECT avg(ticket_price) FROM exhibition)
问题: 显示2009年之前所有年份展览的平均、最低和最高门票价格。

SQL: SELECT avg(ticket_price) ,  min(ticket_price) ,  max(ticket_price) FROM exhibition WHERE YEAR  <  2009
问题: 2009年之前的展览会平均、最低和最高票价是多少？

SQL: SELECT avg(ticket_price) ,  min(ticket_price) ,  max(ticket_price) FROM exhibition WHERE YEAR  <  2009
问题: 以门票价格的降序展示所有展览的主题和年份。

SQL: SELECT theme ,  YEAR FROM exhibition ORDER BY ticket_price DESC
问题: 展览的主题和年份是什么，按门票价格下降排序？

SQL: SELECT theme ,  YEAR FROM exhibition ORDER BY ticket_price DESC
问题: 2004年度展览的主题、日期和出席情况是什么？

SQL: SELECT T2.theme ,  T1.date ,  T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T2.year  =  2004
问题: 返回在2004发生的展览的主题、日期和出席情况。

SQL: SELECT T2.theme ,  T1.date ,  T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T2.year  =  2004
问题: 展示所有在2004没有展览的艺术家名字。

SQL: SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id WHERE T1.year  =  2004
问题: 2004没有举办展览的艺术家的名字是什么？

SQL: SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id WHERE T1.year  =  2004
问题: 显示参展人数记录包括低于100人及超过500人的展览的主题。

SQL: SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  <  100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  500
问题: 展览的出席人数曾在100以下和500以上的主题有哪些？

SQL: SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  <  100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  500
问题: 有多少展览的参观人数超过100人或门票价格低于10？

SQL: SELECT count(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  100 OR T2.ticket_price  <  10
问题: 数一数出席人数超过100人或门票价格低于10人的展览会数量。

SQL: SELECT count(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  100 OR T2.ticket_price  <  10
问题: 显示平均展览出席人数超过200的所有艺术家的姓名，。

SQL: SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id JOIN artist AS T3 ON T3.artist_id  =  T2.artist_id GROUP BY T3.artist_id HAVING avg(T1.attendance)  >  200