db_id stringclasses 140
values | query stringlengths 18 577 | question stringlengths 16 224 | query_toks listlengths 4 90 | query_toks_no_value listlengths 4 125 | question_toks listlengths 4 44 | question_toks_masked listlengths 4 44 | query_toks_masked listlengths 4 125 |
|---|---|---|---|---|---|---|---|
hospital_1 | SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1; | What is the employee id of the head whose department has the least number of employees? | [
"SELECT",
"head",
"FROM",
"department",
"GROUP",
"BY",
"departmentID",
"ORDER",
"BY",
"count",
"(",
"departmentID",
")",
"LIMIT",
"1",
";"
] | [
"select",
"head",
"from",
"department",
"group",
"by",
"departmentid",
"order",
"by",
"count",
"(",
"departmentid",
")",
"limit",
"value"
] | [
"What",
"is",
"the",
"employee",
"id",
"of",
"the",
"head",
"whose",
"department",
"has",
"the",
"least",
"number",
"of",
"employees",
"?"
] | [
"What",
"is",
"the",
"<mask>",
"id",
"of",
"the",
"<mask>",
"whose",
"<mask>",
"has",
"the",
"least",
"number",
"of",
"<mask>",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"group",
"by",
"<mask>",
"order",
"by",
"count",
"(",
"<mask>",
")",
"limit",
"<unk>"
] |
hospital_1 | SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1; | Tell me the employee id of the head of the department with the least employees. | [
"SELECT",
"head",
"FROM",
"department",
"GROUP",
"BY",
"departmentID",
"ORDER",
"BY",
"count",
"(",
"departmentID",
")",
"LIMIT",
"1",
";"
] | [
"select",
"head",
"from",
"department",
"group",
"by",
"departmentid",
"order",
"by",
"count",
"(",
"departmentid",
")",
"limit",
"value"
] | [
"Tell",
"me",
"the",
"employee",
"id",
"of",
"the",
"head",
"of",
"the",
"department",
"with",
"the",
"least",
"employees",
"."
] | [
"Tell",
"me",
"the",
"<mask>",
"id",
"of",
"the",
"<mask>",
"of",
"the",
"<mask>",
"<mask>",
"the",
"least",
"<mask>",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"group",
"by",
"<mask>",
"order",
"by",
"count",
"(",
"<mask>",
")",
"limit",
"<unk>"
] |
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; | what is the name and position of the head whose department has least number of employees? | [
"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",
";"
] | [
"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",... | [
"what",
"is",
"the",
"name",
"and",
"position",
"of",
"the",
"head",
"whose",
"department",
"has",
"least",
"number",
"of",
"employees",
"?"
] | [
"what",
"is",
"the",
"<mask>",
"and",
"<mask>",
"of",
"the",
"<mask>",
"whose",
"<mask>",
"has",
"least",
"number",
"of",
"<mask>",
"?"
] | [
"select",
"<mask>",
".",
"<mask>",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
"order",
"by",
"count",
"(",
"<mask... |
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; | Find the name and position of the head of the department with the least employees. | [
"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",
";"
] | [
"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",... | [
"Find",
"the",
"name",
"and",
"position",
"of",
"the",
"head",
"of",
"the",
"department",
"with",
"the",
"least",
"employees",
"."
] | [
"Find",
"the",
"<mask>",
"and",
"<mask>",
"of",
"the",
"<mask>",
"of",
"the",
"<mask>",
"<mask>",
"the",
"least",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
"order",
"by",
"count",
"(",
"<mask... |
hospital_1 | SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn | What are names of patients who made an appointment? | [
"SELECT",
"name",
"FROM",
"appointment",
"AS",
"T1",
"JOIN",
"patient",
"AS",
"T2",
"ON",
"T1.patient",
"=",
"T2.ssn"
] | [
"select",
"name",
"from",
"appointment",
"as",
"t1",
"join",
"patient",
"as",
"t2",
"on",
"t1",
".",
"patient",
"=",
"t2",
".",
"ssn"
] | [
"What",
"are",
"names",
"of",
"patients",
"who",
"made",
"an",
"appointment",
"?"
] | [
"What",
"are",
"<mask>",
"of",
"<mask>",
"who",
"made",
"an",
"<mask>",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>"
] |
hospital_1 | SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn | List the names of patients who have made appointments. | [
"SELECT",
"name",
"FROM",
"appointment",
"AS",
"T1",
"JOIN",
"patient",
"AS",
"T2",
"ON",
"T1.patient",
"=",
"T2.ssn"
] | [
"select",
"name",
"from",
"appointment",
"as",
"t1",
"join",
"patient",
"as",
"t2",
"on",
"t1",
".",
"patient",
"=",
"t2",
".",
"ssn"
] | [
"List",
"the",
"names",
"of",
"patients",
"who",
"have",
"made",
"appointments",
"."
] | [
"List",
"the",
"<mask>",
"of",
"<mask>",
"who",
"have",
"made",
"<mask>",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>"
] |
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 | what are name and phone number of patients who had more than one appointment? | [
"SELECT",
"name",
",",
"phone",
"FROM",
"appointment",
"AS",
"T1",
"JOIN",
"patient",
"AS",
"T2",
"ON",
"T1.patient",
"=",
"T2.ssn",
"GROUP",
"BY",
"T1.patient",
"HAVING",
"count",
"(",
"*",
")",
">",
"1"
] | [
"select",
"name",
",",
"phone",
"from",
"appointment",
"as",
"t1",
"join",
"patient",
"as",
"t2",
"on",
"t1",
".",
"patient",
"=",
"t2",
".",
"ssn",
"group",
"by",
"t1",
".",
"patient",
"having",
"count",
"(",
"*",
")",
">",
"value"
] | [
"what",
"are",
"name",
"and",
"phone",
"number",
"of",
"patients",
"who",
"had",
"more",
"than",
"one",
"appointment",
"?"
] | [
"what",
"are",
"<mask>",
"and",
"<mask>",
"number",
"of",
"<mask>",
"who",
"had",
"more",
"than",
"one",
"<mask>",
"?"
] | [
"select",
"<mask>",
",",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
".",
"<mask>",
"<mask>",
"count",
"(",
"*",
")",
">",
"<unk>"
] |
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 | Which patients made more than one appointment? Tell me the name and phone number of these patients. | [
"SELECT",
"name",
",",
"phone",
"FROM",
"appointment",
"AS",
"T1",
"JOIN",
"patient",
"AS",
"T2",
"ON",
"T1.patient",
"=",
"T2.ssn",
"GROUP",
"BY",
"T1.patient",
"HAVING",
"count",
"(",
"*",
")",
">",
"1"
] | [
"select",
"name",
",",
"phone",
"from",
"appointment",
"as",
"t1",
"join",
"patient",
"as",
"t2",
"on",
"t1",
".",
"patient",
"=",
"t2",
".",
"ssn",
"group",
"by",
"t1",
".",
"patient",
"having",
"count",
"(",
"*",
")",
">",
"value"
] | [
"Which",
"patients",
"made",
"more",
"than",
"one",
"appointment",
"?",
"Tell",
"me",
"the",
"name",
"and",
"phone",
"number",
"of",
"these",
"patients",
"."
] | [
"Which",
"<mask>",
"made",
"more",
"than",
"one",
"<mask>",
"?",
"Tell",
"me",
"the",
"<mask>",
"and",
"<mask>",
"number",
"of",
"these",
"<mask>",
"."
] | [
"select",
"<mask>",
",",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
".",
"<mask>",
"<mask>",
"count",
"(",
"*",
")",
">",
"<unk>"
] |
hospital_1 | SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1 | Find the id of the appointment with the most recent start date? | [
"SELECT",
"appointmentid",
"FROM",
"appointment",
"ORDER",
"BY",
"START",
"DESC",
"LIMIT",
"1"
] | [
"select",
"appointmentid",
"from",
"appointment",
"order",
"by",
"start",
"desc",
"limit",
"value"
] | [
"Find",
"the",
"id",
"of",
"the",
"appointment",
"with",
"the",
"most",
"recent",
"start",
"date",
"?"
] | [
"Find",
"the",
"id",
"of",
"the",
"<mask>",
"<mask>",
"the",
"most",
"recent",
"<mask>",
"<mask>",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>",
"desc",
"limit",
"<unk>"
] |
hospital_1 | SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1 | What is the id of the appointment that started most recently? | [
"SELECT",
"appointmentid",
"FROM",
"appointment",
"ORDER",
"BY",
"START",
"DESC",
"LIMIT",
"1"
] | [
"select",
"appointmentid",
"from",
"appointment",
"order",
"by",
"start",
"desc",
"limit",
"value"
] | [
"What",
"is",
"the",
"id",
"of",
"the",
"appointment",
"that",
"started",
"most",
"recently",
"?"
] | [
"What",
"is",
"the",
"id",
"of",
"the",
"<mask>",
"that",
"<mask>",
"most",
"recently",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>",
"desc",
"limit",
"<unk>"
] |
hospital_1 | SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID | List the name of physicians who took some appointment. | [
"SELECT",
"T2.name",
"FROM",
"appointment",
"AS",
"T1",
"JOIN",
"physician",
"AS",
"T2",
"ON",
"T1.Physician",
"=",
"T2.EmployeeID"
] | [
"select",
"t2",
".",
"name",
"from",
"appointment",
"as",
"t1",
"join",
"physician",
"as",
"t2",
"on",
"t1",
".",
"physician",
"=",
"t2",
".",
"employeeid"
] | [
"List",
"the",
"name",
"of",
"physicians",
"who",
"took",
"some",
"appointment",
"."
] | [
"List",
"the",
"<mask>",
"of",
"<mask>",
"who",
"took",
"some",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>"
] |
hospital_1 | SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID | What are the names of all the physicians who took appointments. | [
"SELECT",
"T2.name",
"FROM",
"appointment",
"AS",
"T1",
"JOIN",
"physician",
"AS",
"T2",
"ON",
"T1.Physician",
"=",
"T2.EmployeeID"
] | [
"select",
"t2",
".",
"name",
"from",
"appointment",
"as",
"t1",
"join",
"physician",
"as",
"t2",
"on",
"t1",
".",
"physician",
"=",
"t2",
".",
"employeeid"
] | [
"What",
"are",
"the",
"names",
"of",
"all",
"the",
"physicians",
"who",
"took",
"appointments",
"."
] | [
"What",
"are",
"the",
"<mask>",
"of",
"all",
"the",
"<mask>",
"who",
"took",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>"
] |
hospital_1 | SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID | List the name of physicians who never took any appointment. | [
"SELECT",
"name",
"FROM",
"physician",
"EXCEPT",
"SELECT",
"T2.name",
"FROM",
"appointment",
"AS",
"T1",
"JOIN",
"physician",
"AS",
"T2",
"ON",
"T1.Physician",
"=",
"T2.EmployeeID"
] | [
"select",
"name",
"from",
"physician",
"except",
"select",
"t2",
".",
"name",
"from",
"appointment",
"as",
"t1",
"join",
"physician",
"as",
"t2",
"on",
"t1",
".",
"physician",
"=",
"t2",
".",
"employeeid"
] | [
"List",
"the",
"name",
"of",
"physicians",
"who",
"never",
"took",
"any",
"appointment",
"."
] | [
"List",
"the",
"<mask>",
"of",
"<mask>",
"who",
"never",
"took",
"any",
"<mask>",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"except",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>"
] |
hospital_1 | SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID | Which physicians have never taken any appointment? Find their names. | [
"SELECT",
"name",
"FROM",
"physician",
"EXCEPT",
"SELECT",
"T2.name",
"FROM",
"appointment",
"AS",
"T1",
"JOIN",
"physician",
"AS",
"T2",
"ON",
"T1.Physician",
"=",
"T2.EmployeeID"
] | [
"select",
"name",
"from",
"physician",
"except",
"select",
"t2",
".",
"name",
"from",
"appointment",
"as",
"t1",
"join",
"physician",
"as",
"t2",
"on",
"t1",
".",
"physician",
"=",
"t2",
".",
"employeeid"
] | [
"Which",
"physicians",
"have",
"never",
"taken",
"any",
"appointment",
"?",
"Find",
"their",
"names",
"."
] | [
"Which",
"<mask>",
"have",
"never",
"taken",
"any",
"<mask>",
"?",
"Find",
"their",
"<mask>",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"except",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>"
] |
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 | Find the names of all physicians and their primary affiliated departments' names. | [
"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"... | [
"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",
"=... | [
"Find",
"the",
"names",
"of",
"all",
"physicians",
"and",
"their",
"primary",
"affiliated",
"departments",
"'",
"names",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"all",
"<mask>",
"and",
"their",
"<mask>",
"affiliated",
"<mask>",
"'",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mas... |
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 | What are the name and primarily affiliated department name of each physician? | [
"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"... | [
"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",
"=... | [
"What",
"are",
"the",
"name",
"and",
"primarily",
"affiliated",
"department",
"name",
"of",
"each",
"physician",
"?"
] | [
"What",
"are",
"the",
"<mask>",
"and",
"primarily",
"affiliated",
"<mask>",
"<mask>",
"of",
"each",
"<mask>",
"?"
] | [
"select",
"<mask>",
".",
"<mask>",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mas... |
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 | What is the name of the patient who made the most recent appointment? | [
"SELECT",
"T1.name",
"FROM",
"patient",
"AS",
"T1",
"JOIN",
"appointment",
"AS",
"T2",
"ON",
"T1.ssn",
"=",
"T2.patient",
"ORDER",
"BY",
"T2.start",
"DESC",
"LIMIT",
"1"
] | [
"select",
"t1",
".",
"name",
"from",
"patient",
"as",
"t1",
"join",
"appointment",
"as",
"t2",
"on",
"t1",
".",
"ssn",
"=",
"t2",
".",
"patient",
"order",
"by",
"t2",
".",
"start",
"desc",
"limit",
"value"
] | [
"What",
"is",
"the",
"name",
"of",
"the",
"patient",
"who",
"made",
"the",
"most",
"recent",
"appointment",
"?"
] | [
"What",
"is",
"the",
"<mask>",
"of",
"the",
"<mask>",
"who",
"made",
"the",
"most",
"recent",
"<mask>",
"?"
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"order",
"by",
"<mask>",
".",
"<mask>",
"desc",
"limit",
"<unk>"
] |
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 | Find the name of the patient who made the appointment with the most recent start date. | [
"SELECT",
"T1.name",
"FROM",
"patient",
"AS",
"T1",
"JOIN",
"appointment",
"AS",
"T2",
"ON",
"T1.ssn",
"=",
"T2.patient",
"ORDER",
"BY",
"T2.start",
"DESC",
"LIMIT",
"1"
] | [
"select",
"t1",
".",
"name",
"from",
"patient",
"as",
"t1",
"join",
"appointment",
"as",
"t2",
"on",
"t1",
".",
"ssn",
"=",
"t2",
".",
"patient",
"order",
"by",
"t2",
".",
"start",
"desc",
"limit",
"value"
] | [
"Find",
"the",
"name",
"of",
"the",
"patient",
"who",
"made",
"the",
"appointment",
"with",
"the",
"most",
"recent",
"start",
"date",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"the",
"<mask>",
"who",
"made",
"the",
"<mask>",
"<mask>",
"the",
"most",
"recent",
"<mask>",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"order",
"by",
"<mask>",
".",
"<mask>",
"desc",
"limit",
"<unk>"
] |
hospital_1 | SELECT count(patient) FROM stay WHERE room = 112 | How many patients stay in room 112? | [
"SELECT",
"count",
"(",
"patient",
")",
"FROM",
"stay",
"WHERE",
"room",
"=",
"112"
] | [
"select",
"count",
"(",
"patient",
")",
"from",
"stay",
"where",
"room",
"=",
"value"
] | [
"How",
"many",
"patients",
"stay",
"in",
"room",
"112",
"?"
] | [
"How",
"many",
"<mask>",
"<mask>",
"in",
"<mask>",
"<unk>",
"?"
] | [
"select",
"count",
"(",
"<mask>",
")",
"from",
"<mask>",
"where",
"<mask>",
"=",
"<unk>"
] |
hospital_1 | SELECT count(patient) FROM stay WHERE room = 112 | Count the number of patients who stayed in room 112. | [
"SELECT",
"count",
"(",
"patient",
")",
"FROM",
"stay",
"WHERE",
"room",
"=",
"112"
] | [
"select",
"count",
"(",
"patient",
")",
"from",
"stay",
"where",
"room",
"=",
"value"
] | [
"Count",
"the",
"number",
"of",
"patients",
"who",
"stayed",
"in",
"room",
"112",
"."
] | [
"Count",
"the",
"number",
"of",
"<mask>",
"who",
"<mask>",
"in",
"<mask>",
"<unk>",
"."
] | [
"select",
"count",
"(",
"<mask>",
")",
"from",
"<mask>",
"where",
"<mask>",
"=",
"<unk>"
] |
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" | How many patients' prescriptions are made by physician John Dorian? | [
"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",
"... | [
"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",
".",
"emplo... | [
"How",
"many",
"patients",
"'",
"prescriptions",
"are",
"made",
"by",
"physician",
"John",
"Dorian",
"?"
] | [
"How",
"many",
"<mask>",
"'",
"prescriptions",
"are",
"made",
"by",
"<mask>",
"John",
"Dorian",
"?"
] | [
"select",
"count",
"(",
"<mask>",
".",
"<mask>",
")",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
... |
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" | Find the number of patients' prescriptions physician John Dorian made. | [
"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",
"... | [
"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",
".",
"emplo... | [
"Find",
"the",
"number",
"of",
"patients",
"'",
"prescriptions",
"physician",
"John",
"Dorian",
"made",
"."
] | [
"Find",
"the",
"number",
"of",
"<mask>",
"'",
"prescriptions",
"<mask>",
"John",
"Dorian",
"made",
"."
] | [
"select",
"count",
"(",
"<mask>",
".",
"<mask>",
")",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
... |
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 | Find the name of medication used on the patient who stays in room 111? | [
"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",
... | [
"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",
"a... | [
"Find",
"the",
"name",
"of",
"medication",
"used",
"on",
"the",
"patient",
"who",
"stays",
"in",
"room",
"111",
"?"
] | [
"Find",
"the",
"<mask>",
"of",
"<mask>",
"used",
"on",
"the",
"<mask>",
"who",
"<mask>",
"in",
"<mask>",
"<unk>",
"?"
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
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 | What is the name of the medication used for the patient staying in room 111? | [
"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",
... | [
"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",
"a... | [
"What",
"is",
"the",
"name",
"of",
"the",
"medication",
"used",
"for",
"the",
"patient",
"staying",
"in",
"room",
"111",
"?"
] | [
"What",
"is",
"the",
"<mask>",
"of",
"the",
"<mask>",
"used",
"for",
"the",
"<mask>",
"<mask>",
"in",
"<mask>",
"<unk>",
"?"
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
hospital_1 | SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1 | Find the patient who most recently stayed in room 111. | [
"SELECT",
"patient",
"FROM",
"stay",
"WHERE",
"room",
"=",
"111",
"ORDER",
"BY",
"staystart",
"DESC",
"LIMIT",
"1"
] | [
"select",
"patient",
"from",
"stay",
"where",
"room",
"=",
"value",
"order",
"by",
"staystart",
"desc",
"limit",
"value"
] | [
"Find",
"the",
"patient",
"who",
"most",
"recently",
"stayed",
"in",
"room",
"111",
"."
] | [
"Find",
"the",
"<mask>",
"who",
"most",
"recently",
"<mask>",
"in",
"<mask>",
"<unk>",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"=",
"<unk>",
"order",
"by",
"<mask>",
"desc",
"limit",
"<unk>"
] |
hospital_1 | SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1 | What is the id of the patient who stayed in room 111 most recently? | [
"SELECT",
"patient",
"FROM",
"stay",
"WHERE",
"room",
"=",
"111",
"ORDER",
"BY",
"staystart",
"DESC",
"LIMIT",
"1"
] | [
"select",
"patient",
"from",
"stay",
"where",
"room",
"=",
"value",
"order",
"by",
"staystart",
"desc",
"limit",
"value"
] | [
"What",
"is",
"the",
"id",
"of",
"the",
"patient",
"who",
"stayed",
"in",
"room",
"111",
"most",
"recently",
"?"
] | [
"What",
"is",
"the",
"id",
"of",
"the",
"<mask>",
"who",
"<mask>",
"in",
"<mask>",
"<unk>",
"most",
"recently",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"=",
"<unk>",
"order",
"by",
"<mask>",
"desc",
"limit",
"<unk>"
] |
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 | What is the name of the nurse has the most appointments? | [
"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"
] | [
"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",
"... | [
"What",
"is",
"the",
"name",
"of",
"the",
"nurse",
"has",
"the",
"most",
"appointments",
"?"
] | [
"What",
"is",
"the",
"<mask>",
"of",
"the",
"<mask>",
"has",
"the",
"most",
"<mask>",
"?"
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
".",
"<mask>",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"... |
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 | Find the name of the nurse who has the largest number of appointments. | [
"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"
] | [
"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",
"... | [
"Find",
"the",
"name",
"of",
"the",
"nurse",
"who",
"has",
"the",
"largest",
"number",
"of",
"appointments",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"the",
"<mask>",
"who",
"has",
"the",
"largest",
"number",
"of",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
".",
"<mask>",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"... |
hospital_1 | SELECT T1.name , count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid | How many patients do each physician take care of? List their names and number of patients they take care of. | [
"SELECT",
"T1.name",
",",
"count",
"(",
"*",
")",
"FROM",
"physician",
"AS",
"T1",
"JOIN",
"patient",
"AS",
"T2",
"ON",
"T1.employeeid",
"=",
"T2.PCP",
"GROUP",
"BY",
"T1.employeeid"
] | [
"select",
"t1",
".",
"name",
",",
"count",
"(",
"*",
")",
"from",
"physician",
"as",
"t1",
"join",
"patient",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"pcp",
"group",
"by",
"t1",
".",
"employeeid"
] | [
"How",
"many",
"patients",
"do",
"each",
"physician",
"take",
"care",
"of",
"?",
"List",
"their",
"names",
"and",
"number",
"of",
"patients",
"they",
"take",
"care",
"of",
"."
] | [
"How",
"many",
"<mask>",
"do",
"each",
"<mask>",
"take",
"care",
"of",
"?",
"List",
"their",
"<mask>",
"and",
"number",
"of",
"<mask>",
"they",
"take",
"care",
"of",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
",",
"count",
"(",
"*",
")",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
".",
"<mask>"
] |
hospital_1 | SELECT T1.name , count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid | Return the name of each physician and the number of patients he or she treats. | [
"SELECT",
"T1.name",
",",
"count",
"(",
"*",
")",
"FROM",
"physician",
"AS",
"T1",
"JOIN",
"patient",
"AS",
"T2",
"ON",
"T1.employeeid",
"=",
"T2.PCP",
"GROUP",
"BY",
"T1.employeeid"
] | [
"select",
"t1",
".",
"name",
",",
"count",
"(",
"*",
")",
"from",
"physician",
"as",
"t1",
"join",
"patient",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"pcp",
"group",
"by",
"t1",
".",
"employeeid"
] | [
"Return",
"the",
"name",
"of",
"each",
"physician",
"and",
"the",
"number",
"of",
"patients",
"he",
"or",
"she",
"treats",
"."
] | [
"Return",
"the",
"<mask>",
"of",
"each",
"<mask>",
"and",
"the",
"number",
"of",
"<mask>",
"he",
"or",
"she",
"treats",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
",",
"count",
"(",
"*",
")",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
".",
"<mask>"
] |
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 | Find the name of physicians who are in charge of more than one patient. | [
"SELECT",
"T1.name",
"FROM",
"physician",
"AS",
"T1",
"JOIN",
"patient",
"AS",
"T2",
"ON",
"T1.employeeid",
"=",
"T2.PCP",
"GROUP",
"BY",
"T1.employeeid",
"HAVING",
"count",
"(",
"*",
")",
">",
"1"
] | [
"select",
"t1",
".",
"name",
"from",
"physician",
"as",
"t1",
"join",
"patient",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"pcp",
"group",
"by",
"t1",
".",
"employeeid",
"having",
"count",
"(",
"*",
")",
">",
"value"
] | [
"Find",
"the",
"name",
"of",
"physicians",
"who",
"are",
"in",
"charge",
"of",
"more",
"than",
"one",
"patient",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"<mask>",
"who",
"are",
"in",
"charge",
"of",
"more",
"than",
"one",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
".",
"<mask>",
"<mask>",
"count",
"(",
"*",
")",
">",
"<unk>"
] |
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 | Which physicians are in charge of more than one patient? Give me their names. | [
"SELECT",
"T1.name",
"FROM",
"physician",
"AS",
"T1",
"JOIN",
"patient",
"AS",
"T2",
"ON",
"T1.employeeid",
"=",
"T2.PCP",
"GROUP",
"BY",
"T1.employeeid",
"HAVING",
"count",
"(",
"*",
")",
">",
"1"
] | [
"select",
"t1",
".",
"name",
"from",
"physician",
"as",
"t1",
"join",
"patient",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"pcp",
"group",
"by",
"t1",
".",
"employeeid",
"having",
"count",
"(",
"*",
")",
">",
"value"
] | [
"Which",
"physicians",
"are",
"in",
"charge",
"of",
"more",
"than",
"one",
"patient",
"?",
"Give",
"me",
"their",
"names",
"."
] | [
"Which",
"<mask>",
"are",
"in",
"charge",
"of",
"more",
"than",
"one",
"<mask>",
"?",
"Give",
"me",
"their",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
".",
"<mask>",
"<mask>",
"count",
"(",
"*",
")",
">",
"<unk>"
] |
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 | Find the number of rooms located on each block floor. | [
"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"
] | [
"select",
"count",
"(",
"*",
")",
",",
"t1",
".",
"blockfloor",
"from",
"block",
"as",
"t1",
"join",
"room",
"as",
"t2",
"on",
"t1",
".",
"blockfloor",
"=",
"t2",
".",
"blockfloor",
"and",
"t1",
".",
"blockcode",
"=",
"t2",
".",
"blockcode",
"group",... | [
"Find",
"the",
"number",
"of",
"rooms",
"located",
"on",
"each",
"block",
"floor",
"."
] | [
"Find",
"the",
"number",
"of",
"<mask>",
"located",
"on",
"each",
"<mask>",
"<mask>",
"."
] | [
"select",
"count",
"(",
"*",
")",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"and",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>... |
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 | How many rooms does each block floor have? | [
"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"
] | [
"select",
"count",
"(",
"*",
")",
",",
"t1",
".",
"blockfloor",
"from",
"block",
"as",
"t1",
"join",
"room",
"as",
"t2",
"on",
"t1",
".",
"blockfloor",
"=",
"t2",
".",
"blockfloor",
"and",
"t1",
".",
"blockcode",
"=",
"t2",
".",
"blockcode",
"group",... | [
"How",
"many",
"rooms",
"does",
"each",
"block",
"floor",
"have",
"?"
] | [
"How",
"many",
"<mask>",
"does",
"each",
"<mask>",
"<mask>",
"have",
"?"
] | [
"select",
"count",
"(",
"*",
")",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"and",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>... |
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 | Find the number of rooms for different block code? | [
"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"
] | [
"select",
"count",
"(",
"*",
")",
",",
"t1",
".",
"blockcode",
"from",
"block",
"as",
"t1",
"join",
"room",
"as",
"t2",
"on",
"t1",
".",
"blockfloor",
"=",
"t2",
".",
"blockfloor",
"and",
"t1",
".",
"blockcode",
"=",
"t2",
".",
"blockcode",
"group",
... | [
"Find",
"the",
"number",
"of",
"rooms",
"for",
"different",
"block",
"code",
"?"
] | [
"Find",
"the",
"number",
"of",
"<mask>",
"for",
"different",
"<mask>",
"<mask>",
"?"
] | [
"select",
"count",
"(",
"*",
")",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"and",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>... |
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 | How many rooms are located for each block code? | [
"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"
] | [
"select",
"count",
"(",
"*",
")",
",",
"t1",
".",
"blockcode",
"from",
"block",
"as",
"t1",
"join",
"room",
"as",
"t2",
"on",
"t1",
".",
"blockfloor",
"=",
"t2",
".",
"blockfloor",
"and",
"t1",
".",
"blockcode",
"=",
"t2",
".",
"blockcode",
"group",
... | [
"How",
"many",
"rooms",
"are",
"located",
"for",
"each",
"block",
"code",
"?"
] | [
"How",
"many",
"<mask>",
"are",
"located",
"for",
"each",
"<mask>",
"<mask>",
"?"
] | [
"select",
"count",
"(",
"*",
")",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"and",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>... |
hospital_1 | SELECT DISTINCT blockcode FROM room WHERE unavailable = 0 | What are the unique block codes that have available rooms? | [
"SELECT",
"DISTINCT",
"blockcode",
"FROM",
"room",
"WHERE",
"unavailable",
"=",
"0"
] | [
"select",
"distinct",
"blockcode",
"from",
"room",
"where",
"unavailable",
"=",
"value"
] | [
"What",
"are",
"the",
"unique",
"block",
"codes",
"that",
"have",
"available",
"rooms",
"?"
] | [
"What",
"are",
"the",
"unique",
"<mask>",
"<mask>",
"that",
"have",
"available",
"<mask>",
"?"
] | [
"select",
"distinct",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"=",
"<unk>"
] |
hospital_1 | SELECT DISTINCT blockcode FROM room WHERE unavailable = 0 | Tell me the distinct block codes where some rooms are available. | [
"SELECT",
"DISTINCT",
"blockcode",
"FROM",
"room",
"WHERE",
"unavailable",
"=",
"0"
] | [
"select",
"distinct",
"blockcode",
"from",
"room",
"where",
"unavailable",
"=",
"value"
] | [
"Tell",
"me",
"the",
"distinct",
"block",
"codes",
"where",
"some",
"rooms",
"are",
"available",
"."
] | [
"Tell",
"me",
"the",
"distinct",
"<mask>",
"<mask>",
"where",
"some",
"<mask>",
"are",
"available",
"."
] | [
"select",
"distinct",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"=",
"<unk>"
] |
hospital_1 | SELECT count(DISTINCT roomtype) FROM room | How many different types of rooms are there? | [
"SELECT",
"count",
"(",
"DISTINCT",
"roomtype",
")",
"FROM",
"room"
] | [
"select",
"count",
"(",
"distinct",
"roomtype",
")",
"from",
"room"
] | [
"How",
"many",
"different",
"types",
"of",
"rooms",
"are",
"there",
"?"
] | [
"How",
"many",
"different",
"<mask>",
"of",
"<mask>",
"are",
"there",
"?"
] | [
"select",
"count",
"(",
"distinct",
"<mask>",
")",
"from",
"<mask>"
] |
hospital_1 | SELECT count(DISTINCT roomtype) FROM room | Find the number of distinct room types available. | [
"SELECT",
"count",
"(",
"DISTINCT",
"roomtype",
")",
"FROM",
"room"
] | [
"select",
"count",
"(",
"distinct",
"roomtype",
")",
"from",
"room"
] | [
"Find",
"the",
"number",
"of",
"distinct",
"room",
"types",
"available",
"."
] | [
"Find",
"the",
"number",
"of",
"distinct",
"<mask>",
"<mask>",
"available",
"."
] | [
"select",
"count",
"(",
"distinct",
"<mask>",
")",
"from",
"<mask>"
] |
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" | What is the names of the physicians who prescribe medication Thesisin? | [
"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",
... | [
"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",
".",
"medicati... | [
"What",
"is",
"the",
"names",
"of",
"the",
"physicians",
"who",
"prescribe",
"medication",
"Thesisin",
"?"
] | [
"What",
"is",
"the",
"<mask>",
"of",
"the",
"<mask>",
"who",
"prescribe",
"<mask>",
"Thesisin",
"?"
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
... |
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" | List the names of all the physicians who prescribe Thesisin as medication. | [
"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",
... | [
"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",
".",
"medicati... | [
"List",
"the",
"names",
"of",
"all",
"the",
"physicians",
"who",
"prescribe",
"Thesisin",
"as",
"medication",
"."
] | [
"List",
"the",
"<mask>",
"of",
"all",
"the",
"<mask>",
"who",
"prescribe",
"Thesisin",
"as",
"<mask>",
"."
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
... |
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" | Find the name and position of physicians who prescribe some medication whose brand is X? | [
"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",
"=",... | [
"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... | [
"Find",
"the",
"name",
"and",
"position",
"of",
"physicians",
"who",
"prescribe",
"some",
"medication",
"whose",
"brand",
"is",
"X",
"?"
] | [
"Find",
"the",
"<mask>",
"and",
"<mask>",
"of",
"<mask>",
"who",
"prescribe",
"some",
"<mask>",
"whose",
"<mask>",
"is",
"X",
"?"
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
... |
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" | Which physicians prescribe a medication of brand X? Tell me the name and position of those physicians. | [
"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",
"=",... | [
"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... | [
"Which",
"physicians",
"prescribe",
"a",
"medication",
"of",
"brand",
"X",
"?",
"Tell",
"me",
"the",
"name",
"and",
"position",
"of",
"those",
"physicians",
"."
] | [
"Which",
"<mask>",
"prescribe",
"a",
"<mask>",
"of",
"<mask>",
"X",
"?",
"Tell",
"me",
"the",
"<mask>",
"and",
"<mask>",
"of",
"those",
"<mask>",
"."
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
... |
hospital_1 | SELECT count(*) , T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand | Find the number of medications prescribed for each brand. | [
"SELECT",
"count",
"(",
"*",
")",
",",
"T1.name",
"FROM",
"medication",
"AS",
"T1",
"JOIN",
"prescribes",
"AS",
"T2",
"ON",
"T1.code",
"=",
"T2.medication",
"GROUP",
"BY",
"T1.brand"
] | [
"select",
"count",
"(",
"*",
")",
",",
"t1",
".",
"name",
"from",
"medication",
"as",
"t1",
"join",
"prescribes",
"as",
"t2",
"on",
"t1",
".",
"code",
"=",
"t2",
".",
"medication",
"group",
"by",
"t1",
".",
"brand"
] | [
"Find",
"the",
"number",
"of",
"medications",
"prescribed",
"for",
"each",
"brand",
"."
] | [
"Find",
"the",
"number",
"of",
"<mask>",
"prescribed",
"for",
"each",
"<mask>",
"."
] | [
"select",
"count",
"(",
"*",
")",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
".",
"<mask>"
] |
hospital_1 | SELECT count(*) , T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand | How many medications are prescribed for each brand? | [
"SELECT",
"count",
"(",
"*",
")",
",",
"T1.name",
"FROM",
"medication",
"AS",
"T1",
"JOIN",
"prescribes",
"AS",
"T2",
"ON",
"T1.code",
"=",
"T2.medication",
"GROUP",
"BY",
"T1.brand"
] | [
"select",
"count",
"(",
"*",
")",
",",
"t1",
".",
"name",
"from",
"medication",
"as",
"t1",
"join",
"prescribes",
"as",
"t2",
"on",
"t1",
".",
"code",
"=",
"t2",
".",
"medication",
"group",
"by",
"t1",
".",
"brand"
] | [
"How",
"many",
"medications",
"are",
"prescribed",
"for",
"each",
"brand",
"?"
] | [
"How",
"many",
"<mask>",
"are",
"prescribed",
"for",
"each",
"<mask>",
"?"
] | [
"select",
"count",
"(",
"*",
")",
",",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"group",
"by",
"<mask>",
".",
"<mask>"
] |
hospital_1 | SELECT name FROM physician WHERE POSITION LIKE '%senior%' | Find the name of physicians whose position title contains the word 'senior'. | [
"SELECT",
"name",
"FROM",
"physician",
"WHERE",
"POSITION",
"LIKE",
"'",
"%",
"senior",
"%",
"'"
] | [
"select",
"name",
"from",
"physician",
"where",
"position",
"like",
"value"
] | [
"Find",
"the",
"name",
"of",
"physicians",
"whose",
"position",
"title",
"contains",
"the",
"word",
"'senior",
"'",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"<mask>",
"whose",
"<mask>",
"title",
"contains",
"the",
"word",
"'senior",
"'",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"like",
"<unk>"
] |
hospital_1 | SELECT name FROM physician WHERE POSITION LIKE '%senior%' | What are the names of the physicians who have 'senior' in their titles. | [
"SELECT",
"name",
"FROM",
"physician",
"WHERE",
"POSITION",
"LIKE",
"'",
"%",
"senior",
"%",
"'"
] | [
"select",
"name",
"from",
"physician",
"where",
"position",
"like",
"value"
] | [
"What",
"are",
"the",
"names",
"of",
"the",
"physicians",
"who",
"have",
"'senior",
"'",
"in",
"their",
"titles",
"."
] | [
"What",
"are",
"the",
"<mask>",
"of",
"the",
"<mask>",
"who",
"have",
"'senior",
"'",
"in",
"their",
"titles",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"like",
"<unk>"
] |
hospital_1 | SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1 | Find the patient who has the most recent undergoing treatment? | [
"SELECT",
"patient",
"FROM",
"undergoes",
"ORDER",
"BY",
"dateundergoes",
"LIMIT",
"1"
] | [
"select",
"patient",
"from",
"undergoes",
"order",
"by",
"dateundergoes",
"limit",
"value"
] | [
"Find",
"the",
"patient",
"who",
"has",
"the",
"most",
"recent",
"undergoing",
"treatment",
"?"
] | [
"Find",
"the",
"<mask>",
"who",
"has",
"the",
"most",
"recent",
"undergoing",
"<mask>",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>",
"limit",
"<unk>"
] |
hospital_1 | SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1 | Which patient is undergoing the most recent treatment? | [
"SELECT",
"patient",
"FROM",
"undergoes",
"ORDER",
"BY",
"dateundergoes",
"LIMIT",
"1"
] | [
"select",
"patient",
"from",
"undergoes",
"order",
"by",
"dateundergoes",
"limit",
"value"
] | [
"Which",
"patient",
"is",
"undergoing",
"the",
"most",
"recent",
"treatment",
"?"
] | [
"Which",
"<mask>",
"is",
"undergoing",
"the",
"most",
"recent",
"<mask>",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>",
"limit",
"<unk>"
] |
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 | Find the names of all patients who have an undergoing treatment and are staying in room 111. | [
"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"
] | [
"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"... | [
"Find",
"the",
"names",
"of",
"all",
"patients",
"who",
"have",
"an",
"undergoing",
"treatment",
"and",
"are",
"staying",
"in",
"room",
"111",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"all",
"<mask>",
"who",
"have",
"an",
"undergoing",
"<mask>",
"and",
"are",
"<mask>",
"in",
"<mask>",
"<unk>",
"."
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
... |
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 | What are the names of patients who are staying in room 111 and have an undergoing treatment? | [
"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"
] | [
"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"... | [
"What",
"are",
"the",
"names",
"of",
"patients",
"who",
"are",
"staying",
"in",
"room",
"111",
"and",
"have",
"an",
"undergoing",
"treatment",
"?"
] | [
"What",
"are",
"the",
"<mask>",
"of",
"<mask>",
"who",
"are",
"<mask>",
"in",
"<mask>",
"<unk>",
"and",
"have",
"an",
"undergoing",
"<mask>",
"?"
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
... |
hospital_1 | SELECT DISTINCT name FROM nurse ORDER BY name | List the names of all distinct nurses ordered by alphabetical order? | [
"SELECT",
"DISTINCT",
"name",
"FROM",
"nurse",
"ORDER",
"BY",
"name"
] | [
"select",
"distinct",
"name",
"from",
"nurse",
"order",
"by",
"name"
] | [
"List",
"the",
"names",
"of",
"all",
"distinct",
"nurses",
"ordered",
"by",
"alphabetical",
"order",
"?"
] | [
"List",
"the",
"<mask>",
"of",
"all",
"distinct",
"<mask>",
"ordered",
"by",
"alphabetical",
"order",
"?"
] | [
"select",
"distinct",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>"
] |
hospital_1 | SELECT DISTINCT name FROM nurse ORDER BY name | What is the alphabetically ordered list of all the distinct names of nurses? | [
"SELECT",
"DISTINCT",
"name",
"FROM",
"nurse",
"ORDER",
"BY",
"name"
] | [
"select",
"distinct",
"name",
"from",
"nurse",
"order",
"by",
"name"
] | [
"What",
"is",
"the",
"alphabetically",
"ordered",
"list",
"of",
"all",
"the",
"distinct",
"names",
"of",
"nurses",
"?"
] | [
"What",
"is",
"the",
"alphabetically",
"ordered",
"list",
"of",
"all",
"the",
"distinct",
"<mask>",
"of",
"<mask>",
"?"
] | [
"select",
"distinct",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>"
] |
hospital_1 | SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID | Find the names of nurses who are nursing an undergoing treatment. | [
"SELECT",
"DISTINCT",
"T2.name",
"FROM",
"undergoes",
"AS",
"T1",
"JOIN",
"nurse",
"AS",
"T2",
"ON",
"T1.AssistingNurse",
"=",
"T2.EmployeeID"
] | [
"select",
"distinct",
"t2",
".",
"name",
"from",
"undergoes",
"as",
"t1",
"join",
"nurse",
"as",
"t2",
"on",
"t1",
".",
"assistingnurse",
"=",
"t2",
".",
"employeeid"
] | [
"Find",
"the",
"names",
"of",
"nurses",
"who",
"are",
"nursing",
"an",
"undergoing",
"treatment",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"<mask>",
"who",
"are",
"nursing",
"an",
"undergoing",
"<mask>",
"."
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>"
] |
hospital_1 | SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID | Which nurses are in charge of patients undergoing treatments? | [
"SELECT",
"DISTINCT",
"T2.name",
"FROM",
"undergoes",
"AS",
"T1",
"JOIN",
"nurse",
"AS",
"T2",
"ON",
"T1.AssistingNurse",
"=",
"T2.EmployeeID"
] | [
"select",
"distinct",
"t2",
".",
"name",
"from",
"undergoes",
"as",
"t1",
"join",
"nurse",
"as",
"t2",
"on",
"t1",
".",
"assistingnurse",
"=",
"t2",
".",
"employeeid"
] | [
"Which",
"nurses",
"are",
"in",
"charge",
"of",
"patients",
"undergoing",
"treatments",
"?"
] | [
"Which",
"<mask>",
"are",
"in",
"charge",
"of",
"<mask>",
"undergoing",
"<mask>",
"?"
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>"
] |
hospital_1 | SELECT DISTINCT name FROM medication ORDER BY name | List the names of all distinct medications, ordered in an alphabetical order. | [
"SELECT",
"DISTINCT",
"name",
"FROM",
"medication",
"ORDER",
"BY",
"name"
] | [
"select",
"distinct",
"name",
"from",
"medication",
"order",
"by",
"name"
] | [
"List",
"the",
"names",
"of",
"all",
"distinct",
"medications",
",",
"ordered",
"in",
"an",
"alphabetical",
"order",
"."
] | [
"List",
"the",
"<mask>",
"of",
"all",
"distinct",
"<mask>",
",",
"ordered",
"in",
"an",
"alphabetical",
"order",
"."
] | [
"select",
"distinct",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>"
] |
hospital_1 | SELECT DISTINCT name FROM medication ORDER BY name | What is the alphabetically ordered list of all distinct medications? | [
"SELECT",
"DISTINCT",
"name",
"FROM",
"medication",
"ORDER",
"BY",
"name"
] | [
"select",
"distinct",
"name",
"from",
"medication",
"order",
"by",
"name"
] | [
"What",
"is",
"the",
"alphabetically",
"ordered",
"list",
"of",
"all",
"distinct",
"medications",
"?"
] | [
"What",
"is",
"the",
"alphabetically",
"ordered",
"list",
"of",
"all",
"distinct",
"<mask>",
"?"
] | [
"select",
"distinct",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>"
] |
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 | What are the names of the physician who prescribed the highest dose? | [
"SELECT",
"T1.name",
"FROM",
"physician",
"AS",
"T1",
"JOIN",
"prescribes",
"AS",
"T2",
"ON",
"T1.employeeid",
"=",
"T2.physician",
"ORDER",
"BY",
"T2.dose",
"DESC",
"LIMIT",
"1"
] | [
"select",
"t1",
".",
"name",
"from",
"physician",
"as",
"t1",
"join",
"prescribes",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"physician",
"order",
"by",
"t2",
".",
"dose",
"desc",
"limit",
"value"
] | [
"What",
"are",
"the",
"names",
"of",
"the",
"physician",
"who",
"prescribed",
"the",
"highest",
"dose",
"?"
] | [
"What",
"are",
"the",
"<mask>",
"of",
"the",
"<mask>",
"who",
"prescribed",
"the",
"highest",
"<mask>",
"?"
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"order",
"by",
"<mask>",
".",
"<mask>",
"desc",
"limit",
"<unk>"
] |
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 | Find the physician who prescribed the highest dose. What is his or her name? | [
"SELECT",
"T1.name",
"FROM",
"physician",
"AS",
"T1",
"JOIN",
"prescribes",
"AS",
"T2",
"ON",
"T1.employeeid",
"=",
"T2.physician",
"ORDER",
"BY",
"T2.dose",
"DESC",
"LIMIT",
"1"
] | [
"select",
"t1",
".",
"name",
"from",
"physician",
"as",
"t1",
"join",
"prescribes",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"physician",
"order",
"by",
"t2",
".",
"dose",
"desc",
"limit",
"value"
] | [
"Find",
"the",
"physician",
"who",
"prescribed",
"the",
"highest",
"dose",
".",
"What",
"is",
"his",
"or",
"her",
"name",
"?"
] | [
"Find",
"the",
"<mask>",
"who",
"prescribed",
"the",
"highest",
"<mask>",
".",
"What",
"is",
"his",
"or",
"her",
"<mask>",
"?"
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"order",
"by",
"<mask>",
".",
"<mask>",
"desc",
"limit",
"<unk>"
] |
hospital_1 | SELECT physician , department FROM affiliated_with WHERE primaryaffiliation = 1 | List the physicians' employee ids together with their primary affiliation departments' ids. | [
"SELECT",
"physician",
",",
"department",
"FROM",
"affiliated_with",
"WHERE",
"primaryaffiliation",
"=",
"1"
] | [
"select",
"physician",
",",
"department",
"from",
"affiliated_with",
"where",
"primaryaffiliation",
"=",
"value"
] | [
"List",
"the",
"physicians",
"'",
"employee",
"ids",
"together",
"with",
"their",
"primary",
"affiliation",
"departments",
"'",
"ids",
"."
] | [
"List",
"the",
"<mask>",
"'",
"<mask>",
"ids",
"together",
"<mask>",
"their",
"<mask>",
"<mask>",
"<mask>",
"'",
"ids",
"."
] | [
"select",
"<mask>",
",",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"=",
"<unk>"
] |
hospital_1 | SELECT physician , department FROM affiliated_with WHERE primaryaffiliation = 1 | What are each physician's employee id and department id primarily affiliated. | [
"SELECT",
"physician",
",",
"department",
"FROM",
"affiliated_with",
"WHERE",
"primaryaffiliation",
"=",
"1"
] | [
"select",
"physician",
",",
"department",
"from",
"affiliated_with",
"where",
"primaryaffiliation",
"=",
"value"
] | [
"What",
"are",
"each",
"physician",
"'s",
"employee",
"id",
"and",
"department",
"id",
"primarily",
"affiliated",
"."
] | [
"What",
"are",
"each",
"<mask>",
"'s",
"<mask>",
"id",
"and",
"<mask>",
"id",
"primarily",
"affiliated",
"."
] | [
"select",
"<mask>",
",",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"=",
"<unk>"
] |
hospital_1 | SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1 | List the names of departments where some physicians are primarily affiliated with. | [
"SELECT",
"DISTINCT",
"T2.name",
"FROM",
"affiliated_with",
"AS",
"T1",
"JOIN",
"department",
"AS",
"T2",
"ON",
"T1.department",
"=",
"T2.departmentid",
"WHERE",
"PrimaryAffiliation",
"=",
"1"
] | [
"select",
"distinct",
"t2",
".",
"name",
"from",
"affiliated_with",
"as",
"t1",
"join",
"department",
"as",
"t2",
"on",
"t1",
".",
"department",
"=",
"t2",
".",
"departmentid",
"where",
"primaryaffiliation",
"=",
"value"
] | [
"List",
"the",
"names",
"of",
"departments",
"where",
"some",
"physicians",
"are",
"primarily",
"affiliated",
"with",
"."
] | [
"List",
"the",
"<mask>",
"of",
"<mask>",
"where",
"some",
"<mask>",
"are",
"primarily",
"affiliated",
"<mask>",
"."
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"where",
"<mask>",
"=",
"<unk>"
] |
hospital_1 | SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1 | What are the names of departments that have primarily affiliated physicians. | [
"SELECT",
"DISTINCT",
"T2.name",
"FROM",
"affiliated_with",
"AS",
"T1",
"JOIN",
"department",
"AS",
"T2",
"ON",
"T1.department",
"=",
"T2.departmentid",
"WHERE",
"PrimaryAffiliation",
"=",
"1"
] | [
"select",
"distinct",
"t2",
".",
"name",
"from",
"affiliated_with",
"as",
"t1",
"join",
"department",
"as",
"t2",
"on",
"t1",
".",
"department",
"=",
"t2",
".",
"departmentid",
"where",
"primaryaffiliation",
"=",
"value"
] | [
"What",
"are",
"the",
"names",
"of",
"departments",
"that",
"have",
"primarily",
"affiliated",
"physicians",
"."
] | [
"What",
"are",
"the",
"<mask>",
"of",
"<mask>",
"that",
"have",
"primarily",
"affiliated",
"<mask>",
"."
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"where",
"<mask>",
"=",
"<unk>"
] |
hospital_1 | SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1 | What nurses are on call with block floor 1 and block code 1? Tell me their names. | [
"SELECT",
"nurse",
"FROM",
"on_call",
"WHERE",
"blockfloor",
"=",
"1",
"AND",
"blockcode",
"=",
"1"
] | [
"select",
"nurse",
"from",
"on_call",
"where",
"blockfloor",
"=",
"value",
"and",
"blockcode",
"=",
"value"
] | [
"What",
"nurses",
"are",
"on",
"call",
"with",
"block",
"floor",
"1",
"and",
"block",
"code",
"1",
"?",
"Tell",
"me",
"their",
"names",
"."
] | [
"What",
"<mask>",
"are",
"on",
"<mask>",
"<mask>",
"<mask>",
"<mask>",
"<unk>",
"and",
"<mask>",
"<mask>",
"<unk>",
"?",
"Tell",
"me",
"their",
"<mask>",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"=",
"<unk>",
"and",
"<mask>",
"=",
"<unk>"
] |
hospital_1 | SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1 | Find the ids of the nurses who are on call in block floor 1 and block code 1. | [
"SELECT",
"nurse",
"FROM",
"on_call",
"WHERE",
"blockfloor",
"=",
"1",
"AND",
"blockcode",
"=",
"1"
] | [
"select",
"nurse",
"from",
"on_call",
"where",
"blockfloor",
"=",
"value",
"and",
"blockcode",
"=",
"value"
] | [
"Find",
"the",
"ids",
"of",
"the",
"nurses",
"who",
"are",
"on",
"call",
"in",
"block",
"floor",
"1",
"and",
"block",
"code",
"1",
"."
] | [
"Find",
"the",
"ids",
"of",
"the",
"<mask>",
"who",
"are",
"on",
"<mask>",
"in",
"<mask>",
"<mask>",
"<unk>",
"and",
"<mask>",
"<mask>",
"<unk>",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"=",
"<unk>",
"and",
"<mask>",
"=",
"<unk>"
] |
hospital_1 | SELECT MAX(cost) , MIN(cost) , AVG(cost) FROM procedures | What are the highest cost, lowest cost and average cost of procedures? | [
"SELECT",
"MAX",
"(",
"cost",
")",
",",
"MIN",
"(",
"cost",
")",
",",
"AVG",
"(",
"cost",
")",
"FROM",
"procedures"
] | [
"select",
"max",
"(",
"cost",
")",
",",
"min",
"(",
"cost",
")",
",",
"avg",
"(",
"cost",
")",
"from",
"procedures"
] | [
"What",
"are",
"the",
"highest",
"cost",
",",
"lowest",
"cost",
"and",
"average",
"cost",
"of",
"procedures",
"?"
] | [
"What",
"are",
"the",
"highest",
"<mask>",
",",
"lowest",
"<mask>",
"and",
"average",
"<mask>",
"of",
"procedures",
"?"
] | [
"select",
"max",
"(",
"<mask>",
")",
",",
"min",
"(",
"<mask>",
")",
",",
"avg",
"(",
"<mask>",
")",
"from",
"<mask>"
] |
hospital_1 | SELECT MAX(cost) , MIN(cost) , AVG(cost) FROM procedures | Tell me the highest, lowest, and average cost of procedures. | [
"SELECT",
"MAX",
"(",
"cost",
")",
",",
"MIN",
"(",
"cost",
")",
",",
"AVG",
"(",
"cost",
")",
"FROM",
"procedures"
] | [
"select",
"max",
"(",
"cost",
")",
",",
"min",
"(",
"cost",
")",
",",
"avg",
"(",
"cost",
")",
"from",
"procedures"
] | [
"Tell",
"me",
"the",
"highest",
",",
"lowest",
",",
"and",
"average",
"cost",
"of",
"procedures",
"."
] | [
"Tell",
"me",
"the",
"highest",
",",
"lowest",
",",
"and",
"average",
"<mask>",
"of",
"procedures",
"."
] | [
"select",
"max",
"(",
"<mask>",
")",
",",
"min",
"(",
"<mask>",
")",
",",
"avg",
"(",
"<mask>",
")",
"from",
"<mask>"
] |
hospital_1 | SELECT name , cost FROM procedures ORDER BY cost DESC | List the name and cost of all procedures sorted by the cost from the highest to the lowest. | [
"SELECT",
"name",
",",
"cost",
"FROM",
"procedures",
"ORDER",
"BY",
"cost",
"DESC"
] | [
"select",
"name",
",",
"cost",
"from",
"procedures",
"order",
"by",
"cost",
"desc"
] | [
"List",
"the",
"name",
"and",
"cost",
"of",
"all",
"procedures",
"sorted",
"by",
"the",
"cost",
"from",
"the",
"highest",
"to",
"the",
"lowest",
"."
] | [
"List",
"the",
"<mask>",
"and",
"<mask>",
"of",
"all",
"procedures",
"sorted",
"by",
"the",
"<mask>",
"from",
"the",
"highest",
"to",
"the",
"lowest",
"."
] | [
"select",
"<mask>",
",",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>",
"desc"
] |
hospital_1 | SELECT name , cost FROM procedures ORDER BY cost DESC | Sort the list of names and costs of all procedures in the descending order of cost. | [
"SELECT",
"name",
",",
"cost",
"FROM",
"procedures",
"ORDER",
"BY",
"cost",
"DESC"
] | [
"select",
"name",
",",
"cost",
"from",
"procedures",
"order",
"by",
"cost",
"desc"
] | [
"Sort",
"the",
"list",
"of",
"names",
"and",
"costs",
"of",
"all",
"procedures",
"in",
"the",
"descending",
"order",
"of",
"cost",
"."
] | [
"Sort",
"the",
"list",
"of",
"<mask>",
"and",
"<mask>",
"of",
"all",
"procedures",
"in",
"the",
"descending",
"order",
"of",
"<mask>",
"."
] | [
"select",
"<mask>",
",",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>",
"desc"
] |
hospital_1 | SELECT name FROM procedures ORDER BY cost LIMIT 3 | Find the three most expensive procedures. | [
"SELECT",
"name",
"FROM",
"procedures",
"ORDER",
"BY",
"cost",
"LIMIT",
"3"
] | [
"select",
"name",
"from",
"procedures",
"order",
"by",
"cost",
"limit",
"value"
] | [
"Find",
"the",
"three",
"most",
"expensive",
"procedures",
"."
] | [
"Find",
"the",
"three",
"most",
"expensive",
"procedures",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>",
"limit",
"<unk>"
] |
hospital_1 | SELECT name FROM procedures ORDER BY cost LIMIT 3 | What are the three most costly procedures? | [
"SELECT",
"name",
"FROM",
"procedures",
"ORDER",
"BY",
"cost",
"LIMIT",
"3"
] | [
"select",
"name",
"from",
"procedures",
"order",
"by",
"cost",
"limit",
"value"
] | [
"What",
"are",
"the",
"three",
"most",
"costly",
"procedures",
"?"
] | [
"What",
"are",
"the",
"three",
"most",
"costly",
"procedures",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"order",
"by",
"<mask>",
"limit",
"<unk>"
] |
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 | Find the physicians who are trained in a procedure that costs more than 5000. | [
"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"
] | [
"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",... | [
"Find",
"the",
"physicians",
"who",
"are",
"trained",
"in",
"a",
"procedure",
"that",
"costs",
"more",
"than",
"5000",
"."
] | [
"Find",
"the",
"<mask>",
"who",
"are",
"trained",
"in",
"a",
"procedure",
"that",
"<mask>",
"more",
"than",
"<unk>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
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 | Which physicians are trained in procedures that are more expensive than 5000? | [
"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"
] | [
"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",... | [
"Which",
"physicians",
"are",
"trained",
"in",
"procedures",
"that",
"are",
"more",
"expensive",
"than",
"5000",
"?"
] | [
"Which",
"<mask>",
"are",
"trained",
"in",
"procedures",
"that",
"are",
"more",
"expensive",
"than",
"<unk>",
"?"
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
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 | Find the physician who was trained in the most expensive procedure? | [
"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"
] | [
"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",... | [
"Find",
"the",
"physician",
"who",
"was",
"trained",
"in",
"the",
"most",
"expensive",
"procedure",
"?"
] | [
"Find",
"the",
"<mask>",
"who",
"was",
"trained",
"in",
"the",
"most",
"expensive",
"procedure",
"?"
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
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 | Which physician was trained in the procedure that costs the most. | [
"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"
] | [
"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",... | [
"Which",
"physician",
"was",
"trained",
"in",
"the",
"procedure",
"that",
"costs",
"the",
"most",
"."
] | [
"Which",
"<mask>",
"was",
"trained",
"in",
"the",
"procedure",
"that",
"<mask>",
"the",
"most",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
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" | What is the average cost of procedures that physician John Wen was trained in? | [
"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"... | [
"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",
".",
... | [
"What",
"is",
"the",
"average",
"cost",
"of",
"procedures",
"that",
"physician",
"John",
"Wen",
"was",
"trained",
"in",
"?"
] | [
"What",
"is",
"the",
"average",
"<mask>",
"of",
"procedures",
"that",
"<mask>",
"John",
"Wen",
"was",
"trained",
"in",
"?"
] | [
"select",
"avg",
"(",
"<mask>",
".",
"<mask>",
")",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"... |
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" | Compute the mean price of procedures physician John Wen was trained in. | [
"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"... | [
"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",
".",
... | [
"Compute",
"the",
"mean",
"price",
"of",
"procedures",
"physician",
"John",
"Wen",
"was",
"trained",
"in",
"."
] | [
"Compute",
"the",
"mean",
"price",
"of",
"procedures",
"<mask>",
"John",
"Wen",
"was",
"trained",
"in",
"."
] | [
"select",
"avg",
"(",
"<mask>",
".",
"<mask>",
")",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"... |
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" | Find the names of procedures which physician John Wen was trained in. | [
"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",
"''"
] | [
"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",... | [
"Find",
"the",
"names",
"of",
"procedures",
"which",
"physician",
"John",
"Wen",
"was",
"trained",
"in",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"procedures",
"which",
"<mask>",
"John",
"Wen",
"was",
"trained",
"in",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
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" | What are the names of procedures physician John Wen was trained in? | [
"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",
"''"
] | [
"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",... | [
"What",
"are",
"the",
"names",
"of",
"procedures",
"physician",
"John",
"Wen",
"was",
"trained",
"in",
"?"
] | [
"What",
"are",
"the",
"<mask>",
"of",
"procedures",
"<mask>",
"John",
"Wen",
"was",
"trained",
"in",
"?"
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
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" | Find all procedures which cost more than 1000 or which physician John Wen was trained in. | [
"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"... | [
"select",
"name",
"from",
"procedures",
"where",
"cost",
">",
"value",
"union",
"select",
"t3",
".",
"name",
"from",
"physician",
"as",
"t1",
"join",
"trained_in",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"physician",
"join",
"procedures"... | [
"Find",
"all",
"procedures",
"which",
"cost",
"more",
"than",
"1000",
"or",
"which",
"physician",
"John",
"Wen",
"was",
"trained",
"in",
"."
] | [
"Find",
"all",
"procedures",
"which",
"<mask>",
"more",
"than",
"<unk>",
"or",
"which",
"<mask>",
"John",
"Wen",
"was",
"trained",
"in",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
">",
"<unk>",
"union",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<ma... |
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" | What are the procedures that cost more than 1000 or are specialized in by physician John Wen? | [
"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"... | [
"select",
"name",
"from",
"procedures",
"where",
"cost",
">",
"value",
"union",
"select",
"t3",
".",
"name",
"from",
"physician",
"as",
"t1",
"join",
"trained_in",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"physician",
"join",
"procedures"... | [
"What",
"are",
"the",
"procedures",
"that",
"cost",
"more",
"than",
"1000",
"or",
"are",
"specialized",
"in",
"by",
"physician",
"John",
"Wen",
"?"
] | [
"What",
"are",
"the",
"procedures",
"that",
"<mask>",
"more",
"than",
"<unk>",
"or",
"are",
"specialized",
"in",
"by",
"<mask>",
"John",
"Wen",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
">",
"<unk>",
"union",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<ma... |
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" | Find the names of all procedures which cost more than 1000 but which physician John Wen was not trained in? | [
"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... | [
"select",
"name",
"from",
"procedures",
"where",
"cost",
">",
"value",
"except",
"select",
"t3",
".",
"name",
"from",
"physician",
"as",
"t1",
"join",
"trained_in",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"physician",
"join",
"procedures... | [
"Find",
"the",
"names",
"of",
"all",
"procedures",
"which",
"cost",
"more",
"than",
"1000",
"but",
"which",
"physician",
"John",
"Wen",
"was",
"not",
"trained",
"in",
"?"
] | [
"Find",
"the",
"<mask>",
"of",
"all",
"procedures",
"which",
"<mask>",
"more",
"than",
"<unk>",
"but",
"which",
"<mask>",
"John",
"Wen",
"was",
"not",
"trained",
"in",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
">",
"<unk>",
"except",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<m... |
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" | Among the procedures that cost more than 1000, which were not specialized in by physician John Wen? | [
"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... | [
"select",
"name",
"from",
"procedures",
"where",
"cost",
">",
"value",
"except",
"select",
"t3",
".",
"name",
"from",
"physician",
"as",
"t1",
"join",
"trained_in",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"physician",
"join",
"procedures... | [
"Among",
"the",
"procedures",
"that",
"cost",
"more",
"than",
"1000",
",",
"which",
"were",
"not",
"specialized",
"in",
"by",
"physician",
"John",
"Wen",
"?"
] | [
"Among",
"the",
"procedures",
"that",
"<mask>",
"more",
"than",
"<unk>",
",",
"which",
"were",
"not",
"specialized",
"in",
"by",
"<mask>",
"John",
"Wen",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
">",
"<unk>",
"except",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<m... |
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" | Find the names of all procedures such that the cost is less than 5000 and physician John Wen was trained in. | [
"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.c... | [
"select",
"name",
"from",
"procedures",
"where",
"cost",
"<",
"value",
"intersect",
"select",
"t3",
".",
"name",
"from",
"physician",
"as",
"t1",
"join",
"trained_in",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"physician",
"join",
"procedu... | [
"Find",
"the",
"names",
"of",
"all",
"procedures",
"such",
"that",
"the",
"cost",
"is",
"less",
"than",
"5000",
"and",
"physician",
"John",
"Wen",
"was",
"trained",
"in",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"all",
"procedures",
"such",
"that",
"the",
"<mask>",
"is",
"less",
"than",
"<unk>",
"and",
"<mask>",
"John",
"Wen",
"was",
"trained",
"in",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"<",
"<unk>",
"intersect",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
... |
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" | What procedures cost less than 5000 and have John Wen as a trained physician? | [
"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.c... | [
"select",
"name",
"from",
"procedures",
"where",
"cost",
"<",
"value",
"intersect",
"select",
"t3",
".",
"name",
"from",
"physician",
"as",
"t1",
"join",
"trained_in",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"physician",
"join",
"procedu... | [
"What",
"procedures",
"cost",
"less",
"than",
"5000",
"and",
"have",
"John",
"Wen",
"as",
"a",
"trained",
"physician",
"?"
] | [
"What",
"procedures",
"<mask>",
"less",
"than",
"<unk>",
"and",
"have",
"John",
"Wen",
"as",
"a",
"trained",
"<mask>",
"?"
] | [
"select",
"<mask>",
"from",
"<mask>",
"where",
"<mask>",
"<",
"<unk>",
"intersect",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
... |
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... | Find the name of physicians who are affiliated with both Surgery and Psychiatry departments. | [
"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",
"'",
"I... | [
"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",
".",
"departmenti... | [
"Find",
"the",
"name",
"of",
"physicians",
"who",
"are",
"affiliated",
"with",
"both",
"Surgery",
"and",
"Psychiatry",
"departments",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"<mask>",
"who",
"are",
"affiliated",
"<mask>",
"both",
"Surgery",
"and",
"Psychiatry",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
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... | Which physicians are affiliated with both Surgery and Psychiatry departments? Tell me their names. | [
"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",
"'",
"I... | [
"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",
".",
"departmenti... | [
"Which",
"physicians",
"are",
"affiliated",
"with",
"both",
"Surgery",
"and",
"Psychiatry",
"departments",
"?",
"Tell",
"me",
"their",
"names",
"."
] | [
"Which",
"<mask>",
"are",
"affiliated",
"<mask>",
"both",
"Surgery",
"and",
"Psychiatry",
"<mask>",
"?",
"Tell",
"me",
"their",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
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' | Find the name of physicians who are affiliated with Surgery or Psychiatry department. | [
"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",
"'",
"O... | [
"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",
".",
"departmenti... | [
"Find",
"the",
"name",
"of",
"physicians",
"who",
"are",
"affiliated",
"with",
"Surgery",
"or",
"Psychiatry",
"department",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"<mask>",
"who",
"are",
"affiliated",
"<mask>",
"Surgery",
"or",
"Psychiatry",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
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' | Which physicians are affiliated with either Surgery or Psychiatry department? Give me their names. | [
"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",
"'",
"O... | [
"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",
".",
"departmenti... | [
"Which",
"physicians",
"are",
"affiliated",
"with",
"either",
"Surgery",
"or",
"Psychiatry",
"department",
"?",
"Give",
"me",
"their",
"names",
"."
] | [
"Which",
"<mask>",
"are",
"affiliated",
"<mask>",
"either",
"Surgery",
"or",
"Psychiatry",
"<mask>",
"?",
"Give",
"me",
"their",
"<mask>",
"."
] | [
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mas... |
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' | Find the names of patients who are not using the medication of Procrastin-X. | [
"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",... | [
"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",
".",
"medicati... | [
"Find",
"the",
"names",
"of",
"patients",
"who",
"are",
"not",
"using",
"the",
"medication",
"of",
"Procrastin-X",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"<mask>",
"who",
"are",
"not",
"using",
"the",
"<mask>",
"of",
"Procrastin-X",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"except",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<ma... |
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' | What are the names of patients who are not taking the medication of Procrastin-X. | [
"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",... | [
"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",
".",
"medicati... | [
"What",
"are",
"the",
"names",
"of",
"patients",
"who",
"are",
"not",
"taking",
"the",
"medication",
"of",
"Procrastin-X",
"."
] | [
"What",
"are",
"the",
"<mask>",
"of",
"<mask>",
"who",
"are",
"not",
"taking",
"the",
"<mask>",
"of",
"Procrastin-X",
"."
] | [
"select",
"<mask>",
"from",
"<mask>",
"except",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<ma... |
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' ) | Find the number of patients who are not using the medication of Procrastin-X. | [
"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"... | [
"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",
... | [
"Find",
"the",
"number",
"of",
"patients",
"who",
"are",
"not",
"using",
"the",
"medication",
"of",
"Procrastin-X",
"."
] | [
"Find",
"the",
"number",
"of",
"<mask>",
"who",
"are",
"not",
"using",
"the",
"<mask>",
"of",
"Procrastin-X",
"."
] | [
"select",
"count",
"(",
"*",
")",
"from",
"<mask>",
"where",
"<mask>",
"not",
"in",
"(",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
... |
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' ) | How many patients are not using Procrastin-X as medication? | [
"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"... | [
"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",
... | [
"How",
"many",
"patients",
"are",
"not",
"using",
"Procrastin-X",
"as",
"medication",
"?"
] | [
"How",
"many",
"<mask>",
"are",
"not",
"using",
"Procrastin-X",
"as",
"<mask>",
"?"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"<mask>",
"where",
"<mask>",
"not",
"in",
"(",
"select",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>",
... |
hospital_1 | SELECT count(*) FROM appointment | How many appointments are there? | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"appointment"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"appointment"
] | [
"How",
"many",
"appointments",
"are",
"there",
"?"
] | [
"How",
"many",
"<mask>",
"are",
"there",
"?"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"<mask>"
] |
hospital_1 | SELECT count(*) FROM appointment | Count how many appointments have been made in total. | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"appointment"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"appointment"
] | [
"Count",
"how",
"many",
"appointments",
"have",
"been",
"made",
"in",
"total",
"."
] | [
"Count",
"how",
"many",
"<mask>",
"have",
"been",
"made",
"in",
"total",
"."
] | [
"select",
"count",
"(",
"*",
")",
"from",
"<mask>"
] |
hospital_1 | SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse | Find the names of nurses who are on call. | [
"SELECT",
"DISTINCT",
"T1.name",
"FROM",
"nurse",
"AS",
"T1",
"JOIN",
"on_call",
"AS",
"T2",
"ON",
"T1.EmployeeID",
"=",
"T2.nurse"
] | [
"select",
"distinct",
"t1",
".",
"name",
"from",
"nurse",
"as",
"t1",
"join",
"on_call",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"nurse"
] | [
"Find",
"the",
"names",
"of",
"nurses",
"who",
"are",
"on",
"call",
"."
] | [
"Find",
"the",
"<mask>",
"of",
"<mask>",
"who",
"are",
"on",
"<mask>",
"."
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>"
] |
hospital_1 | SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse | What are the distinct names of nurses on call? | [
"SELECT",
"DISTINCT",
"T1.name",
"FROM",
"nurse",
"AS",
"T1",
"JOIN",
"on_call",
"AS",
"T2",
"ON",
"T1.EmployeeID",
"=",
"T2.nurse"
] | [
"select",
"distinct",
"t1",
".",
"name",
"from",
"nurse",
"as",
"t1",
"join",
"on_call",
"as",
"t2",
"on",
"t1",
".",
"employeeid",
"=",
"t2",
".",
"nurse"
] | [
"What",
"are",
"the",
"distinct",
"names",
"of",
"nurses",
"on",
"call",
"?"
] | [
"What",
"are",
"the",
"distinct",
"<mask>",
"of",
"<mask>",
"on",
"<mask>",
"?"
] | [
"select",
"distinct",
"<mask>",
".",
"<mask>",
"from",
"<mask>",
"as",
"<mask>",
"join",
"<mask>",
"as",
"<mask>",
"on",
"<mask>",
".",
"<mask>",
"=",
"<mask>",
".",
"<mask>"
] |
ship_mission | SELECT count(*) FROM ship | How many ships are there? | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"ship"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"ship"
] | [
"How",
"many",
"ships",
"are",
"there",
"?"
] | [
"How",
"many",
"<mask>",
"are",
"there",
"?"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"<mask>"
] |
ship_mission | SELECT count(*) FROM ship | What is the number of ships? | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"ship"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"ship"
] | [
"What",
"is",
"the",
"number",
"of",
"ships",
"?"
] | [
"What",
"is",
"the",
"number",
"of",
"<mask>",
"?"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"<mask>"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.