jtjt520j/cspider_for_chinese_llama2_1.3b huggingface dataset:
Schema: CREATE TABLE department (departmentID VARCHAR, head VARCHAR)
user: 给出员工数最少的部门的领导的员工id。

assistant: SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;
Schema: CREATE TABLE department (head VARCHAR), CREATE TABLE physician (EmployeeID VARCHAR, name VARCHAR, position VARCHAR)
user: 员工人数最少的部门的负责人的姓名和职位是什么？

assistant: SELECT T2.name ,  T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head  =  T2.EmployeeID GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;
Schema: CREATE TABLE department (head VARCHAR), CREATE TABLE physician (EmployeeID VARCHAR, name VARCHAR, position VARCHAR)
user: 找出雇员最少的部门的负责人的姓名和职位。

assistant: SELECT T2.name ,  T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head  =  T2.EmployeeID GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;
Schema: CREATE TABLE appointment (patient VARCHAR), CREATE TABLE patient (ssn VARCHAR)
user: 预约病人的姓名是什么？

assistant: SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn
Schema: CREATE TABLE appointment (patient VARCHAR), CREATE TABLE patient (ssn VARCHAR)
user: 列出已预约的病人的姓名。

assistant: SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn
Schema: CREATE TABLE appointment (patient VARCHAR), CREATE TABLE patient (ssn VARCHAR)
user: 有超过一次预约的病人的姓名和电话号码是多少？

assistant: SELECT name ,  phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn GROUP BY T1.patient HAVING count(*)  >  1
Schema: CREATE TABLE appointment (patient VARCHAR), CREATE TABLE patient (ssn VARCHAR)
user: 哪个病人预约不止一次？给出这些病人的姓名和电话号码。

assistant: SELECT name ,  phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn GROUP BY T1.patient HAVING count(*)  >  1
Schema: CREATE TABLE appointment (appointmentid VARCHAR, START VARCHAR)
user: 找到在最近开始日期的预约的ID？

assistant: SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1
Schema: CREATE TABLE appointment (appointmentid VARCHAR, START VARCHAR)
user: 最近开始的预约的ID是什么？

assistant: SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1
Schema: CREATE TABLE appointment (Physician VARCHAR), CREATE TABLE physician (EmployeeID VARCHAR, name VARCHAR)
user: 列出一些预约医生的名字。

assistant: SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
Schema: CREATE TABLE appointment (Physician VARCHAR), CREATE TABLE physician (EmployeeID VARCHAR, name VARCHAR)
user: 所有有预约的医生的名字是什么？

assistant: SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
Schema: CREATE TABLE physician (EmployeeID VARCHAR, name VARCHAR), CREATE TABLE appointment (Physician VARCHAR)
user: 列出从来没有任何预约的医生的名字。

assistant: SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
Schema: CREATE TABLE physician (EmployeeID VARCHAR, name VARCHAR), CREATE TABLE appointment (Physician VARCHAR)
user: 哪些医生从来没有预约过？找出他们的名字。

assistant: SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
Schema: CREATE TABLE physician (EmployeeID VARCHAR, name VARCHAR), CREATE TABLE affiliated_with (PrimaryAffiliation VARCHAR, physician VARCHAR, department VARCHAR), CREATE TABLE department (DepartmentID VARCHAR, name VARCHAR)
user: 找出所有医师的姓名及其主要附属部门的名称。

assistant: SELECT T1.name ,  T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T2.PrimaryAffiliation  =  1
Schema: CREATE TABLE physician (EmployeeID VARCHAR, name VARCHAR), CREATE TABLE affiliated_with (PrimaryAffiliation VARCHAR, physician VARCHAR, department VARCHAR), CREATE TABLE department (DepartmentID VARCHAR, name VARCHAR)
user: 每个医生的名字和主要附属部门的名称是什么？

assistant: SELECT T1.name ,  T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T2.PrimaryAffiliation  =  1
Schema: CREATE TABLE patient (name VARCHAR, ssn VARCHAR), CREATE TABLE appointment (patient VARCHAR, start VARCHAR)
user: 最近一次预约的病人叫什么名字？

assistant: SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1
Schema: CREATE TABLE patient (name VARCHAR, ssn VARCHAR), CREATE TABLE appointment (patient VARCHAR, start VARCHAR)
user: 查找最近一次预约的病人的名字。

assistant: SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1
Schema: CREATE TABLE stay (room VARCHAR, patient VARCHAR)
user: 有多少病人住在112房间？

assistant: SELECT count(patient) FROM stay WHERE room  =  112
Schema: CREATE TABLE stay (room VARCHAR, patient VARCHAR)
user: 统计住112房间的病人的数量。

assistant: SELECT count(patient) FROM stay WHERE room  =  112
Schema: CREATE TABLE patient (SSN VARCHAR), CREATE TABLE prescribes (physician VARCHAR, patient VARCHAR), CREATE TABLE physician (employeeid VARCHAR, name VARCHAR)
user: “王涛”医生开了多少病人处方？

assistant: SELECT count(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN  =  T2.patient JOIN physician AS T3 ON T2.physician  =  T3.employeeid WHERE T3.name = "王涛"
Schema: CREATE TABLE patient (SSN VARCHAR), CREATE TABLE prescribes (physician VARCHAR, patient VARCHAR), CREATE TABLE physician (employeeid VARCHAR, name VARCHAR)
user: 找到“王涛”医生开的病人的处方数。

assistant: SELECT count(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN  =  T2.patient JOIN physician AS T3 ON T2.physician  =  T3.employeeid WHERE T3.name = "王涛"
Schema: CREATE TABLE stay (Patient VARCHAR), CREATE TABLE patient (SSN VARCHAR), CREATE TABLE Prescribes (Patient VARCHAR, Medication VARCHAR), CREATE TABLE Medication (Code VARCHAR, name VARCHAR)
user: 找出在111号病房住院的病人用药的名称。

assistant: SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient  =  T2.SSN JOIN Prescribes AS T3 ON T3.Patient  =  T2.SSN JOIN Medication AS T4 ON T3.Medication  =  T4.Code WHERE room  =  111
Schema: CREATE TABLE stay (Patient VARCHAR), CREATE TABLE patient (SSN VARCHAR), CREATE TABLE Prescribes (Patient VARCHAR, Medication VARCHAR), CREATE TABLE Medication (Code VARCHAR, name VARCHAR)
user: 在111房间住的病人使用的药物名称是什么？

assistant: SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient  =  T2.SSN JOIN Prescribes AS T3 ON T3.Patient  =  T2.SSN JOIN Medication AS T4 ON T3.Medication  =  T4.Code WHERE room  =  111
Schema: CREATE TABLE stay (room VARCHAR, patient VARCHAR, staystart VARCHAR)
user: 找到最近一次住在111房间的病人。

assistant: SELECT patient FROM stay WHERE room  =  111 ORDER BY staystart DESC LIMIT 1
Schema: CREATE TABLE stay (room VARCHAR, patient VARCHAR, staystart VARCHAR)
user: 最近住在111房间的病人的id是什么？

assistant: SELECT patient FROM stay WHERE room  =  111 ORDER BY staystart DESC LIMIT 1
Schema: CREATE TABLE nurse (employeeid VARCHAR, name VARCHAR), CREATE TABLE appointment (prepnurse VARCHAR)
user: 又最多预约的护士的名字的是什么？

assistant: SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid  =  T2.prepnurse GROUP BY T1.employeeid ORDER BY count(*) DESC LIMIT 1
Schema: CREATE TABLE nurse (employeeid VARCHAR, name VARCHAR), CREATE TABLE appointment (prepnurse VARCHAR)
user: 找出预约数量最多的护士的名字。

assistant: SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid  =  T2.prepnurse GROUP BY T1.employeeid ORDER BY count(*) DESC LIMIT 1
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE patient (PCP VARCHAR)
user: 每个医生要照顾多少病人？列出他们照顾的病人的姓名和数量。

assistant: SELECT T1.name ,  count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE patient (PCP VARCHAR)
user: 返回每个医生的名字和他或她治疗的病人的数量。

assistant: SELECT T1.name ,  count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE patient (PCP VARCHAR)
user: 找到负责一个以上病人的医生的名字。

assistant: SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid HAVING count(*)  >  1
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE patient (PCP VARCHAR)
user: 哪个医生负责一个以上的病人？给出他们的名字。

assistant: SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid HAVING count(*)  >  1
Schema: CREATE TABLE BLOCK (blockcode VARCHAR, blockfloor VARCHAR), CREATE TABLE room (blockcode VARCHAR, blockfloor VARCHAR)
user: 找出每个街区楼层的房间数量。

assistant: SELECT count(*) ,  T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor  =  T2.blockfloor AND T1.blockcode  =  T2.blockcode GROUP BY T1.blockfloor
Schema: CREATE TABLE BLOCK (blockcode VARCHAR, blockfloor VARCHAR), CREATE TABLE room (blockcode VARCHAR, blockfloor VARCHAR)
user: 每个楼层有多少个房间？

assistant: SELECT count(*) ,  T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor  =  T2.blockfloor AND T1.blockcode  =  T2.blockcode GROUP BY T1.blockfloor
Schema: CREATE TABLE BLOCK (blockcode VARCHAR, blockfloor VARCHAR), CREATE TABLE room (blockcode VARCHAR, blockfloor VARCHAR)
user: 查找不同区域代码的房间数。

assistant: SELECT count(*) ,  T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor  =  T2.blockfloor AND T1.blockcode  =  T2.blockcode GROUP BY T1.blockcode
Schema: CREATE TABLE BLOCK (blockcode VARCHAR, blockfloor VARCHAR), CREATE TABLE room (blockcode VARCHAR, blockfloor VARCHAR)
user: 每个区域代码有多少个房间？

assistant: SELECT count(*) ,  T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor  =  T2.blockfloor AND T1.blockcode  =  T2.blockcode GROUP BY T1.blockcode
Schema: CREATE TABLE room (blockcode VARCHAR, unavailable VARCHAR)
user: 唯一有可用的房间的区域代码是什么？

assistant: SELECT DISTINCT blockcode FROM room WHERE unavailable  =  0
Schema: CREATE TABLE room (blockcode VARCHAR, unavailable VARCHAR)
user: 给出一些有可用房间的不同的区块代码。

assistant: SELECT DISTINCT blockcode FROM room WHERE unavailable  =  0
Schema: CREATE TABLE room (roomtype VARCHAR)
user: 有多少种不同类型的房间？

assistant: SELECT count(DISTINCT roomtype) FROM room
Schema: CREATE TABLE room (roomtype VARCHAR)
user: 找到可用的不同房间类型的数量。

assistant: SELECT count(DISTINCT roomtype) FROM room
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE prescribes (physician VARCHAR, medication VARCHAR), CREATE TABLE medication (name VARCHAR, code VARCHAR)
user: 开出处方药品“感冒灵”的医生叫什么名字？

assistant: SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name  =  "感冒灵"
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE prescribes (physician VARCHAR, medication VARCHAR), CREATE TABLE medication (name VARCHAR, code VARCHAR)
user: 列出开出处方药品“感冒灵”的医生的名字。

assistant: SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name  =  "感冒灵"
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR, position VARCHAR), CREATE TABLE prescribes (physician VARCHAR, medication VARCHAR), CREATE TABLE medication (code VARCHAR, Brand VARCHAR)
user: 找出开出药物的品牌是“X”的医生的名字和位置？

assistant: SELECT DISTINCT T1.name ,  T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand  =  "X"
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR, position VARCHAR), CREATE TABLE prescribes (physician VARCHAR, medication VARCHAR), CREATE TABLE medication (code VARCHAR, Brand VARCHAR)
user: 哪些医生开了“X”品牌的药物？给出那些医生的名字和位置。

assistant: SELECT DISTINCT T1.name ,  T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand  =  "X"
Schema: CREATE TABLE medication (brand VARCHAR, name VARCHAR, code VARCHAR), CREATE TABLE prescribes (medication VARCHAR)
user: 找出每种牌子可开处方的药品数量。

assistant: SELECT count(*) ,  T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand
Schema: CREATE TABLE medication (brand VARCHAR, name VARCHAR, code VARCHAR), CREATE TABLE prescribes (medication VARCHAR)
user: 每个牌子可开处方的药有多少？

assistant: SELECT count(*) ,  T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand
Schema: CREATE TABLE physician (POSITION VARCHAR, name VARCHAR)
user: 找出头衔包含“高级”一词的医生的名字。

assistant: SELECT name FROM physician WHERE POSITION LIKE '高级'
Schema: CREATE TABLE physician (POSITION VARCHAR, name VARCHAR)
user: 头衔包含“高级”一词的医生的名字是什么？

assistant: SELECT name FROM physician WHERE POSITION LIKE '高级'
Schema: CREATE TABLE undergoes (patient VARCHAR, dateundergoes VARCHAR)
user: 找出最近接受治疗的病人。

assistant: SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1
Schema: CREATE TABLE undergoes (patient VARCHAR, dateundergoes VARCHAR)
user: 哪个病人最近正在接受最新的治疗？

assistant: SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1
Schema: CREATE TABLE undergoes (Stay VARCHAR, patient VARCHAR), CREATE TABLE patient (SSN VARCHAR, name VARCHAR), CREATE TABLE stay (StayID VARCHAR, room VARCHAR)
user: 查找所有正在接受治疗并住在111号房间的患者的姓名。

assistant: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay  =  T3.StayID WHERE T3.room  =  111
Schema: CREATE TABLE undergoes (Stay VARCHAR, patient VARCHAR), CREATE TABLE patient (SSN VARCHAR, name VARCHAR), CREATE TABLE stay (StayID VARCHAR, room VARCHAR)
user: 住在111号房间并正在接受治疗的病人的名字是什么？

assistant: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay  =  T3.StayID WHERE T3.room  =  111
Schema: CREATE TABLE nurse (name VARCHAR)
user: 列出按字母顺序排列的所有护士的名字？

assistant: SELECT DISTINCT name FROM nurse ORDER BY name
Schema: CREATE TABLE nurse (name VARCHAR)
user: 按字母顺序排序的护士名字是什么？

assistant: SELECT DISTINCT name FROM nurse ORDER BY name
Schema: CREATE TABLE undergoes (AssistingNurse VARCHAR), CREATE TABLE nurse (EmployeeID VARCHAR, name VARCHAR)
user: 找到护士正在接受治疗的名字。

assistant: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse  =  T2.EmployeeID
Schema: CREATE TABLE undergoes (AssistingNurse VARCHAR), CREATE TABLE nurse (EmployeeID VARCHAR, name VARCHAR)
user: 哪些护士负责正在治疗的病人？

assistant: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse  =  T2.EmployeeID
Schema: CREATE TABLE medication (name VARCHAR)
user: 按字母顺序列出所有不同药物的名称。

assistant: SELECT DISTINCT name FROM medication ORDER BY name
Schema: CREATE TABLE medication (name VARCHAR)
user: 字母顺序列出的所有不同的药物是什么？

assistant: SELECT DISTINCT name FROM medication ORDER BY name
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE prescribes (dose VARCHAR, physician VARCHAR)
user: 处方量最高的医生叫什么名字？

assistant: SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE prescribes (dose VARCHAR, physician VARCHAR)
user: 找处处方剂量最高的医的名字。

assistant: SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1
Schema: CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR, primaryaffiliation VARCHAR)
user: 列出医生的员工id及其主要附属部门的id。

assistant: SELECT physician ,  department FROM affiliated_with WHERE primaryaffiliation  =  1
Schema: CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR, primaryaffiliation VARCHAR)
user: 每个医生的员工ID和主要附属部门ID是什么。

assistant: SELECT physician ,  department FROM affiliated_with WHERE primaryaffiliation  =  1
Schema: CREATE TABLE affiliated_with (department VARCHAR), CREATE TABLE department (name VARCHAR, departmentid VARCHAR)
user: 列出一些医生的主要隶属的部门的名称。

assistant: SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation  =  1
Schema: CREATE TABLE affiliated_with (department VARCHAR), CREATE TABLE department (name VARCHAR, departmentid VARCHAR)
user: 一些医生的主要隶属的部门的名称是什么？

assistant: SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation  =  1
Schema: CREATE TABLE on_call (blockfloor VARCHAR, nurse VARCHAR, blockcode VARCHAR)
user: 哪些护士在1号楼和区域编码是1的位置值班？给出他们的名字。

assistant: SELECT nurse FROM on_call WHERE blockfloor  =  1 AND blockcode  =  1
Schema: CREATE TABLE on_call (blockfloor VARCHAR, nurse VARCHAR, blockcode VARCHAR)
user: 找出在1号楼和区域编码是1的位置值班的护士的id。

assistant: SELECT nurse FROM on_call WHERE blockfloor  =  1 AND blockcode  =  1
Schema: CREATE TABLE procedures (cost INTEGER)
user: 手术的最高花费，最低花费和平均花费是什么？

assistant: SELECT MAX(cost) ,  MIN(cost) ,  AVG(cost) FROM procedures
Schema: CREATE TABLE procedures (cost INTEGER)
user: 给出手术的最高、最低和平均的花费。

assistant: SELECT MAX(cost) ,  MIN(cost) ,  AVG(cost) FROM procedures
Schema: CREATE TABLE procedures (cost VARCHAR, name VARCHAR)
user: 列出按费用从最高到最低排序的所有手术的名称和花费。

assistant: SELECT name ,  cost FROM procedures ORDER BY cost DESC
Schema: CREATE TABLE procedures (cost VARCHAR, name VARCHAR)
user: 按照费用的降序对所有手术的名称和花费进行排序。

assistant: SELECT name ,  cost FROM procedures ORDER BY cost DESC
Schema: CREATE TABLE procedures (cost VARCHAR, name VARCHAR)
user: 找出三个最昂贵的手术。

assistant: SELECT name FROM procedures ORDER BY cost LIMIT 3
Schema: CREATE TABLE procedures (cost VARCHAR, name VARCHAR)
user: 三个最昂贵的手术是什么？

assistant: SELECT name FROM procedures ORDER BY cost LIMIT 3
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR), CREATE TABLE procedures (cost INTEGER, code VARCHAR)
user: 找到那些花费5000以上的费用执行手术的医生。

assistant: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T3.cost  >  5000
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR), CREATE TABLE procedures (cost INTEGER, code VARCHAR)
user: 哪些医生花费5000以上的费用才能执行手术？

assistant: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T3.cost  >  5000
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR), CREATE TABLE procedures (cost VARCHAR, code VARCHAR)
user: 找出执行手术最昂贵的医生。

assistant: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment ORDER BY T3.cost DESC LIMIT 1
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR), CREATE TABLE procedures (cost VARCHAR, code VARCHAR)
user: 哪个医生执行过的手术最昂贵。

assistant: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment ORDER BY T3.cost DESC LIMIT 1
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR), CREATE TABLE procedures (cost INTEGER, code VARCHAR)
user: 医师“文翰”执行手术的平均费用是多少？

assistant: SELECT avg(T3.cost) FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "文翰"
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR), CREATE TABLE procedures (cost INTEGER, code VARCHAR)
user: 计算医师“文翰”执行手术的平均价格。

assistant: SELECT avg(T3.cost) FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "文翰"
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR), CREATE TABLE procedures (name VARCHAR, code VARCHAR)
user: 找出医师“文翰”执行手术的名称。

assistant: SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "文翰"
Schema: CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR), CREATE TABLE procedures (name VARCHAR, code VARCHAR)
user: 医师“文翰”执行手术的名称是什么？

assistant: SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "文翰"
Schema: CREATE TABLE procedures (name VARCHAR, code VARCHAR), CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR)
user: 找出所有花费超过1000英镑的手术或是医师“文翰”执行的手术。

assistant: SELECT name FROM procedures WHERE cost  >  1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "文翰"
Schema: CREATE TABLE procedures (name VARCHAR, code VARCHAR), CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR)
user: 所有花费超过1000英镑的手术或是医师“文翰”执行的手术有哪些？

assistant: SELECT name FROM procedures WHERE cost  >  1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "文翰"
Schema: CREATE TABLE procedures (name VARCHAR, code VARCHAR), CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR)
user: 找出所有花费超过1000英镑的手术但不是医师“文翰”执行的手术的名字？

assistant: SELECT name FROM procedures WHERE cost  >  1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "文翰"
Schema: CREATE TABLE procedures (name VARCHAR, code VARCHAR), CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR)
user: 所有花费超过1000英镑的手术但不是医师“文翰”执行的手术的名字是什么？

assistant: SELECT name FROM procedures WHERE cost  >  1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "文翰"
Schema: CREATE TABLE procedures (name VARCHAR, code VARCHAR), CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR)
user: 找出所有花费少于5000英镑的且是医师“文翰”执行的手术。

assistant: SELECT name FROM procedures WHERE cost  <  5000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "文翰"
Schema: CREATE TABLE procedures (name VARCHAR, code VARCHAR), CREATE TABLE physician (employeeid VARCHAR, name VARCHAR), CREATE TABLE trained_in (treatment VARCHAR, physician VARCHAR)
user: 所有花费少于5000英镑的且是医师“文翰”执行的手术有哪些？

assistant: SELECT name FROM procedures WHERE cost  <  5000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "文翰"
Schema: CREATE TABLE physician (EmployeeID VARCHAR, name VARCHAR), CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR), CREATE TABLE department (DepartmentID VARCHAR, name VARCHAR)
user: 查找既属于“外科”科又属于“精神科”科的医生的姓名。

assistant: SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  '外科' INTERSECT SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  '精神科'