[ [ { "query": "SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;", "utterances": [ "Find the department with the most employees." ], "turn_idx": -1, "db_id": "hospital_1", "db_path": "./data\\downloads\\extracted\\79d0e486c5243a22086f51c2c2151de89eb505039b4aae9698b5ccf8b312ffd6/sparc/database", "db_table_names": [ "Physician", "Department", "Affiliated_With", "Procedures", "Trained_In", "Patient", "Nurse", "Appointment", "Medication", "Prescribes", "Block", "Room", "On_Call", "Stay", "Undergoes" ], "db_column_names": { "table_id": [ -1, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14 ], "column_name": [ "*", "EmployeeID", "Name", "Position", "SSN", "DepartmentID", "Name", "Head", "Physician", "Department", "PrimaryAffiliation", "Code", "Name", "Cost", "Physician", "Treatment", "CertificationDate", "CertificationExpires", "SSN", "Name", "Address", "Phone", "InsuranceID", "PCP", "EmployeeID", "Name", "Position", "Registered", "SSN", "AppointmentID", "Patient", "PrepNurse", "Physician", "Start", "End", "ExaminationRoom", "Code", "Name", "Brand", "Description", "Physician", "Patient", "Medication", "Date", "Appointment", "Dose", "BlockFloor", "BlockCode", "RoomNumber", "RoomType", "BlockFloor", "BlockCode", "Unavailable", "Nurse", "BlockFloor", "BlockCode", "OnCallStart", "OnCallEnd", "StayID", "Patient", "Room", "StayStart", "StayEnd", "Patient", "Procedures", "Stay", "DateUndergoes", "Physician", "AssistingNurse" ] }, "db_column_types": [ "text", "number", "text", "text", "number", "number", "text", "number", "number", "number", "boolean", "number", "text", "number", "number", "number", "time", "time", "number", "text", "text", "text", "number", "number", "number", "text", "text", "boolean", "number", "number", "number", "number", "number", "time", "time", "text", "number", "text", "text", "text", "number", "number", "number", "time", "number", "text", "number", "number", "number", "text", "number", "number", "boolean", "number", "number", "number", "time", "time", "number", "number", "number", "time", "time", "number", "number", "number", "time", "number", "number" ], "db_primary_keys": { "column_id": [ 1, 5, 8, 11, 14, 18, 24, 29, 36, 40, 46, 48, 53, 58, 63 ] }, "db_foreign_keys": { "column_id": [ 7, 9, 8, 15, 14, 23, 32, 31, 30, 44, 42, 41, 40, 50, 51, 54, 55, 53, 60, 59, 68, 67, 65, 64, 63 ], "other_column_id": [ 1, 5, 1, 11, 1, 1, 1, 24, 18, 29, 36, 18, 1, 46, 47, 46, 47, 24, 48, 18, 24, 1, 58, 11, 18 ] }, "serialized_schema": " | hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "struct_in": "| hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "text_in": "Find the department with the most employees.", "seq_out": "select name from department group by departmentid order by count(departmentid) desc limit 1;" } ], [ { "query": "SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;", "utterances": [ "Tell me the employee id of the head of the department with the least employees." ], "turn_idx": -1, "db_id": "hospital_1", "db_path": "./data\\downloads\\extracted\\79d0e486c5243a22086f51c2c2151de89eb505039b4aae9698b5ccf8b312ffd6/sparc/database", "db_table_names": [ "Physician", "Department", "Affiliated_With", "Procedures", "Trained_In", "Patient", "Nurse", "Appointment", "Medication", "Prescribes", "Block", "Room", "On_Call", "Stay", "Undergoes" ], "db_column_names": { "table_id": [ -1, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14 ], "column_name": [ "*", "EmployeeID", "Name", "Position", "SSN", "DepartmentID", "Name", "Head", "Physician", "Department", "PrimaryAffiliation", "Code", "Name", "Cost", "Physician", "Treatment", "CertificationDate", "CertificationExpires", "SSN", "Name", "Address", "Phone", "InsuranceID", "PCP", "EmployeeID", "Name", "Position", "Registered", "SSN", "AppointmentID", "Patient", "PrepNurse", "Physician", "Start", "End", "ExaminationRoom", "Code", "Name", "Brand", "Description", "Physician", "Patient", "Medication", "Date", "Appointment", "Dose", "BlockFloor", "BlockCode", "RoomNumber", "RoomType", "BlockFloor", "BlockCode", "Unavailable", "Nurse", "BlockFloor", "BlockCode", "OnCallStart", "OnCallEnd", "StayID", "Patient", "Room", "StayStart", "StayEnd", "Patient", "Procedures", "Stay", "DateUndergoes", "Physician", "AssistingNurse" ] }, "db_column_types": [ "text", "number", "text", "text", "number", "number", "text", "number", "number", "number", "boolean", "number", "text", "number", "number", "number", "time", "time", "number", "text", "text", "text", "number", "number", "number", "text", "text", "boolean", "number", "number", "number", "number", "number", "time", "time", "text", "number", "text", "text", "text", "number", "number", "number", "time", "number", "text", "number", "number", "number", "text", "number", "number", "boolean", "number", "number", "number", "time", "time", "number", "number", "number", "time", "time", "number", "number", "number", "time", "number", "number" ], "db_primary_keys": { "column_id": [ 1, 5, 8, 11, 14, 18, 24, 29, 36, 40, 46, 48, 53, 58, 63 ] }, "db_foreign_keys": { "column_id": [ 7, 9, 8, 15, 14, 23, 32, 31, 30, 44, 42, 41, 40, 50, 51, 54, 55, 53, 60, 59, 68, 67, 65, 64, 63 ], "other_column_id": [ 1, 5, 1, 11, 1, 1, 1, 24, 18, 29, 36, 18, 1, 46, 47, 46, 47, 24, 48, 18, 24, 1, 58, 11, 18 ] }, "serialized_schema": " | hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "struct_in": "| hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "text_in": "Tell me the employee id of the head of the department with the least employees.", "seq_out": "select head from department group by departmentid order by count(departmentid) limit 1;" } ], [ { "query": "SELECT count(departmentID) FROM department GROUP BY departmentID", "utterances": [ "What is the number of employees in each department?" ], "turn_idx": 0, "db_id": "hospital_1", "db_path": "./data\\downloads\\extracted\\79d0e486c5243a22086f51c2c2151de89eb505039b4aae9698b5ccf8b312ffd6/sparc/database", "db_table_names": [ "Physician", "Department", "Affiliated_With", "Procedures", "Trained_In", "Patient", "Nurse", "Appointment", "Medication", "Prescribes", "Block", "Room", "On_Call", "Stay", "Undergoes" ], "db_column_names": { "table_id": [ -1, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14 ], "column_name": [ "*", "EmployeeID", "Name", "Position", "SSN", "DepartmentID", "Name", "Head", "Physician", "Department", "PrimaryAffiliation", "Code", "Name", "Cost", "Physician", "Treatment", "CertificationDate", "CertificationExpires", "SSN", "Name", "Address", "Phone", "InsuranceID", "PCP", "EmployeeID", "Name", "Position", "Registered", "SSN", "AppointmentID", "Patient", "PrepNurse", "Physician", "Start", "End", "ExaminationRoom", "Code", "Name", "Brand", "Description", "Physician", "Patient", "Medication", "Date", "Appointment", "Dose", "BlockFloor", "BlockCode", "RoomNumber", "RoomType", "BlockFloor", "BlockCode", "Unavailable", "Nurse", "BlockFloor", "BlockCode", "OnCallStart", "OnCallEnd", "StayID", "Patient", "Room", "StayStart", "StayEnd", "Patient", "Procedures", "Stay", "DateUndergoes", "Physician", "AssistingNurse" ] }, "db_column_types": [ "text", "number", "text", "text", "number", "number", "text", "number", "number", "number", "boolean", "number", "text", "number", "number", "number", "time", "time", "number", "text", "text", "text", "number", "number", "number", "text", "text", "boolean", "number", "number", "number", "number", "number", "time", "time", "text", "number", "text", "text", "text", "number", "number", "number", "time", "number", "text", "number", "number", "number", "text", "number", "number", "boolean", "number", "number", "number", "time", "time", "number", "number", "number", "time", "time", "number", "number", "number", "time", "number", "number" ], "db_primary_keys": { "column_id": [ 1, 5, 8, 11, 14, 18, 24, 29, 36, 40, 46, 48, 53, 58, 63 ] }, "db_foreign_keys": { "column_id": [ 7, 9, 8, 15, 14, 23, 32, 31, 30, 44, 42, 41, 40, 50, 51, 54, 55, 53, 60, 59, 68, 67, 65, 64, 63 ], "other_column_id": [ 1, 5, 1, 11, 1, 1, 1, 24, 18, 29, 36, 18, 1, 46, 47, 46, 47, 24, 48, 18, 24, 1, 58, 11, 18 ] }, "serialized_schema": " | hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "struct_in": "| hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "text_in": "What is the number of employees in each department?", "seq_out": "select count(departmentid) from department group by departmentid" }, { "query": "SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;", "utterances": [ "What is the number of employees in each department?", "Which department has the most employees? Give me the department name." ], "turn_idx": 1, "db_id": "hospital_1", "db_path": "./data\\downloads\\extracted\\79d0e486c5243a22086f51c2c2151de89eb505039b4aae9698b5ccf8b312ffd6/sparc/database", "db_table_names": [ "Physician", "Department", "Affiliated_With", "Procedures", "Trained_In", "Patient", "Nurse", "Appointment", "Medication", "Prescribes", "Block", "Room", "On_Call", "Stay", "Undergoes" ], "db_column_names": { "table_id": [ -1, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14 ], "column_name": [ "*", "EmployeeID", "Name", "Position", "SSN", "DepartmentID", "Name", "Head", "Physician", "Department", "PrimaryAffiliation", "Code", "Name", "Cost", "Physician", "Treatment", "CertificationDate", "CertificationExpires", "SSN", "Name", "Address", "Phone", "InsuranceID", "PCP", "EmployeeID", "Name", "Position", "Registered", "SSN", "AppointmentID", "Patient", "PrepNurse", "Physician", "Start", "End", "ExaminationRoom", "Code", "Name", "Brand", "Description", "Physician", "Patient", "Medication", "Date", "Appointment", "Dose", "BlockFloor", "BlockCode", "RoomNumber", "RoomType", "BlockFloor", "BlockCode", "Unavailable", "Nurse", "BlockFloor", "BlockCode", "OnCallStart", "OnCallEnd", "StayID", "Patient", "Room", "StayStart", "StayEnd", "Patient", "Procedures", "Stay", "DateUndergoes", "Physician", "AssistingNurse" ] }, "db_column_types": [ "text", "number", "text", "text", "number", "number", "text", "number", "number", "number", "boolean", "number", "text", "number", "number", "number", "time", "time", "number", "text", "text", "text", "number", "number", "number", "text", "text", "boolean", "number", "number", "number", "number", "number", "time", "time", "text", "number", "text", "text", "text", "number", "number", "number", "time", "number", "text", "number", "number", "number", "text", "number", "number", "boolean", "number", "number", "number", "time", "time", "number", "number", "number", "time", "time", "number", "number", "number", "time", "number", "number" ], "db_primary_keys": { "column_id": [ 1, 5, 8, 11, 14, 18, 24, 29, 36, 40, 46, 48, 53, 58, 63 ] }, "db_foreign_keys": { "column_id": [ 7, 9, 8, 15, 14, 23, 32, 31, 30, 44, 42, 41, 40, 50, 51, 54, 55, 53, 60, 59, 68, 67, 65, 64, 63 ], "other_column_id": [ 1, 5, 1, 11, 1, 1, 1, 24, 18, 29, 36, 18, 1, 46, 47, 46, 47, 24, 48, 18, 24, 1, 58, 11, 18 ] }, "serialized_schema": " | hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "struct_in": "| hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "text_in": "Which department has the most employees? Give me the department name. || What is the number of employees in each department?", "seq_out": "select name from department group by departmentid order by count(departmentid) desc limit 1;" } ], [ { "query": "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;", "utterances": [ "Find the name and position of the head of the department with the least employees." ], "turn_idx": -1, "db_id": "hospital_1", "db_path": "./data\\downloads\\extracted\\79d0e486c5243a22086f51c2c2151de89eb505039b4aae9698b5ccf8b312ffd6/sparc/database", "db_table_names": [ "Physician", "Department", "Affiliated_With", "Procedures", "Trained_In", "Patient", "Nurse", "Appointment", "Medication", "Prescribes", "Block", "Room", "On_Call", "Stay", "Undergoes" ], "db_column_names": { "table_id": [ -1, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14 ], "column_name": [ "*", "EmployeeID", "Name", "Position", "SSN", "DepartmentID", "Name", "Head", "Physician", "Department", "PrimaryAffiliation", "Code", "Name", "Cost", "Physician", "Treatment", "CertificationDate", "CertificationExpires", "SSN", "Name", "Address", "Phone", "InsuranceID", "PCP", "EmployeeID", "Name", "Position", "Registered", "SSN", "AppointmentID", "Patient", "PrepNurse", "Physician", "Start", "End", "ExaminationRoom", "Code", "Name", "Brand", "Description", "Physician", "Patient", "Medication", "Date", "Appointment", "Dose", "BlockFloor", "BlockCode", "RoomNumber", "RoomType", "BlockFloor", "BlockCode", "Unavailable", "Nurse", "BlockFloor", "BlockCode", "OnCallStart", "OnCallEnd", "StayID", "Patient", "Room", "StayStart", "StayEnd", "Patient", "Procedures", "Stay", "DateUndergoes", "Physician", "AssistingNurse" ] }, "db_column_types": [ "text", "number", "text", "text", "number", "number", "text", "number", "number", "number", "boolean", "number", "text", "number", "number", "number", "time", "time", "number", "text", "text", "text", "number", "number", "number", "text", "text", "boolean", "number", "number", "number", "number", "number", "time", "time", "text", "number", "text", "text", "text", "number", "number", "number", "time", "number", "text", "number", "number", "number", "text", "number", "number", "boolean", "number", "number", "number", "time", "time", "number", "number", "number", "time", "time", "number", "number", "number", "time", "number", "number" ], "db_primary_keys": { "column_id": [ 1, 5, 8, 11, 14, 18, 24, 29, 36, 40, 46, 48, 53, 58, 63 ] }, "db_foreign_keys": { "column_id": [ 7, 9, 8, 15, 14, 23, 32, 31, 30, 44, 42, 41, 40, 50, 51, 54, 55, 53, 60, 59, 68, 67, 65, 64, 63 ], "other_column_id": [ 1, 5, 1, 11, 1, 1, 1, 24, 18, 29, 36, 18, 1, 46, 47, 46, 47, 24, 48, 18, 24, 1, 58, 11, 18 ] }, "serialized_schema": " | hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "struct_in": "| hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "text_in": "Find the name and position of the head of the department with the least employees.", "seq_out": "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;" } ], [ { "query": "SELECT count(departmentID) FROM department GROUP BY departmentID", "utterances": [ "How many employees does each department have?" ], "turn_idx": 0, "db_id": "hospital_1", "db_path": "./data\\downloads\\extracted\\79d0e486c5243a22086f51c2c2151de89eb505039b4aae9698b5ccf8b312ffd6/sparc/database", "db_table_names": [ "Physician", "Department", "Affiliated_With", "Procedures", "Trained_In", "Patient", "Nurse", "Appointment", "Medication", "Prescribes", "Block", "Room", "On_Call", "Stay", "Undergoes" ], "db_column_names": { "table_id": [ -1, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14 ], "column_name": [ "*", "EmployeeID", "Name", "Position", "SSN", "DepartmentID", "Name", "Head", "Physician", "Department", "PrimaryAffiliation", "Code", "Name", "Cost", "Physician", "Treatment", "CertificationDate", "CertificationExpires", "SSN", "Name", "Address", "Phone", "InsuranceID", "PCP", "EmployeeID", "Name", "Position", "Registered", "SSN", "AppointmentID", "Patient", "PrepNurse", "Physician", "Start", "End", "ExaminationRoom", "Code", "Name", "Brand", "Description", "Physician", "Patient", "Medication", "Date", "Appointment", "Dose", "BlockFloor", "BlockCode", "RoomNumber", "RoomType", "BlockFloor", "BlockCode", "Unavailable", "Nurse", "BlockFloor", "BlockCode", "OnCallStart", "OnCallEnd", "StayID", "Patient", "Room", "StayStart", "StayEnd", "Patient", "Procedures", "Stay", "DateUndergoes", "Physician", "AssistingNurse" ] }, "db_column_types": [ "text", "number", "text", "text", "number", "number", "text", "number", "number", "number", "boolean", "number", "text", "number", "number", "number", "time", "time", "number", "text", "text", "text", "number", "number", "number", "text", "text", "boolean", "number", "number", "number", "number", "number", "time", "time", "text", "number", "text", "text", "text", "number", "number", "number", "time", "number", "text", "number", "number", "number", "text", "number", "number", "boolean", "number", "number", "number", "time", "time", "number", "number", "number", "time", "time", "number", "number", "number", "time", "number", "number" ], "db_primary_keys": { "column_id": [ 1, 5, 8, 11, 14, 18, 24, 29, 36, 40, 46, 48, 53, 58, 63 ] }, "db_foreign_keys": { "column_id": [ 7, 9, 8, 15, 14, 23, 32, 31, 30, 44, 42, 41, 40, 50, 51, 54, 55, 53, 60, 59, 68, 67, 65, 64, 63 ], "other_column_id": [ 1, 5, 1, 11, 1, 1, 1, 24, 18, 29, 36, 18, 1, 46, 47, 46, 47, 24, 48, 18, 24, 1, 58, 11, 18 ] }, "serialized_schema": " | hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "struct_in": "| hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "text_in": "How many employees does each department have?", "seq_out": "select count(departmentid) from department group by departmentid" }, { "query": "SELECT * FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;", "utterances": [ "How many employees does each department have?", "Which department has the least employees?" ], "turn_idx": 1, "db_id": "hospital_1", "db_path": "./data\\downloads\\extracted\\79d0e486c5243a22086f51c2c2151de89eb505039b4aae9698b5ccf8b312ffd6/sparc/database", "db_table_names": [ "Physician", "Department", "Affiliated_With", "Procedures", "Trained_In", "Patient", "Nurse", "Appointment", "Medication", "Prescribes", "Block", "Room", "On_Call", "Stay", "Undergoes" ], "db_column_names": { "table_id": [ -1, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14 ], "column_name": [ "*", "EmployeeID", "Name", "Position", "SSN", "DepartmentID", "Name", "Head", "Physician", "Department", "PrimaryAffiliation", "Code", "Name", "Cost", "Physician", "Treatment", "CertificationDate", "CertificationExpires", "SSN", "Name", "Address", "Phone", "InsuranceID", "PCP", "EmployeeID", "Name", "Position", "Registered", "SSN", "AppointmentID", "Patient", "PrepNurse", "Physician", "Start", "End", "ExaminationRoom", "Code", "Name", "Brand", "Description", "Physician", "Patient", "Medication", "Date", "Appointment", "Dose", "BlockFloor", "BlockCode", "RoomNumber", "RoomType", "BlockFloor", "BlockCode", "Unavailable", "Nurse", "BlockFloor", "BlockCode", "OnCallStart", "OnCallEnd", "StayID", "Patient", "Room", "StayStart", "StayEnd", "Patient", "Procedures", "Stay", "DateUndergoes", "Physician", "AssistingNurse" ] }, "db_column_types": [ "text", "number", "text", "text", "number", "number", "text", "number", "number", "number", "boolean", "number", "text", "number", "number", "number", "time", "time", "number", "text", "text", "text", "number", "number", "number", "text", "text", "boolean", "number", "number", "number", "number", "number", "time", "time", "text", "number", "text", "text", "text", "number", "number", "number", "time", "number", "text", "number", "number", "number", "text", "number", "number", "boolean", "number", "number", "number", "time", "time", "number", "number", "number", "time", "time", "number", "number", "number", "time", "number", "number" ], "db_primary_keys": { "column_id": [ 1, 5, 8, 11, 14, 18, 24, 29, 36, 40, 46, 48, 53, 58, 63 ] }, "db_foreign_keys": { "column_id": [ 7, 9, 8, 15, 14, 23, 32, 31, 30, 44, 42, 41, 40, 50, 51, 54, 55, 53, 60, 59, 68, 67, 65, 64, 63 ], "other_column_id": [ 1, 5, 1, 11, 1, 1, 1, 24, 18, 29, 36, 18, 1, 46, 47, 46, 47, 24, 48, 18, 24, 1, 58, 11, 18 ] }, "serialized_schema": " | hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "struct_in": "| hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "text_in": "Which department has the least employees? || How many employees does each department have?", "seq_out": "select * from department group by departmentid order by count(departmentid) limit 1;" }, { "query": "SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;", "utterances": [ "How many employees does each department have?", "Which department has the least employees?", "Who is the head of this department? Find the employee id." ], "turn_idx": 2, "db_id": "hospital_1", "db_path": "./data\\downloads\\extracted\\79d0e486c5243a22086f51c2c2151de89eb505039b4aae9698b5ccf8b312ffd6/sparc/database", "db_table_names": [ "Physician", "Department", "Affiliated_With", "Procedures", "Trained_In", "Patient", "Nurse", "Appointment", "Medication", "Prescribes", "Block", "Room", "On_Call", "Stay", "Undergoes" ], "db_column_names": { "table_id": [ -1, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14 ], "column_name": [ "*", "EmployeeID", "Name", "Position", "SSN", "DepartmentID", "Name", "Head", "Physician", "Department", "PrimaryAffiliation", "Code", "Name", "Cost", "Physician", "Treatment", "CertificationDate", "CertificationExpires", "SSN", "Name", "Address", "Phone", "InsuranceID", "PCP", "EmployeeID", "Name", "Position", "Registered", "SSN", "AppointmentID", "Patient", "PrepNurse", "Physician", "Start", "End", "ExaminationRoom", "Code", "Name", "Brand", "Description", "Physician", "Patient", "Medication", "Date", "Appointment", "Dose", "BlockFloor", "BlockCode", "RoomNumber", "RoomType", "BlockFloor", "BlockCode", "Unavailable", "Nurse", "BlockFloor", "BlockCode", "OnCallStart", "OnCallEnd", "StayID", "Patient", "Room", "StayStart", "StayEnd", "Patient", "Procedures", "Stay", "DateUndergoes", "Physician", "AssistingNurse" ] }, "db_column_types": [ "text", "number", "text", "text", "number", "number", "text", "number", "number", "number", "boolean", "number", "text", "number", "number", "number", "time", "time", "number", "text", "text", "text", "number", "number", "number", "text", "text", "boolean", "number", "number", "number", "number", "number", "time", "time", "text", "number", "text", "text", "text", "number", "number", "number", "time", "number", "text", "number", "number", "number", "text", "number", "number", "boolean", "number", "number", "number", "time", "time", "number", "number", "number", "time", "time", "number", "number", "number", "time", "number", "number" ], "db_primary_keys": { "column_id": [ 1, 5, 8, 11, 14, 18, 24, 29, 36, 40, 46, 48, 53, 58, 63 ] }, "db_foreign_keys": { "column_id": [ 7, 9, 8, 15, 14, 23, 32, 31, 30, 44, 42, 41, 40, 50, 51, 54, 55, 53, 60, 59, 68, 67, 65, 64, 63 ], "other_column_id": [ 1, 5, 1, 11, 1, 1, 1, 24, 18, 29, 36, 18, 1, 46, 47, 46, 47, 24, 48, 18, 24, 1, 58, 11, 18 ] }, "serialized_schema": " | hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "struct_in": "| hospital_1 | physician : employeeid , name , position , ssn | department : departmentid , name , head | affiliated_with : physician , department , primaryaffiliation | procedures : code , name , cost | trained_in : physician , treatment , certificationdate , certificationexpires | patient : ssn , name , address , phone , insuranceid , pcp | nurse : employeeid , name , position , registered , ssn | appointment : appointmentid , patient , prepnurse , physician , start , end , examinationroom | medication : code , name , brand , description | prescribes : physician , patient , medication , date , appointment , dose | block : blockfloor , blockcode | room : roomnumber , roomtype , blockfloor , blockcode , unavailable | on_call : nurse , blockfloor , blockcode , oncallstart , oncallend | stay : stayid , patient , room , staystart , stayend | undergoes : patient , procedures , stay , dateundergoes , physician , assistingnurse", "text_in": "Who is the head of this department? Find the employee id. || Which department has the least employees? | How many employees does each department have?", "seq_out": "select head from department group by departmentid order by count(departmentid) limit 1;" } ] ]