jtjt520j/CSpider_for_Qwen huggingface dataset:
问题: 统计活跃客户的数量。

SQL: SELECT count(*) FROM customer WHERE active = '1'
问题: 哪部电影的出租率最高？比率是多少？

SQL: SELECT title ,  rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1
问题: 出租率最高的电影的标题和出租率是什么？

SQL: SELECT title ,  rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1
问题: 哪部电影的演员最多？列出电影名称、影片ID和描述。

SQL: SELECT T2.title ,  T2.film_id ,  T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T2.film_id ORDER BY count(*) DESC LIMIT 1
问题: 演员最多的电影的片名、id和描述是什么？

SQL: SELECT T2.title ,  T2.film_id ,  T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T2.film_id ORDER BY count(*) DESC LIMIT 1
问题: 哪位电影男演员（女演员）主演的电影最多？列出他或她的名字，姓氏和演员ID。

SQL: SELECT T2.first_name ,  T2.last_name ,  T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id  =  T2.actor_id GROUP BY T2.actor_id ORDER BY count(*) DESC LIMIT 1
问题: 返回在最多电影中主演的男演员或女演员的全名和id。

SQL: SELECT T2.first_name ,  T2.last_name ,  T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id  =  T2.actor_id GROUP BY T2.actor_id ORDER BY count(*) DESC LIMIT 1
问题: 哪些电影演员扮演超过30部电影？列出他或她的名字和姓氏。

SQL: SELECT T2.first_name ,  T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id  =  T2.actor_id GROUP BY T2.actor_id HAVING count(*)  >  30
问题: 在30部以上的电影中扮演过角色的演员的全名是什么？

SQL: SELECT T2.first_name ,  T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id  =  T2.actor_id GROUP BY T2.actor_id HAVING count(*)  >  30
问题: 哪个商店拥有最多的商品？

SQL: SELECT store_id FROM inventory GROUP BY store_id ORDER BY count(*) DESC LIMIT 1
问题: 库存物品最多的商店ID是什么？

SQL: SELECT store_id FROM inventory GROUP BY store_id ORDER BY count(*) DESC LIMIT 1
问题: 所有付款的总额是多少？

SQL: SELECT sum(amount) FROM payment
问题: 返回所有付款金额的总和。

SQL: SELECT sum(amount) FROM payment
问题: 哪一位客户至少花了一笔钱而且花了最少的钱？列出他或她的名字，姓氏和id。

SQL: SELECT T1.first_name ,  T1.last_name ,  T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY sum(amount) ASC LIMIT 1
问题: 付款总额最低的客户的全名和id是什么？

SQL: SELECT T1.first_name ,  T1.last_name ,  T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY sum(amount) ASC LIMIT 1
问题: 电影“邪不压正”的类别名称是什么？

SQL: SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id  =  T2.category_id JOIN film AS T3 ON T2.film_id  =  T3.film_id WHERE T3.title  =  '邪不压正'
问题: 返回电影“邪不压正”所属类别的名称。

SQL: SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id  =  T2.category_id JOIN film AS T3 ON T2.film_id  =  T3.film_id WHERE T3.title  =  '邪不压正'
问题: 每个类别有多少部电影？列出类别名称、类别ID和数量。

SQL: SELECT T2.name ,  T1.category_id ,  count(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id  =  T2.category_id GROUP BY T1.category_id
问题: 不同类别的名称和id是什么？每类有多少部电影？

SQL: SELECT T2.name ,  T1.category_id ,  count(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id  =  T2.category_id GROUP BY T1.category_id
问题: 哪部电影库存中的副本最多？列出标题和ID。

SQL: SELECT T1.title ,  T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id ORDER BY count(*) DESC LIMIT 1
问题: 库存中副本最多的电影的名称和ID是什么？

SQL: SELECT T1.title ,  T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id ORDER BY count(*) DESC LIMIT 1
问题: 库存中最常被租用的项目的电影名称和库存id是什么？

SQL: SELECT T1.title ,  T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id  =  T2.film_id JOIN rental AS T3 ON T2.inventory_id  =  T3.inventory_id GROUP BY T2.inventory_id ORDER BY count(*) DESC LIMIT 1
问题: 返回最常被租用的电影的标题和库存ID。

SQL: SELECT T1.title ,  T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id  =  T2.film_id JOIN rental AS T3 ON T2.inventory_id  =  T3.inventory_id GROUP BY T2.inventory_id ORDER BY count(*) DESC LIMIT 1
问题: 这些电影有多少种语言？

SQL: SELECT count(DISTINCT language_id) FROM film
问题: 计算这些影片中不同语言的数量。

SQL: SELECT count(DISTINCT language_id) FROM film
问题: 所有评级为“R”的电影是什么？列出标题。

SQL: SELECT title FROM film WHERE rating  =  'R'
问题: 返回所有评级为“R”的电影的标题。

SQL: SELECT title FROM film WHERE rating  =  'R'
问题: 商店1在哪里？

SQL: SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id  =  T2.address_id WHERE store_id  =  1
问题: 返回商店1的地址。

SQL: SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id  =  T2.address_id WHERE store_id  =  1
问题: 哪些员工处理的付款次数最少？列出全名和ID。

SQL: SELECT T1.first_name ,  T1.last_name ,  T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id  =  T2.staff_id GROUP BY T1.staff_id ORDER BY count(*) ASC LIMIT 1
问题: 给出处理付款最少的工作人员的全名和工作人员ID。

SQL: SELECT T1.first_name ,  T1.last_name ,  T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id  =  T2.staff_id GROUP BY T1.staff_id ORDER BY count(*) ASC LIMIT 1
问题: 电影“暗战”使用的是哪种语言？列出语言名称。

SQL: SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id  =  T2.language_id WHERE T1.title  =  '暗战'
问题: 电影“暗战”中使用的语言是什么？

SQL: SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id  =  T2.language_id WHERE T1.title  =  '暗战'
问题: 有多少商店？

SQL: SELECT count(*) FROM store
问题: 统计商店的数量。

SQL: SELECT count(*) FROM store
问题: 一共有多少种不同的评级？

SQL: SELECT count(DISTINCT rating) FROM film
问题: 计算电影的不同评级的数量。

SQL: SELECT count(DISTINCT rating) FROM film
问题: 哪些电影有“删除场景”作为特色的一部分？

SQL: SELECT title FROM film WHERE special_features LIKE '删除场景'
问题: 返回包含“删除场景”作为特色的电影的标题。

SQL: SELECT title FROM film WHERE special_features LIKE '删除场景'
问题: 商店1的库存中有多少种物品？

SQL: SELECT count(*) FROM inventory WHERE store_id  =  1
问题: 统计商店1库存物品的数量。

SQL: SELECT count(*) FROM inventory WHERE store_id  =  1
问题: 第一次付款是什么时候发生的？

SQL: SELECT payment_date FROM payment ORDER BY payment_date ASC LIMIT 1
问题: 最早付款的日期是什么？

SQL: SELECT payment_date FROM payment ORDER BY payment_date ASC LIMIT 1
问题: 名为“天天”的客户住在哪里？她的电子邮件是什么？

SQL: SELECT T2.address ,  T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id  =  T1.address_id WHERE T1.first_name  =  '天天'
问题: 返回名为“天天”的客户的地址和电子邮件。

SQL: SELECT T2.address ,  T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id  =  T1.address_id WHERE T1.first_name  =  '天天'
问题: 找到所有超过100分钟或评级为“限制”的电影，去掉那些替换时间花费超过200的。列出标题。

SQL: SELECT title FROM film WHERE LENGTH  >  100 OR rating  =  '限制' EXCEPT SELECT title FROM film WHERE replacement_cost  >  200
问题: 除了那些替换时间花费超过200多分钟的电影之外，超过100分钟或者评级为限制级的电影的片名是什么？

SQL: SELECT title FROM film WHERE LENGTH  >  100 OR rating  =  '限制' EXCEPT SELECT title FROM film WHERE replacement_cost  >  200
问题: 最早租房的客户的名字和姓氏是什么？

SQL: SELECT T1.first_name ,  T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id  =  T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1
问题: 返回最早租房的客户的全名。

SQL: SELECT T1.first_name ,  T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id  =  T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1
问题: 租了一部电影给一位名为“晓月”姓为“张”的顾客的职员的全名是什么？

SQL: SELECT DISTINCT T1.first_name ,  T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id  =  T2.staff_id JOIN customer AS T3 ON T2.customer_id  =  T3.customer_id WHERE T3.first_name  =  '晓月' AND T3.last_name  =  '张'
问题: 返回给姓是“张”名是“晓月”的客户提供电影租赁的员工的全名。

SQL: SELECT DISTINCT T1.first_name ,  T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id  =  T2.staff_id JOIN customer AS T3 ON T2.customer_id  =  T3.customer_id WHERE T3.first_name  =  '晓月' AND T3.last_name  =  '张'
问题: 哪个商店的顾客最多？

SQL: SELECT store_id FROM customer GROUP BY store_id ORDER BY count(*) DESC LIMIT 1
问题: 返回顾客最多的商店的id。

SQL: SELECT store_id FROM customer GROUP BY store_id ORDER BY count(*) DESC LIMIT 1
问题: 最大的支付金额是多少？

SQL: SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
问题: 返回最大的支付的金额。

SQL: SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
问题: 姓“严”的工作人员住在哪里？

SQL: SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id  =  T2.address_id WHERE T1.first_name  =  '严'
问题: 请给出姓为“严”的工作人员的地址。

SQL: SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id  =  T2.address_id WHERE T1.first_name  =  '严'
问题: 在“2005-08-2302:06:01”之后没有租过电影的客户的名字是什么？

SQL: SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date  >  '2005-08-23 02:06:01' )
问题: 返回在“2005-08-2302:06:01”之后没有租电影的客户的名字。

SQL: SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date  >  '2005-08-23 02:06:01' )
问题: 有多少银行分行？

SQL: SELECT count(*) FROM bank
问题: 统计银行分行的数量。

SQL: SELECT count(*) FROM bank
问题: 有多少顾客？

SQL: SELECT sum(no_of_customers) FROM bank
问题: 银行的总客户数是多少？

SQL: SELECT sum(no_of_customers) FROM bank
问题: 找到“上海市”的银行的客户数量。

SQL: SELECT sum(no_of_customers) FROM bank WHERE city  =  '上海'
问题: 使用“上海市”的银行的客户总数是多少？

SQL: SELECT sum(no_of_customers) FROM bank WHERE city  =  '上海'
问题: 找出犹他各州的银行的平均客户数。

SQL: SELECT avg(no_of_customers) FROM bank WHERE state  =  '江西'
问题: “江西”的银行的平均客户数是多少？

SQL: SELECT avg(no_of_customers) FROM bank WHERE state  =  '江西'
问题: 找到所有银行的平均客户数。

SQL: SELECT avg(no_of_customers) FROM bank
问题: 银行客户的平均数量是多少？

SQL: SELECT avg(no_of_customers) FROM bank
问题: 找到名为“浦发”的银行分行所在的城市和州。

SQL: SELECT city ,  state FROM bank WHERE bname  =  '浦发'
问题: 名为“浦发”的银行所在的城市和州是什么？

SQL: SELECT city ,  state FROM bank WHERE bname  =  '浦发'
问题: 查找“上海”的银行分行名称。

SQL: SELECT bname FROM bank WHERE state  =  '上海'
问题: “上海”的银行的名称是什么？

SQL: SELECT bname FROM bank WHERE state  =  '上海'
问题: 按帐户余额升序排列列出所有客户的名字。

SQL: SELECT cust_name FROM customer ORDER BY acc_bal
问题: 按账户余额排序，所有客户的名字是什么？

SQL: SELECT cust_name FROM customer ORDER BY acc_bal
问题: 按贷款总额排序列出所有不同客户的名字。

SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount)
问题: 按贷款总额排序，不同客户的名字是什么？

SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount)
问题: 查找贷款数额为0的客户的状态、帐户类型和信用评分。

SQL: SELECT state ,  acc_type ,  credit_score FROM customer WHERE no_of_loans  =  0
问题: 零贷款的客户的状态、账户类型和信用评分是什么？

SQL: SELECT state ,  acc_type ,  credit_score FROM customer WHERE no_of_loans  =  0
问题: 找出银行所处的不同城市的数量。

SQL: SELECT count(DISTINCT city) FROM bank
问题: 银行所在多少个不同的城市？

SQL: SELECT count(DISTINCT city) FROM bank
问题: 找出银行所处的不同州的数目。

SQL: SELECT count(DISTINCT state) FROM bank
问题: 银行所在有多少不同的州？

SQL: SELECT count(DISTINCT state) FROM bank
问题: 有多少种不同类型的账户？

SQL: SELECT count(DISTINCT acc_type) FROM customer
问题: 计算不同帐户类型的数量。

SQL: SELECT count(DISTINCT acc_type) FROM customer
问题: 找到名字中包含字母“a”的客户的姓名和账户余额.

SQL: SELECT cust_name ,  acc_bal FROM customer WHERE cust_name LIKE 'a'
问题: 名字中包含字母“a”的客户姓名和账户余额是什么？

SQL: SELECT cust_name ,  acc_bal FROM customer WHERE cust_name LIKE 'a'
问题: 查找来自“江西”或“云南”的每个客户的总账户余额。

SQL: SELECT sum(acc_bal) FROM customer WHERE state  =  '江西' OR state  =  '云南'
问题: 来自“江西”或“云南”的每个客户的总账户余额是多少？

SQL: SELECT sum(acc_bal) FROM customer WHERE state  =  '江西' OR state  =  '云南'
问题: 查找同时有“存储”和“支票”帐户类型的客户的名字。

SQL: SELECT cust_name FROM customer WHERE acc_type  =  '存储' INTERSECT SELECT cust_name FROM customer WHERE acc_type  =  '支票'
问题: 同时拥有“存储”账户和“支票”账户的客户名字是什么？

SQL: SELECT cust_name FROM customer WHERE acc_type  =  '存储' INTERSECT SELECT cust_name FROM customer WHERE acc_type  =  '支票'
问题: 查找没有“存储”账户的客户的名字。

SQL: SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type  =  '存储'
问题: 没有“存储”账户的客户的名字是什么？

SQL: SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type  =  '存储'
问题: 查找没有“抵押”类型贷款的客户的名字。

SQL: SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE T2.loan_type  =  '抵押'
问题: 那些没有接受过“抵押”贷款的客户的名字是什么？

SQL: SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE T2.loan_type  =  '抵押'
问题: 查找有“抵押”贷款和“汽车”贷款的客户的名字。

SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE loan_type  =  '抵押' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE loan_type  =  '汽车'
问题: 有过“抵押”贷款和“汽车”贷款的客户的名字是什么？

SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE loan_type  =  '抵押' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE loan_type  =  '汽车'
问题: 查找信用评分低于所有客户平均信用评分的客户的名字。

SQL: SELECT cust_name FROM customer WHERE credit_score  <  (SELECT avg(credit_score) FROM customer)
问题: 信用评分低于所有客户平均信用评分的客户的名字是什么？

SQL: SELECT cust_name FROM customer WHERE credit_score  <  (SELECT avg(credit_score) FROM customer)
问题: 找到客户数量最多的银行支行名称。

SQL: SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1
问题: 客户数量最多的银行支行的名称是什么？

SQL: SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1
问题: 查找信用评分最低的客户的名字。

SQL: SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1
问题: 信用评分最差的客户的名字是什么？

SQL: SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1
问题: 查找具有最高信用评分的客户的名字、帐户类型和帐户余额。

SQL: SELECT cust_name ,  acc_type ,  acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1
问题: 具有最高信用评分的客户相对应的名字、帐户类型和帐户余额是什么？

SQL: SELECT cust_name ,  acc_type ,  acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1
问题: 查找贷款金额最高的客户的名字。

SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1
问题: 总贷款金额最大的客户名字是什么？

SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1
问题: 找出客户数量最多的州。

SQL: SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1
问题: 哪一个州的银行客户总数最大？

SQL: SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1
问题: 针对每个账户类型，找到信用评分低于50的客户的平均账户余额。

SQL: SELECT avg(acc_bal) ,  acc_type FROM customer WHERE credit_score  <  50 GROUP BY acc_type
问题: 针对不同的账户类型，信用评分低于50的客户的平均账户余额是多少？

SQL: SELECT avg(acc_bal) ,  acc_type FROM customer WHERE credit_score  <  50 GROUP BY acc_type
问题: 针对每个州，找到信用评分超过100的客户的总账户余额。

SQL: SELECT sum(acc_bal) ,  state FROM customer WHERE credit_score  >  100 GROUP BY state
问题: 对于不同州的信用评分超过100的客户，帐户总余额是多少？

SQL: SELECT sum(acc_bal) ,  state FROM customer WHERE credit_score  >  100 GROUP BY state
问题: 找到每个银行分行所提供的贷款总额。

SQL: SELECT sum(amount) ,  T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id GROUP BY T1.bname
问题: 不同的银行分行的名称是什么，它们的贷款总额是多少？

SQL: SELECT sum(amount) ,  T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id GROUP BY T1.bname
问题: 查找拥有不止一笔贷款的客户的姓名。

SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name HAVING count(*)  >  1
问题: 拥有一笔以上贷款的客户的姓名是什么？

SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name HAVING count(*)  >  1
问题: 查找贷款总额超过5000的客户的姓名和账户余额。

SQL: SELECT T1.cust_name ,  T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount)  >  5000
问题: 贷款总额超过5000的客户的姓名和账户余额是多少？

SQL: SELECT T1.cust_name ,  T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount)  >  5000
问题: 查找提供最大贷款总额的银行支行的名称。

SQL: SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id GROUP BY T1.bname ORDER BY sum(T2.amount) DESC LIMIT 1
问题: 贷款额度最大的银行支行的名称是什么？

SQL: SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id GROUP BY T1.bname ORDER BY sum(T2.amount) DESC LIMIT 1
问题: 找出向信用评分小于100的客户提供最大贷款总额的银行支行的名称。

SQL: SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id  =  T2.branch_id JOIN customer AS T3 ON T1.cust_id  =  T3.cust_id WHERE T3.credit_score  <  100 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1
问题: 针对那些信用评分低于100分的客户，放贷总额最大的银行支行的名字是什么？

SQL: SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id  =  T2.branch_id JOIN customer AS T3 ON T1.cust_id  =  T3.cust_id WHERE T3.credit_score  <  100 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1
问题: 查找提供过贷款的银行支行的名称。

SQL: SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id
问题: 提供过贷款的不同银行的名称是什么？

SQL: SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id
问题: 查找有贷款的客户的姓名和信用评分。

SQL: SELECT DISTINCT T1.cust_name ,  T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id
问题: 贷过款的不同客户的姓名和信用评分是什么？

SQL: SELECT DISTINCT T1.cust_name ,  T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id
问题: 找到贷款数额超过3000的客户的名字。

SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE amount  >  3000
问题: 贷款金额超过3000的客户名字是什么？

SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE amount  >  3000
问题: 查找提供“商业”贷款的银行分行的名称和所在的城市名称。

SQL: SELECT T1.bname ,  T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id WHERE T2.loan_type  =  '商业'
问题: 提供“商业”贷款的银行支行的名称和所在城市是什么？

SQL: SELECT T1.bname ,  T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id WHERE T2.loan_type  =  '商业'
问题: 查找向信用评分低于100的任何客户提供过贷款的银行分行的名称。

SQL: SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id  =  T2.branch_id JOIN customer AS T3 ON T1.cust_id  =  T3.cust_id WHERE T3.credit_score  <  100
问题: 贷款给信用评分低于100分的客户的银行的名称是什么？

SQL: SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id  =  T2.branch_id JOIN customer AS T3 ON T1.cust_id  =  T3.cust_id WHERE T3.credit_score  <  100
问题: 查找“上海”的银行分行提供的贷款总额。

SQL: SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id WHERE T1.state  =  '上海'
问题: “上海”的银行贷款的总金额是多少？

SQL: SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id WHERE T1.state  =  '上海'
问题: 找到有贷款的客户的平均信用评分。

SQL: SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)
问题: 贷过款的客户的平均信用评分是多少？

SQL: SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)
问题: 找到没有贷过款的客户的平均信用评分。

SQL: SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan)
问题: 从未贷过款的客户的平均信用评分是多少？

SQL: SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan)
问题: 总共有多少个评估记录？

SQL: SELECT count(*) FROM ASSESSMENT_NOTES
问题: 评估记录的日期是什么？

SQL: SELECT date_of_notes FROM Assessment_Notes
问题: 有多少地址包含邮政编码“197”？

SQL: SELECT count(*) FROM ADDRESSES WHERE zip_postcode  =  "197"
问题: 有多少种不同的事件类型代码？

SQL: SELECT count(DISTINCT incident_type_code) FROM Behavior_Incident
问题: 返回所有不同的拘留类型代码。

SQL: SELECT DISTINCT detention_type_code FROM Detention
问题: 事件类型代码为“噪音”的事件的开始和结束日期是什么？

SQL: SELECT date_incident_start ,  date_incident_end FROM Behavior_Incident WHERE incident_type_code  =  "噪音"
问题: 返回所有的拘留摘要。

SQL: SELECT detention_summary FROM Detention
问题: 返回所有学生的手机号码和电子邮件地址。

SQL: SELECT cell_mobile_number ,  email_address FROM STUDENTS
问题: 名字叫“杨”和“栋”的学生的电子邮件是什么？

SQL: SELECT email_address FROM Students WHERE first_name  =  "杨" AND last_name  =  "栋"
问题: 有多少不同的学生被拘留？

SQL: SELECT count(DISTINCT student_id) FROM Students_in_Detention
问题: 名为“军”的老师的性别是什么？

SQL: SELECT gender FROM TEACHERS WHERE last_name  =  "军"
问题: 事件类型代码为“暴力”的事件类型描述是什么？

SQL: SELECT incident_type_description FROM Ref_Incident_Type WHERE incident_type_code  =  "暴力"
问题: 找到所有学生住址的最高和最低月租金。

SQL: SELECT max(monthly_rental) ,  min(monthly_rental) FROM Student_Addresses
问题: 找到电子邮件地址中包含“qq”一词的老师的名字。

SQL: SELECT first_name FROM Teachers WHERE email_address LIKE 'qq'
问题: 按日期升序列出有关评估说明的所有信息。

SQL: SELECT * FROM Assessment_Notes ORDER BY date_of_notes ASC
问题: 按字母顺序列出所有城市的地址。

SQL: SELECT city FROM Addresses ORDER BY city
问题: 按照姓氏的字母顺序查找老师的姓和名。

SQL: SELECT first_name ,  last_name FROM Teachers ORDER BY last_name
问题: 按照月租金降序排序，查找学生住址的所有信息。

SQL: SELECT * FROM Student_Addresses ORDER BY monthly_rental DESC
问题: 找到评估记录最多的学生的id和名字。

SQL: SELECT T1.student_id ,  T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
问题: 找出评估记录数量最多的3个老师的ID和名字。

SQL: SELECT T1.teacher_id ,  T2.first_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id  =  T2.teacher_id GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 3
问题: 找出行为事件最多的学生的ID和姓氏？

SQL: SELECT T1.student_id ,  T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
问题: 找到被拘留次数最多且拘留类型代码为“后置”的老师的id和姓氏？

SQL: SELECT T1.teacher_id ,  T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id  =  T2.teacher_id WHERE T1.detention_type_code  =  "后置" GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 1
问题: 住址的平均月租金最高的学生的id和名字是什么？

SQL: SELECT T1.student_id ,  T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1
问题: 查找住址平均月租金最高的学生的id和城市。

SQL: SELECT T2.address_id ,  T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id  =  T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1
问题: 最常见的行为事件类型的代码和描述是什么？

SQL: SELECT T1.incident_type_code ,  T2.incident_type_description FROM Behavior_Incident AS T1 JOIN Ref_Incident_Type AS T2 ON T1.incident_type_code  =  T2.incident_type_code GROUP BY T1.incident_type_code ORDER BY count(*) DESC LIMIT 1
问题: 最不常见的拘留类型的代码和描述是什么？

SQL: SELECT T1.detention_type_code ,  T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code  =  T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY count(*) ASC LIMIT 1
问题: 找到名为“小夏”的学生的评估记录的日期。

SQL: SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.first_name  =  "小夏"
问题: 查找姓氏为“齐”的老师的评语记录的内容。

SQL: SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id  =  T2.teacher_id WHERE T2.last_name  =  "齐"
问题: 找出姓氏为“贺”的学生的行为事件的开始和结束日期。

SQL: SELECT T1.date_incident_start ,  date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.last_name  =  "贺"
问题: 查找姓氏为“范”的教师被拘留的开始日期和结束日期。

SQL: SELECT T1.datetime_detention_start ,  datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id  =  T2.teacher_id WHERE T2.last_name  =  "范"
问题: 月租金最高的地址的id和邮政编码是什么？

SQL: SELECT T2.address_id ,  T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id  =  T2.address_id ORDER BY monthly_rental DESC LIMIT 1
问题: 住址的月租金最低的学生的手机号码是多少？

SQL: SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id ORDER BY T1.monthly_rental ASC LIMIT 1
问题: “云南”的学生住址的月租金是多少？

SQL: SELECT T2.monthly_rental FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id  =  T2.address_id WHERE T1.state_province_county  =  "云南"
问题: 住址在“陕西”的学生的名字和姓是什么？

SQL: SELECT T2.first_name ,  T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id  =  T2.address_id WHERE T1.state_province_county  =  "陕西"
问题: 所有学生住址的第一行和每月平均租金是多少？

SQL: SELECT T1.line_1 ,  avg(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id  =  T2.address_id GROUP BY T2.address_id
问题: 那位姓“小平”的老师住的地址的邮政编码是什么？

SQL: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id  =  T2.address_id WHERE T2.first_name  =  "小平"
问题: 住址的邮政编码为“918”的老师的电子邮件地址是什么？

SQL: SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id  =  T2.address_id WHERE T1.zip_postcode  =  "918"
问题: 有多少学生没有参与任何行为事件？

SQL: SELECT count(*) FROM STUDENTS WHERE student_id NOT IN ( SELECT student_id FROM Behavior_Incident )
问题: 找出没有被拘留过的教师的姓氏。

SQL: SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id  =  T2.teacher_id
问题: 那些学生和老师共有的地址的第1行是什么？

SQL: SELECT T1.line_1 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id  =  T2.address_id INTERSECT SELECT T1.line_1 FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id  =  T2.address_id