db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
hospital_1 | select head from department group by departmentid order by count(departmentid) limit 1; | Question: what is the employee id of the head whose department has the least number of employees? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatme... | what is the employee id of the head whose department has the least number of employees? |
hospital_1 | select head from department group by departmentid order by count(departmentid) limit 1; | Question: tell me the employee id of the head of the department with the least employees. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Cert... | tell me the employee id of the head of the department with the least employees. |
hospital_1 | 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; | Question: what is the name and position of the head whose department has least number of employees? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treat... | what is the name and position of the head whose department has least number of employees? |
hospital_1 | 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; | Question: find the name and position of the head of the department with the least employees. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, C... | find the name and position of the head of the department with the least employees. |
hospital_1 | select name from appointment as t1 join patient as t2 on t1.patient = t2.ssn | Question: what are names of patients who made an appointment? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certification... | what are names of patients who made an appointment? |
hospital_1 | select name from appointment as t1 join patient as t2 on t1.patient = t2.ssn | Question: list the names of patients who have made appointments. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certificat... | list the names of patients who have made appointments. |
hospital_1 | select name , phone from appointment as t1 join patient as t2 on t1.patient = t2.ssn group by t1.patient having count(*) > 1 | Question: what are name and phone number of patients who had more than one appointment? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certif... | what are name and phone number of patients who had more than one appointment? |
hospital_1 | select name , phone from appointment as t1 join patient as t2 on t1.patient = t2.ssn group by t1.patient having count(*) > 1 | Question: which patients made more than one appointment? tell me the name and phone number of these patients. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physic... | which patients made more than one appointment? tell me the name and phone number of these patients. |
hospital_1 | select appointmentid from appointment order by start desc limit 1 | Question: find the id of the appointment with the most recent start date? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, C... | find the id of the appointment with the most recent start date? |
hospital_1 | select appointmentid from appointment order by start desc limit 1 | Question: what is the id of the appointment that started most recently? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Cer... | what is the id of the appointment that started most recently? |
hospital_1 | select t2.name from appointment as t1 join physician as t2 on t1.physician = t2.employeeid | Question: list the name of physicians who took some appointment. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certificat... | list the name of physicians who took some appointment. |
hospital_1 | select t2.name from appointment as t1 join physician as t2 on t1.physician = t2.employeeid | Question: what are the names of all the physicians who took appointments. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, C... | what are the names of all the physicians who took appointments. |
hospital_1 | select name from physician except select t2.name from appointment as t1 join physician as t2 on t1.physician = t2.employeeid | Question: list the name of physicians who never took any appointment. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certi... | list the name of physicians who never took any appointment. |
hospital_1 | select name from physician except select t2.name from appointment as t1 join physician as t2 on t1.physician = t2.employeeid | Question: which physicians have never taken any appointment? find their names. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDa... | which physicians have never taken any appointment? find their names. |
hospital_1 | 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 | Question: find the names of all physicians and their primary affiliated departments' names. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Ce... | find the names of all physicians and their primary affiliated departments' names. |
hospital_1 | 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 | Question: what are the name and primarily affiliated department name of each physician? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certif... | what are the name and primarily affiliated department name of each physician? |
hospital_1 | select t1.name from patient as t1 join appointment as t2 on t1.ssn = t2.patient order by t2.start desc limit 1 | Question: what is the name of the patient who made the most recent appointment? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationD... | what is the name of the patient who made the most recent appointment? |
hospital_1 | select t1.name from patient as t1 join appointment as t2 on t1.ssn = t2.patient order by t2.start desc limit 1 | Question: find the name of the patient who made the appointment with the most recent start date. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatmen... | find the name of the patient who made the appointment with the most recent start date. |
hospital_1 | select count(patient) from stay where room = 112 | Question: how many patients stay in room 112? | Tables: 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... | how many patients stay in room 112? |
hospital_1 | select count(patient) from stay where room = 112 | Question: count the number of patients who stayed in room 112. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certificatio... | count the number of patients who stayed in room 112. |
hospital_1 | 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 = 'john dorian' | Question: how many patients' prescriptions are made by physician john dorian? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDat... | how many patients' prescriptions are made by physician john dorian? |
hospital_1 | 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 = 'john dorian' | Question: find the number of patients' prescriptions physician john dorian made. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certification... | find the number of patients' prescriptions physician john dorian made. |
hospital_1 | 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 | Question: find the name of medication used on the patient who stays in room 111? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certification... | find the name of medication used on the patient who stays in room 111? |
hospital_1 | 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 | Question: what is the name of the medication used for the patient staying in room 111? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certifi... | what is the name of the medication used for the patient staying in room 111? |
hospital_1 | select patient from stay where room = 111 order by staystart desc limit 1 | Question: find the patient who most recently stayed in room 111. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certificat... | find the patient who most recently stayed in room 111. |
hospital_1 | select patient from stay where room = 111 order by staystart desc limit 1 | Question: what is the id of the patient who stayed in room 111 most recently? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDat... | what is the id of the patient who stayed in room 111 most recently? |
hospital_1 | 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 | Question: what is the name of the nurse has the most appointments? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certific... | what is the name of the nurse has the most appointments? |
hospital_1 | 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 | Question: find the name of the nurse who has the largest number of appointments. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certification... | find the name of the nurse who has the largest number of appointments. |
hospital_1 | select t1.name , count(*) from physician as t1 join patient as t2 on t1.employeeid = t2.pcp group by t1.employeeid | Question: how many patients do each physician take care of? list their names and number of patients they take care of. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In ... | how many patients do each physician take care of? list their names and number of patients they take care of. |
hospital_1 | select t1.name , count(*) from physician as t1 join patient as t2 on t1.employeeid = t2.pcp group by t1.employeeid | Question: return the name of each physician and the number of patients he or she treats. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certi... | return the name of each physician and the number of patients he or she treats. |
hospital_1 | select t1.name from physician as t1 join patient as t2 on t1.employeeid = t2.pcp group by t1.employeeid having count(*) > 1 | Question: find the name of physicians who are in charge of more than one patient. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certificatio... | find the name of physicians who are in charge of more than one patient. |
hospital_1 | select t1.name from physician as t1 join patient as t2 on t1.employeeid = t2.pcp group by t1.employeeid having count(*) > 1 | Question: which physicians are in charge of more than one patient? give me their names. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certif... | which physicians are in charge of more than one patient? give me their names. |
hospital_1 | 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 | Question: find the number of rooms located on each block floor. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certificati... | find the number of rooms located on each block floor. |
hospital_1 | 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 | Question: how many rooms does each block floor have? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, CertificationExpires. ... | how many rooms does each block floor have? |
hospital_1 | 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 | Question: find the number of rooms for different block code? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, CertificationE... | find the number of rooms for different block code? |
hospital_1 | 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 | Question: how many rooms are located for each block code? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, CertificationExpi... | how many rooms are located for each block code? |
hospital_1 | select distinct blockcode from room where unavailable = 0 | Question: what are the unique block codes that have available rooms? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certif... | what are the unique block codes that have available rooms? |
hospital_1 | select distinct blockcode from room where unavailable = 0 | Question: tell me the distinct block codes where some rooms are available. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, ... | tell me the distinct block codes where some rooms are available. |
hospital_1 | select count(distinct roomtype) from room | Question: how many different types of rooms are there? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, CertificationExpires... | how many different types of rooms are there? |
hospital_1 | select count(distinct roomtype) from room | Question: find the number of distinct room types available. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, CertificationEx... | find the number of distinct room types available. |
hospital_1 | 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 = 'thesisin' | Question: what is the names of the physicians who prescribe medication thesisin? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certification... | what is the names of the physicians who prescribe medication thesisin? |
hospital_1 | 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 = 'thesisin' | Question: list the names of all the physicians who prescribe thesisin as medication. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certifica... | list the names of all the physicians who prescribe thesisin as medication. |
hospital_1 | 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' | Question: find the name and position of physicians who prescribe some medication whose brand is x? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatm... | find the name and position of physicians who prescribe some medication whose brand is x? |
hospital_1 | 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' | Question: which physicians prescribe a medication of brand x? tell me the name and position of those physicians. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Phy... | which physicians prescribe a medication of brand x? tell me the name and position of those physicians. |
hospital_1 | select count(*) , t1.name from medication as t1 join prescribes as t2 on t1.code = t2.medication group by t1.brand | Question: find the number of medications prescribed for each brand. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certifi... | find the number of medications prescribed for each brand. |
hospital_1 | select count(*) , t1.name from medication as t1 join prescribes as t2 on t1.code = t2.medication group by t1.brand | Question: how many medications are prescribed for each brand? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certification... | how many medications are prescribed for each brand? |
hospital_1 | select name from physician where position like '%senior%' | Question: find the name of physicians whose position title contains the word 'senior'. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certifi... | find the name of physicians whose position title contains the word 'senior'. |
hospital_1 | select name from physician where position like '%senior%' | Question: what are the names of the physicians who have 'senior' in their titles. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certificatio... | what are the names of the physicians who have 'senior' in their titles. |
hospital_1 | select patient from undergoes order by dateundergoes limit 1 | Question: find the patient who has the most recent undergoing treatment? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Ce... | find the patient who has the most recent undergoing treatment? |
hospital_1 | select patient from undergoes order by dateundergoes limit 1 | Question: which patient is undergoing the most recent treatment? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certificat... | which patient is undergoing the most recent treatment? |
hospital_1 | 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 | Question: find the names of all patients who have an undergoing treatment and are staying in room 111. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Tr... | find the names of all patients who have an undergoing treatment and are staying in room 111. |
hospital_1 | 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 | Question: what are the names of patients who are staying in room 111 and have an undergoing treatment? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Tr... | what are the names of patients who are staying in room 111 and have an undergoing treatment? |
hospital_1 | select distinct name from nurse order by name | Question: list the names of all distinct nurses ordered by alphabetical order? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDa... | list the names of all distinct nurses ordered by alphabetical order? |
hospital_1 | select distinct name from nurse order by name | Question: what is the alphabetically ordered list of all the distinct names of nurses? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certifi... | what is the alphabetically ordered list of all the distinct names of nurses? |
hospital_1 | select distinct t2.name from undergoes as t1 join nurse as t2 on t1.assistingnurse = t2.employeeid | Question: find the names of nurses who are nursing an undergoing treatment. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate,... | find the names of nurses who are nursing an undergoing treatment. |
hospital_1 | select distinct t2.name from undergoes as t1 join nurse as t2 on t1.assistingnurse = t2.employeeid | Question: which nurses are in charge of patients undergoing treatments? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Cer... | which nurses are in charge of patients undergoing treatments? |
hospital_1 | select distinct name from medication order by name | Question: list the names of all distinct medications, ordered in an alphabetical order. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certif... | list the names of all distinct medications, ordered in an alphabetical order. |
hospital_1 | select distinct name from medication order by name | Question: what is the alphabetically ordered list of all distinct medications? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDa... | what is the alphabetically ordered list of all distinct medications? |
hospital_1 | select t1.name from physician as t1 join prescribes as t2 on t1.employeeid = t2.physician order by t2.dose desc limit 1 | Question: what are the names of the physician who prescribed the highest dose? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDa... | what are the names of the physician who prescribed the highest dose? |
hospital_1 | select t1.name from physician as t1 join prescribes as t2 on t1.employeeid = t2.physician order by t2.dose desc limit 1 | Question: find the physician who prescribed the highest dose. what is his or her name? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certifi... | find the physician who prescribed the highest dose. what is his or her name? |
hospital_1 | select physician , department from affiliated_with where primaryaffiliation = 1 | Question: list the physicians' employee ids together with their primary affiliation departments' ids. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Tre... | list the physicians' employee ids together with their primary affiliation departments' ids. |
hospital_1 | select physician , department from affiliated_with where primaryaffiliation = 1 | Question: what are each physician's employee id and department id primarily affiliated. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certif... | what are each physician's employee id and department id primarily affiliated. |
hospital_1 | select distinct t2.name from affiliated_with as t1 join department as t2 on t1.department = t2.departmentid where primaryaffiliation = 1 | Question: list the names of departments where some physicians are primarily affiliated with. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, C... | list the names of departments where some physicians are primarily affiliated with. |
hospital_1 | select distinct t2.name from affiliated_with as t1 join department as t2 on t1.department = t2.departmentid where primaryaffiliation = 1 | Question: what are the names of departments that have primarily affiliated physicians. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certifi... | what are the names of departments that have primarily affiliated physicians. |
hospital_1 | select nurse from on_call where blockfloor = 1 and blockcode = 1 | Question: what nurses are on call with block floor 1 and block code 1? tell me their names. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Ce... | what nurses are on call with block floor 1 and block code 1? tell me their names. |
hospital_1 | select nurse from on_call where blockfloor = 1 and blockcode = 1 | Question: find the ids of the nurses who are on call in block floor 1 and block code 1. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certif... | find the ids of the nurses who are on call in block floor 1 and block code 1. |
hospital_1 | select max(cost) , min(cost) , avg(cost) from procedures | Question: what are the highest cost, lowest cost and average cost of procedures? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certification... | what are the highest cost, lowest cost and average cost of procedures? |
hospital_1 | select max(cost) , min(cost) , avg(cost) from procedures | Question: tell me the highest, lowest, and average cost of procedures. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Cert... | tell me the highest, lowest, and average cost of procedures. |
hospital_1 | select name , cost from procedures order by cost desc | Question: list the name and cost of all procedures sorted by the cost from the highest to the lowest. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Tre... | list the name and cost of all procedures sorted by the cost from the highest to the lowest. |
hospital_1 | select name , cost from procedures order by cost desc | Question: sort the list of names and costs of all procedures in the descending order of cost. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, ... | sort the list of names and costs of all procedures in the descending order of cost. |
hospital_1 | select name from procedures order by cost limit 3 | Question: find the three most expensive procedures. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, CertificationExpires. P... | find the three most expensive procedures. |
hospital_1 | select name from procedures order by cost limit 3 | Question: what are the three most costly procedures? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, CertificationExpires. ... | what are the three most costly procedures? |
hospital_1 | 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 | Question: find the physicians who are trained in a procedure that costs more than 5000. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certif... | find the physicians who are trained in a procedure that costs more than 5000. |
hospital_1 | 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 | Question: which physicians are trained in procedures that are more expensive than 5000? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certif... | which physicians are trained in procedures that are more expensive than 5000? |
hospital_1 | 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 | Question: find the physician who was trained in the most expensive procedure? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDat... | find the physician who was trained in the most expensive procedure? |
hospital_1 | 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 | Question: which physician was trained in the procedure that costs the most. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate,... | which physician was trained in the procedure that costs the most. |
hospital_1 | 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 = 'john wen' | Question: what is the average cost of procedures that physician john wen was trained in? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certi... | what is the average cost of procedures that physician john wen was trained in? |
hospital_1 | 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 = 'john wen' | Question: compute the mean price of procedures physician john wen was trained in. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certificatio... | compute the mean price of procedures physician john wen was trained in. |
hospital_1 | 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 = 'john wen' | Question: find the names of procedures which physician john wen was trained in. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationD... | find the names of procedures which physician john wen was trained in. |
hospital_1 | 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 = 'john wen' | Question: what are the names of procedures physician john wen was trained in? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDat... | what are the names of procedures physician john wen was trained in? |
hospital_1 | 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 = 'john wen' | Question: find all procedures which cost more than 1000 or which physician john wen was trained in. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treat... | find all procedures which cost more than 1000 or which physician john wen was trained in. |
hospital_1 | 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 = 'john wen' | Question: what are the procedures that cost more than 1000 or are specialized in by physician john wen? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, T... | what are the procedures that cost more than 1000 or are specialized in by physician john wen? |
hospital_1 | 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 = 'john wen' | Question: find the names of all procedures which cost more than 1000 but which physician john wen was not trained in? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -... | find the names of all procedures which cost more than 1000 but which physician john wen was not trained in? |
hospital_1 | 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 = 'john wen' | Question: among the procedures that cost more than 1000, which were not specialized in by physician john wen? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physic... | among the procedures that cost more than 1000, which were not specialized in by physician john wen? |
hospital_1 | 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 = 'john wen' | Question: find the names of all procedures such that the cost is less than 5000 and physician john wen was trained in. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In ... | find the names of all procedures such that the cost is less than 5000 and physician john wen was trained in. |
hospital_1 | 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 = 'john wen' | Question: what procedures cost less than 5000 and have john wen as a trained physician? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certif... | what procedures cost less than 5000 and have john wen as a trained physician? |
hospital_1 | 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 = 'surgery' intersect select t1.name from physician as t1 join affiliated_with as t2 on t1.employeeid = t2.physician join department as t3 on t2.d... | Question: find the name of physicians who are affiliated with both surgery and psychiatry departments. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Tr... | find the name of physicians who are affiliated with both surgery and psychiatry departments. |
hospital_1 | 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 = 'surgery' intersect select t1.name from physician as t1 join affiliated_with as t2 on t1.employeeid = t2.physician join department as t3 on t2.d... | Question: which physicians are affiliated with both surgery and psychiatry departments? tell me their names. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physici... | which physicians are affiliated with both surgery and psychiatry departments? tell me their names. |
hospital_1 | 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 = 'surgery' or t3.name = 'psychiatry' | Question: find the name of physicians who are affiliated with surgery or psychiatry department. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment... | find the name of physicians who are affiliated with surgery or psychiatry department. |
hospital_1 | 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 = 'surgery' or t3.name = 'psychiatry' | Question: which physicians are affiliated with either surgery or psychiatry department? give me their names. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physici... | which physicians are affiliated with either surgery or psychiatry department? give me their names. |
hospital_1 | select name from patient except select t1.name from patient as t1 join prescribes as t2 on t2.patient = t1.ssn join medication as t3 on t2.medication = t3.code where t3.name = 'procrastin-x' | Question: find the names of patients who are not using the medication of procrastin-x. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certifi... | find the names of patients who are not using the medication of procrastin-x. |
hospital_1 | select name from patient except select t1.name from patient as t1 join prescribes as t2 on t2.patient = t1.ssn join medication as t3 on t2.medication = t3.code where t3.name = 'procrastin-x' | Question: what are the names of patients who are not taking the medication of procrastin-x. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Ce... | what are the names of patients who are not taking the medication of procrastin-x. |
hospital_1 | select count(*) from patient where ssn not in ( select t1.patient from prescribes as t1 join medication as t2 on t1.medication = t2.code where t2.name = 'procrastin-x' ) | Question: find the number of patients who are not using the medication of procrastin-x. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, Certif... | find the number of patients who are not using the medication of procrastin-x. |
hospital_1 | select count(*) from patient where ssn not in ( select t1.patient from prescribes as t1 join medication as t2 on t1.medication = t2.code where t2.name = 'procrastin-x' ) | Question: how many patients are not using procrastin-x as medication? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certi... | how many patients are not using procrastin-x as medication? |
hospital_1 | select count(*) from appointment | Question: how many appointments are there? | Tables: 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 ->... | how many appointments are there? |
hospital_1 | select count(*) from appointment | Question: count how many appointments have been made in total. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, Certificatio... | count how many appointments have been made in total. |
hospital_1 | select distinct t1.name from nurse as t1 join on_call as t2 on t1.employeeid = t2.nurse | Question: find the names of nurses who are on call. | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, CertificationExpires. P... | find the names of nurses who are on call. |
hospital_1 | select distinct t1.name from nurse as t1 join on_call as t2 on t1.employeeid = t2.nurse | Question: what are the distinct names of nurses on call? | Tables: Physician -> EmployeeID, Name, Position, SSN. Department -> DepartmentID, Name, Head. Affiliated_With -> Physician, Department, PrimaryAffiliation. Procedures -> Code, Name, Cost. Trained_In -> Physician, Treatment, CertificationDate, CertificationExpir... | what are the distinct names of nurses on call? |
ship_mission | select count(*) from ship | Question: how many ships are there? | Tables: mission -> Mission_ID, Ship_ID, Code, Launched_Year, Location, Speed_knots, Fate. ship -> Ship_ID, Name, Type, Nationality, Tonnage. | Joins: mission.Ship_ID = ship.Ship_ID, | how many ships are there? |
ship_mission | select count(*) from ship | Question: what is the number of ships? | Tables: mission -> Mission_ID, Ship_ID, Code, Launched_Year, Location, Speed_knots, Fate. ship -> Ship_ID, Name, Type, Nationality, Tonnage. | Joins: mission.Ship_ID = ship.Ship_ID, | what is the number of ships? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.