jtjt520j/CSpider_for_Qwen huggingface dataset:
问题: 哪些资产有2个部分并且故障日志少于2？列出资产ID和详细信息。

SQL: SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  =  2 INTERSECT SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  <  2
问题: 每个维修合同包含多少资产？列出个数和合同ID。

SQL: SELECT count(*) ,  T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id  =  T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id
问题: 每家第三方公司提供多少资产？列出总和和公司ID。

SQL: SELECT count(*) ,  T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id  =  T2.supplier_company_id GROUP BY T1.company_id
问题: 哪些第三方公司至少有两名维修工程师，或者至少有两份维修合同？列出公司ID和名称。

SQL: SELECT T1.company_id ,  T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Engineers AS T2 ON T1.company_id  =  T2.company_id GROUP BY T1.company_id HAVING count(*)  >=  2 UNION SELECT T3.company_id ,  T3.company_name FROM Third_Party_Companies AS T3 JOIN Maintenance_Contracts AS T4 ON T3.company_id  =  T4.maintenance_contract_company_id GROUP BY T3.company_id HAVING count(*)  >=  2
问题: 记录过故障日志但没有联系任何来访工程师的工作人员的姓名和id是什么？

SQL: SELECT T1.staff_name ,  T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id  =  T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name ,  T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id  =  T4.contact_staff_id
问题: 哪位工程师去过的次数最多？显示工程师id、名字和姓氏。

SQL: SELECT T1.engineer_id ,  T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY count(*) DESC LIMIT 1
问题: 哪些部件有超过2个故障？显示零件名称和ID。

SQL: SELECT T1.part_name ,  T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_id HAVING count(*)  >  2
问题: 列出所有工程师的名字、姓氏、详细情况以及相应的技能描述。

SQL: SELECT T1.first_name ,  T1.last_name ,  T1.other_details ,  T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id  =  T2.engineer_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
问题: 对于不同部件的所有故障，修复它们所需的所有技能的描述是什么？列出故障的名称和技能描述。

SQL: SELECT T1.fault_short_name ,  T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id  =  T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
问题: 每个零件可以用于多少资产？列出零件名称和编号。

SQL: SELECT T1.part_name ,  count(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_name
问题: 日志中的所有故障记录中的所有故障描述和故障状态是什么？

SQL: SELECT T1.fault_description ,  T2.fault_status FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id
问题: 一个单独的故障日志最多需要多少工程师参与？列出数字和日志条目ID。

SQL: SELECT count(*) ,  T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1
问题: 所有工程师的不同姓氏有哪些？

SQL: SELECT DISTINCT last_name FROM Maintenance_Engineers
问题: 在故障日志部件表中记录了多少故障状态代码？

SQL: SELECT DISTINCT fault_status FROM Fault_Log_Parts
问题: 哪些工程师从未参与过维护资产？列出工程师的名字和姓氏。

SQL: SELECT first_name ,  last_name FROM Maintenance_Engineers WHERE engineer_id NOT IN (SELECT engineer_id FROM Engineer_Visits)
问题: 列出每个资产的资产ID、细节、制作和模型。

SQL: SELECT asset_id ,  asset_details ,  asset_make ,  asset_model FROM Assets
问题: 第一笔资产是什么时候收购的？

SQL: SELECT asset_acquired_date FROM Assets ORDER BY asset_acquired_date ASC LIMIT 1
问题: 哪个部件故障需要最多的技能来修复？列出零件ID和名称。

SQL: SELECT T1.part_id ,  T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id  =  T3.part_fault_id GROUP BY T1.part_id ORDER BY count(*) DESC LIMIT 1
问题: 哪一类部件的故障数量最少？列出部件名称。

SQL: SELECT T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_name ORDER BY count(*) ASC LIMIT 1
问题: 在所有参与过的工程师中，哪个工程师的参与次数最少？列出工程师id、名字和姓氏。

SQL: SELECT T1.engineer_id ,  T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id  =  T2.engineer_id GROUP BY T1.engineer_id ORDER BY count(*) ASC LIMIT 1
问题: 哪些员工联系过哪些工程师？列出员工姓名和工程师的名字和姓氏。

SQL: SELECT T1.staff_name ,  T3.first_name ,  T3.last_name FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id  =  T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id  =  T3.engineer_id
问题: 哪一个故障日志包含了最多的故障部件？列出故障日志ID、描述和记录时间。

SQL: SELECT T1.fault_log_entry_id ,  T1.fault_description ,  T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1
问题: 哪种技术能用来修复最多的故障？列出技术ID和描述。

SQL: SELECT T1.skill_id ,  T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id  =  T2.skill_id GROUP BY T1.skill_id ORDER BY count(*) DESC LIMIT 1
问题: 所有不同的资产模型是什么？

SQL: SELECT DISTINCT asset_model FROM Assets
问题: 按处理日期升序列出所有资产的制作、型号、细节。

SQL: SELECT asset_make ,  asset_model ,  asset_details FROM Assets ORDER BY asset_disposed_date ASC
问题: 哪个零件的收费最低？列出零件ID和数量。

SQL: SELECT part_id ,  chargeable_amount FROM Parts ORDER BY chargeable_amount ASC LIMIT 1
问题: 哪家公司最早开始有维修合同？显示公司名称。

SQL: SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id  =  T2.maintenance_contract_company_id ORDER BY T2.contract_start_date ASC LIMIT 1
问题: 最近签订合同的公司的类型描述是什么？

SQL: SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id  =  T2.maintenance_contract_company_id JOIN Ref_Company_Types AS T3 ON T1.company_type_code  =  T3.company_type_code ORDER BY T2.contract_end_date DESC LIMIT 1
问题: 哪种性别占员工的大多数？

SQL: SELECT gender FROM staff GROUP BY gender ORDER BY count(*) DESC LIMIT 1
问题: 每个员工联系了多少工程师？列出进行联系的员工的姓名和联系的工程师的数量。

SQL: SELECT T1.staff_name ,  count(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id  =  T2.contact_staff_id GROUP BY T1.staff_name
问题: 哪些资产没有产生任何故障记录？列出资产模型。

SQL: SELECT asset_model FROM Assets WHERE asset_id NOT IN (SELECT asset_id FROM Fault_Log)
问题: 列出所有车站的地方当局和提供的服务。

SQL: SELECT local_authority ,  services FROM station
问题: 按时间从早到晚的顺序显示所有列车号码和名称。

SQL: SELECT train_number ,  name FROM train ORDER BY TIME
问题: 按照时间排序，给我前往“宿迁”的所有列车的时间和数量。

SQL: SELECT TIME ,  train_number FROM train WHERE destination  =  '宿迁' ORDER BY TIME
问题: 有多少列火车名字中有“列车”？

SQL: SELECT count(*) FROM train WHERE name LIKE "列车"
问题: 找出从“宿迁”到“徐州”的火车的数量和时间。

SQL: SELECT train_number ,  TIME FROM train WHERE origin  =  '宿迁' AND destination  =  '徐州'
问题: 找出每个起点发车的列车数量。

SQL: SELECT origin ,  count(*) FROM train GROUP BY origin
问题: 找到路线经过最多火车站的列车的名称。

SQL: SELECT t1.name FROM train AS t1 JOIN route AS t2 ON t1.id  =  t2.train_id GROUP BY t2.train_id ORDER BY count(*) DESC LIMIT 1
问题: 查找每个站点的火车数量，以及站点网络名称和服务。

SQL: SELECT count(*) ,  t1.network_name ,  t1.services FROM station AS t1 JOIN route AS t2 ON t1.id  =  t2.station_id GROUP BY t2.station_id
问题: 一周每一天的平均气温是多少？

SQL: SELECT avg(high_temperature) ,  day_of_week FROM weekly_weather GROUP BY day_of_week
问题: 请告诉我“湖州”的最高低温和平均降水量。

SQL: SELECT max(t1.low_temperature) ,  avg(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id  =  t2.id WHERE t2.network_name  =  "湖州"
问题: 查找经过属于地方当局为“洛阳”的车站的火车的名称和时间。

SQL: SELECT t3.name ,  t3.time FROM station AS t1 JOIN route AS t2 ON t1.id  =  t2.station_id JOIN train AS t3 ON t2.train_id  =  t3.id WHERE t1.local_authority  =  "洛阳"
问题: 所有车站能提供多少种不同的服务？

SQL: SELECT count(DISTINCT services) FROM station
问题: 查找平均高温最高的车站的id和所属的地方当局。

SQL: SELECT t2.id ,  t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id  =  t2.id GROUP BY t1.station_id ORDER BY avg(high_temperature) DESC LIMIT 1
问题: 查找最大降水量大于50的车站的id和所属的地方当局。

SQL: SELECT t2.id ,  t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id  =  t2.id GROUP BY t1.station_id HAVING max(t1.precipitation)  >  50
问题: 显示最低低温并且以每小时英里数显示最高风速。

SQL: SELECT min(low_temperature) ,  max(wind_speed_mph) FROM weekly_weather
问题: 找出至少有1辆火车出发的起点。

SQL: SELECT origin FROM train GROUP BY origin HAVING count(*)  >  1
问题: 找到“会计学”系的教授人数。

SQL: SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE DEPT_NAME  =  "会计学"
问题: “会计学”系有多少教授？

SQL: SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE DEPT_NAME  =  "会计学"
问题: 有多少教授教代码为“美术”的课程？

SQL: SELECT count(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE  =  "美术"
问题: 有多少教授教的课程代码为“美术”？

SQL: SELECT count(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE  =  "美术"
问题: “生物”系教授的名字和姓氏是什么？

SQL: SELECT T3.EMP_FNAME ,  T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM  =  T3.EMP_NUM WHERE DEPT_NAME  =  "生物学"
问题: 所有“生物”教授的名字和姓氏是什么？

SQL: SELECT T3.EMP_FNAME ,  T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM  =  T3.EMP_NUM WHERE DEPT_NAME  =  "生物学"
问题: 教课程“美术”的教授的姓名和出生日期是什么？

SQL: SELECT DISTINCT T1.EMP_FNAME ,  T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE CRS_CODE  =  "美术"
问题: 负责“ACT211”的教授的名字和出生日期是什么？

SQL: SELECT DISTINCT T1.EMP_FNAME ,  T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE CRS_CODE  =  "美术"
问题: 姓“孙”的教授教多少门课？

SQL: SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE T1.EMP_LNAME  =  '孙'
问题: 姓“孙”的教授总共有多少门课？

SQL: SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE T1.EMP_LNAME  =  '孙'
问题: 会计系所属的学校代码是什么？

SQL: SELECT school_code FROM department WHERE dept_name  =  "会计学"
问题: 会计系的学校代码是什么？

SQL: SELECT school_code FROM department WHERE dept_name  =  "会计学"
问题: 课程“哲学”有多少学分，它的描述是什么？

SQL: SELECT crs_credit ,  crs_description FROM course WHERE crs_code  =  '哲学'
问题: “哲学”的描述是什么，它有多少学分？

SQL: SELECT crs_credit ,  crs_description FROM course WHERE crs_code  =  '哲学'
问题: “旧”系的地址是什么？

SQL: SELECT dept_address FROM department WHERE dept_name  =  '旧'
问题: “旧”系在哪里？

SQL: SELECT dept_address FROM department WHERE dept_name  =  '旧'
问题: 代码为师范的学校有多少个不同的位置？

SQL: SELECT count(DISTINCT dept_address) FROM department WHERE school_code  =  '师范'
问题: 代码为“师范”的学校有多少个不同的位置？

SQL: SELECT count(DISTINCT dept_address) FROM department WHERE school_code  =  '师范'
问题: 每所学校有多少个不同的地方？

SQL: SELECT count(DISTINCT dept_address) ,  school_code FROM department GROUP BY school_code
问题: 计算每个学校的不同地址的数量。

SQL: SELECT count(DISTINCT dept_address) ,  school_code FROM department GROUP BY school_code
问题: 找到“文学”课程的描述和学分。

SQL: SELECT crs_credit ,  crs_description FROM course WHERE crs_code  =  '文学'
问题: “文学”的课程描述和学分是多少？

SQL: SELECT crs_credit ,  crs_description FROM course WHERE crs_code  =  '文学'
问题: 找出每个学校的部门数量。

SQL: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code
问题: 每所学校有多少个部门？

SQL: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code
问题: 找出每所院系数量少于5的学校不同院系的数量。

SQL: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name)  <  5
问题: 每所院系数量少于5的学校有几个不同的系？

SQL: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name)  <  5
问题: 每门课有多少节？

SQL: SELECT count(*) ,  crs_code FROM CLASS GROUP BY crs_code
问题: 每个系提供的总学分是多少？

SQL: SELECT sum(crs_credit) ,  dept_code FROM course GROUP BY dept_code
问题: 每个系提供多少学分？

SQL: SELECT sum(crs_credit) ,  dept_code FROM course GROUP BY dept_code
问题: 查找所有至少有两节课的教室提供的课程数量。

SQL: SELECT count(*) ,  class_room FROM CLASS GROUP BY class_room HAVING count(*)  >=  2
问题: 对于每个至少有2节课的教室，有多少节课？

SQL: SELECT count(*) ,  class_room FROM CLASS GROUP BY class_room HAVING count(*)  >=  2
问题: 找到每个系的课程数量。

SQL: SELECT count(*) ,  dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY dept_code
问题: 每个系有多少节课？

SQL: SELECT count(*) ,  dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY dept_code
问题: 找出每个学校的课程数量。

SQL: SELECT count(*) ,  T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T2.dept_code  =  T3.dept_code GROUP BY T3.school_code
问题: 每所学校有多少课？

SQL: SELECT count(*) ,  T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T2.dept_code  =  T3.dept_code GROUP BY T3.school_code
问题: 不同学校的教授人数是多少？

SQL: SELECT count(*) ,  T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_code
问题: 不同的学校有多少不同的教授？

SQL: SELECT count(*) ,  T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_code
问题: 找到员工最多的工作的代码和员工数量。

SQL: SELECT emp_jobcode ,  count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1
问题: 员工最多的工作的代码和员工数量是什么？

SQL: SELECT emp_jobcode ,  count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1
问题: 哪一所学校教授人数最少？

SQL: SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_code ORDER BY count(*) LIMIT 1
问题: 哪所学校教授最少？

SQL: SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.school_code ORDER BY count(*) LIMIT 1
问题: 找到每个系有“博士”学位的教授。

SQL: SELECT count(*) ,  dept_code FROM professor WHERE prof_high_degree  =  '博士' GROUP BY dept_code
问题: 每个系有多少教授有“博士”学位？

SQL: SELECT count(*) ,  dept_code FROM professor WHERE prof_high_degree  =  '博士' GROUP BY dept_code
问题: 找到每个系的学生人数。

SQL: SELECT count(*) ,  dept_code FROM student GROUP BY dept_code
问题: 每个系有多少学生？

SQL: SELECT count(*) ,  dept_code FROM student GROUP BY dept_code
问题: 找到每个系的所有学生的总学时数。

SQL: SELECT sum(stu_hrs) ,  dept_code FROM student GROUP BY dept_code
问题: 每个系的学生花多少时间学习？

SQL: SELECT sum(stu_hrs) ,  dept_code FROM student GROUP BY dept_code
问题: 找出每个系的所有学生的最大，平均和最小gpa。

SQL: SELECT max(stu_gpa) ,  avg(stu_gpa) ,  min(stu_gpa) ,  dept_code FROM student GROUP BY dept_code
问题: 每个系的最高、最低和平均的学生GPA是多少？

SQL: SELECT max(stu_gpa) ,  avg(stu_gpa) ,  min(stu_gpa) ,  dept_code FROM student GROUP BY dept_code
问题: 学生平均成绩最高的系的名称和平均成绩是多少？

SQL: SELECT T2.dept_name ,  avg(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY avg(T1.stu_gpa) DESC LIMIT 1
问题: 哪个系的学生平均成绩最高，平均成绩是多少？

SQL: SELECT T2.dept_name ,  avg(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY avg(T1.stu_gpa) DESC LIMIT 1
问题: 总共有多少学校？

SQL: SELECT count(DISTINCT school_code) FROM department
问题: 这个系有多少学校？

SQL: SELECT count(DISTINCT school_code) FROM department
问题: 有多少门课？

SQL: SELECT count(DISTINCT class_code) FROM CLASS
问题: 不同的课程有多少？

SQL: SELECT count(DISTINCT class_code) FROM CLASS
问题: 有多少课程？

SQL: SELECT count(DISTINCT crs_code) FROM CLASS
问题: 不同课程代码的数量是多少？

SQL: SELECT count(DISTINCT crs_code) FROM CLASS
问题: 这所学院有多少个系？

SQL: SELECT count(DISTINCT dept_name) FROM department
问题: 有多少个不同的系？

SQL: SELECT count(DISTINCT dept_name) FROM department
问题: “信息系统”系提供了多少门课程？

SQL: SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code  =  T2.dept_code WHERE dept_name  =  "信息系统"
问题: “信息系统”提供了多少门课程？

SQL: SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code  =  T2.dept_code WHERE dept_name  =  "信息系统"
问题: “ACT211”课程有多少节课？

SQL: SELECT count(DISTINCT class_section) FROM CLASS WHERE crs_code  =  '美术'
问题: “ACT-211”课程提供多少节不同的课？

SQL: SELECT count(DISTINCT class_section) FROM CLASS WHERE crs_code  =  '美术'
问题: 找出每个系提供的所有课程的总学分。

SQL: SELECT sum(T1.crs_credit) ,  T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY T1.dept_code
问题: 每个系提供的学分总数是多少？

SQL: SELECT sum(T1.crs_credit) ,  T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY T1.dept_code
问题: 查找提供的所有课程的学分最多的系的名称。

SQL: SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T1.dept_code  =  T3.dept_code GROUP BY T1.dept_code ORDER BY sum(T1.crs_credit) DESC LIMIT 1
问题: 哪个系提供最多的学分？

SQL: SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T1.dept_code  =  T3.dept_code GROUP BY T1.dept_code ORDER BY sum(T1.crs_credit) DESC LIMIT 1
问题: 有多少学生报名上“美术”课？

SQL: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code WHERE T1.crs_code  =  '美术'
问题: 上“美术”课程的学生总数是多少？

SQL: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code WHERE T1.crs_code  =  '美术'
问题: 每个学生上“美术”课程的名字是什么？

SQL: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T2.stu_num  =  T3.stu_num WHERE T1.crs_code  =  '美术'
问题: 所有上“美术”课的学生的名字是什么？

SQL: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T2.stu_num  =  T3.stu_num WHERE T1.crs_code  =  '美术'
问题: 所有上“美术”课而且拿到成绩是“C”的学生的名字是什么？

SQL: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T2.stu_num  =  T3.stu_num WHERE T1.crs_code  =  '美术' AND T2.enroll_grade  =  'C'
问题: 上“美术”课而且成绩“C”的所有学生的名字是什么？

SQL: SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T2.stu_num  =  T3.stu_num WHERE T1.crs_code  =  '美术' AND T2.enroll_grade  =  'C'
问题: 找到员工总数。

SQL: SELECT count(*) FROM employee
问题: 一共有多少员工？

SQL: SELECT count(*) FROM employee
问题: 有多少教授有“博士”学位？

SQL: SELECT count(*) FROM professor WHERE prof_high_degree  =  '博士'
问题: 拥有“博士”学位的教授总数是多少？

SQL: SELECT count(*) FROM professor WHERE prof_high_degree  =  '博士'
问题: 这个班有多少学生上过由会计系的一位教授教的课程？

SQL: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN course AS T3 ON T1.crs_code  =  T3.crs_code JOIN department AS T4 ON T3.dept_code  =  T4.dept_code WHERE T4.dept_name  =  '会计学'
问题: 有多少学生上过由会计教授教的一些课程？

SQL: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN course AS T3 ON T1.crs_code  =  T3.crs_code JOIN department AS T4 ON T3.dept_code  =  T4.dept_code WHERE T4.dept_name  =  '会计学'
问题: 招生人数最多的院系叫什么名字？

SQL: SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN course AS T3 ON T1.crs_code  =  T3.crs_code JOIN department AS T4 ON T3.dept_code  =  T4.dept_code GROUP BY T3.dept_code ORDER BY count(*) DESC LIMIT 1
问题: 招生最多的院系名称是什么？

SQL: SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN course AS T3 ON T1.crs_code  =  T3.crs_code JOIN department AS T4 ON T3.dept_code  =  T4.dept_code GROUP BY T3.dept_code ORDER BY count(*) DESC LIMIT 1
问题: 按照名字顺序列出所有院系的名称。

SQL: SELECT dept_name FROM department ORDER BY dept_name
问题: 按字母顺序排列，所有院系的名称是什么？

SQL: SELECT dept_name FROM department ORDER BY dept_name
问题: 列出“KLR209”教室中上过的所有课程的代码。

SQL: SELECT class_code FROM CLASS WHERE class_room  =  'KLR209'
问题: 教室“KLR209”上过的所有课程的代码是什么？

SQL: SELECT class_code FROM CLASS WHERE class_room  =  'KLR209'
问题: 按出生日期排序，列出所有工作代码为“教授”的员工的姓名。

SQL: SELECT emp_fname FROM employee WHERE emp_jobcode  =  '教授' ORDER BY emp_dob
问题: 按照出生日期排序，所有教授的名字是什么？

SQL: SELECT emp_fname FROM employee WHERE emp_jobcode  =  '教授' ORDER BY emp_dob
问题: 按照教授名字的字母顺序，找出所有教授的名字和办公室。

SQL: SELECT T2.emp_fname ,  T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num  =  T2.emp_num ORDER BY T2.emp_fname
问题: 按姓氏字母顺序排列，所有教授的姓名和办公地点是什么？

SQL: SELECT T2.emp_fname ,  T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num  =  T2.emp_num ORDER BY T2.emp_fname
问题: 最老的员工的名字和姓是什么？

SQL: SELECT emp_fname ,  emp_lname FROM employee ORDER BY emp_dob LIMIT 1
问题: 最早出生的员工的姓名是什么？

SQL: SELECT emp_fname ,  emp_lname FROM employee ORDER BY emp_dob LIMIT 1
问题: GPA在3以上的学生中，最年轻的学生姓名和gpa是什么？

SQL: SELECT stu_fname ,  stu_lname ,  stu_gpa FROM student WHERE stu_gpa  >  3 ORDER BY stu_dob DESC LIMIT 1
问题: GPA高于3的最年轻的学生的名字和姓是什么？他们的GPA是多少？

SQL: SELECT stu_fname ,  stu_lname ,  stu_gpa FROM student WHERE stu_gpa  >  3 ORDER BY stu_dob DESC LIMIT 1
问题: 在任何课程中获得成绩是“C”的学生的名字是什么？

SQL: SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num WHERE enroll_grade  =  'C'
问题: 所有在课程中所有得到成绩是“C”的学生的名字是什么？

SQL: SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num WHERE enroll_grade  =  'C'
问题: 教授最少的院系是什么？

SQL: SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) LIMIT 1
问题: 教授最少的系叫什么名字？

SQL: SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) LIMIT 1
问题: 拥有“博士”学位的教授数量最多的系叫什么名字？

SQL: SELECT T2.dept_name ,  T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE T1.prof_high_degree  =  '博士' GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1
问题: 哪个系有“P博士”学位的教授最多？

SQL: SELECT T2.dept_name ,  T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE T1.prof_high_degree  =  '博士' GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1
问题: 不教课的教授的名字是什么？

SQL: SELECT emp_fname FROM employee WHERE emp_jobcode  =  '教授' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num  =  T2.prof_num
问题: 任何课都不教的教授的名字是什么？

SQL: SELECT emp_fname FROM employee WHERE emp_jobcode  =  '教授' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num  =  T2.prof_num
问题: 历史系不教课的教授的名字是什么？

SQL: SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T3.dept_name  =  '旧' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num  =  T5.prof_num
问题: 那些不教课的历史系教授的名字是什么？

SQL: SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T3.dept_name  =  '旧' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num  =  T5.prof_num
问题: 历史系教授的姓氏和办公室是什么？

SQL: SELECT T1.emp_lname ,  T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T3.dept_name  =  '旧'
问题: 历史系教授的姓氏和办公室在哪里？

SQL: SELECT T1.emp_lname ,  T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T3.dept_name  =  '旧'
问题: 姓“吕”的教授所在的系名和办公室是什么？

SQL: SELECT T3.dept_name  ,  T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T1.emp_lname  =  '吕'
问题: 姓“吕”的教授的系名和办公室是什么？

SQL: SELECT T3.dept_name  ,  T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T1.emp_lname  =  '吕'
问题: 找到办公室在“102号”的教授的姓氏和聘用日期。

SQL: SELECT T1.emp_lname ,  T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num WHERE T2.prof_office  =  '102号'
问题: 办公室设在“102号”的教授姓什么？他们什么时候被聘用的？

SQL: SELECT T1.emp_lname ,  T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num WHERE T2.prof_office  =  '102号'
问题: 姓“李”的学生选修的课程代码是什么？

SQL: SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T3.stu_num  =  T2.stu_num WHERE T3.stu_lname  =  '李'
问题: 姓“李”的学生所上的每堂课的课程代码是什么？

SQL: SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T3.stu_num  =  T2.stu_num WHERE T3.stu_lname  =  '李'
问题: 姓“李”的学生选修的课程的描述和学分是什么？

SQL: SELECT T4.crs_description ,  T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T3.stu_num  =  T2.stu_num JOIN course AS T4 ON T4.crs_code  =  T1.crs_code WHERE T3.stu_lname  =  '李'