db_id
stringclasses
11 values
instruction
stringlengths
1.63k
14k
role
stringclasses
45 values
policy
unknown
input
stringlengths
23
477
output
stringlengths
23
2.22k
difficulty
stringclasses
3 values
metadata
dict
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
Please list the patient's ID whose creatinine level is normal and whose anti Cardiolipin antibody concentration level is the highest.
SELECT T2.ID FROM Laboratory AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.CRE < 1.5 AND T2.`aCL IgA` IS NOT NULL ORDER BY T2.`aCL IgA` DESC LIMIT 1
moderate
{ "gold_sql": "SELECT T2.ID FROM Laboratory AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.CRE < 1.5 AND T2.`aCL IgA` IS NOT NULL ORDER BY T2.`aCL IgA` DESC LIMIT 1", "permission": "allowed", "query_columns": { "laboratory": [ "CRE", "ID" ], "examination": [ "ID", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
Among the patients whose total bilirubin is over the normal range, how many of them have a peripheral pattern observed in the sheet of ANA examination?
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.`T-BIL` >= 2 AND T3.`ANA Pattern` LIKE '%P%'
challenging
{ "gold_sql": "SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.`T-BIL` >= 2 AND T3.`ANA Pattern` LIKE '%P%'", "permission": "allowed", "query_columns": { "patient": [ "ID" ], "laboratory": [ "ID", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
What is the anti-nucleus antibody concentration of the patient whose total bilirubin is the highest in the normal range?
SELECT T1.ANA FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-BIL` < 2.0 ORDER BY T2.`T-BIL` DESC LIMIT 1
moderate
{ "gold_sql": "SELECT T1.ANA FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-BIL` < 2.0 ORDER BY T2.`T-BIL` DESC LIMIT 1", "permission": "allowed", "query_columns": { "examination": [ "ANA", "ID" ], "laboratory": [ "ID", "T-BIL" ] }, "mis...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
For the patients whose total cholesterol is higher than normal, how many of them have a negative measure of degree of coagulation?
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.`T-CHO` >= 250 AND T3.KCT = '-'
moderate
{ "gold_sql": "SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.`T-CHO` >= 250 AND T3.KCT = '-'", "permission": "allowed", "query_columns": { "patient": [ "ID" ], "laboratory": [ "ID", "T-CHO" ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
Among the patients whose total cholesterol is within the normal range, how many of them have a P pattern observed in the sheet of ANA examination?
SELECT COUNT(DISTINCT T1.ID) AS qualified_patient_count FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.`T-CHO` < 250 AND T3.`ANA Pattern` = 'P';
moderate
{ "gold_sql": "SELECT COUNT(DISTINCT T1.ID) AS qualified_patient_count\nFROM Patient AS T1\nINNER JOIN Laboratory AS T2 ON T1.ID = T2.ID \nINNER JOIN Examination AS T3 ON T1.ID = T3.ID \nWHERE \n T2.`T-CHO` < 250 \n AND T3.`ANA Pattern` = 'P';", "permission": "allowed", "query_columns": { "patient": [...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
Among the patients with the normal level of triglyceride, how many of them have other symptoms observed?
SELECT COUNT(DISTINCT T1.ID) FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG < 200 AND T1.Symptoms IS NOT NULL
simple
{ "gold_sql": "SELECT COUNT(DISTINCT T1.ID) \nFROM Examination AS T1 \nINNER JOIN Laboratory AS T2 ON T1.ID = T2.ID \nWHERE T2.TG < 200 \nAND T1.Symptoms IS NOT NULL", "permission": "allowed", "query_columns": { "examination": [ "ID", "Symptoms" ], "laboratory": [ "ID", "TG" ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
What is the disease name of the patient who has the highest level of triglyceride within the normal range?
SELECT T1.Diagnosis FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG < 200 ORDER BY T2.TG DESC LIMIT 1
moderate
{ "gold_sql": "SELECT T1.Diagnosis FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG < 200 ORDER BY T2.TG DESC LIMIT 1", "permission": "allowed", "query_columns": { "examination": [ "Diagnosis", "ID" ], "laboratory": [ "ID", "TG" ] }, "miss...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
Please list the IDs of the patients with no thrombosis and an abnormal level of creatinine phosphokinase.
SELECT DISTINCT T1.ID FROM Laboratory AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Thrombosis = 0 AND T1.CPK < 250
simple
{ "gold_sql": "SELECT DISTINCT T1.ID FROM Laboratory AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Thrombosis = 0 AND T1.CPK < 250", "permission": "allowed", "query_columns": { "laboratory": [ "CPK", "ID" ], "examination": [ "ID", "Thrombosis" ] }, "missi...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
For the patients with a normal range of creatinine phosphokinase, how many of them have a positive measure of degree of coagulation?
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.CPK < 250 AND (T3.KCT = '+' OR T3.RVVT = '+' OR T3.LAC = '+')
challenging
{ "gold_sql": "SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.CPK < 250 AND (T3.KCT = '+' OR T3.RVVT = '+' OR T3.LAC = '+')", "permission": "allowed", "query_columns": { "patient": [ "ID" ], "laboratory":...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
When is the birthday of the oldest patient whose blood glucose is abnormal?
SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GLU > 180 ORDER BY T1.Birthday ASC LIMIT 1
simple
{ "gold_sql": "SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GLU > 180 ORDER BY T1.Birthday ASC LIMIT 1", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "laboratory": [ "GLU", "ID" ] }, "missing...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
Among the patients with a normal blood glucose, how many of them don't have thrombosis?
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.GLU < 180 AND T3.Thrombosis = 0
moderate
{ "gold_sql": "SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.GLU < 180 AND T3.Thrombosis = 0", "permission": "allowed", "query_columns": { "patient": [ "ID" ], "laboratory": [ "GLU", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
How many patients accepted to the hospital have a normal level of white blood cells?
Sorry, I cannot answer.
moderate
{ "gold_sql": "SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.WBC BETWEEN 3.5 AND 9 AND T1.Admission = '+'", "permission": "denied", "query_columns": { "patient": [ "Admission", "ID" ], "laboratory": [ "ID", "WBC" ] }, "miss...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
How many patients diagnosed with SLE have a normal white blood cell level?
Sorry, I cannot answer.
simple
{ "gold_sql": "SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Diagnosis = 'SLE' AND T2.WBC BETWEEN 3.5 AND 9", "permission": "denied", "query_columns": { "patient": [ "Diagnosis", "ID" ], "laboratory": [ "ID", "WBC" ] }, "mi...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
Please list the patient's ID if he or she has an abnormal level of red blood cell and is followed at the outpatient clinic.
Sorry, I cannot answer.
challenging
{ "gold_sql": "SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.RBC <= 3.5 OR T2.RBC >= 6) AND T1.Admission = '-'", "permission": "denied", "query_columns": { "patient": [ "Admission", "ID" ], "laboratory": [ "ID", "RBC" ] },...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
Among the patients who have a normal platelet level, how many of them have other symptoms observed?
Sorry, I cannot answer.
moderate
{ "gold_sql": "SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.PLT > 100 AND T2.PLT < 400 AND T1.Diagnosis IS NOT NULL", "permission": "denied", "query_columns": { "patient": [ "Diagnosis", "ID" ], "laboratory": [ "ID", "PLT" ] ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
Please list a patient's platelet level if it is within the normal range and if he or she is diagnosed with MCTD.
Sorry, I cannot answer.
moderate
{ "gold_sql": "SELECT T2.PLT FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Diagnosis = 'MCTD' AND T2.PLT BETWEEN 100 AND 400", "permission": "denied", "query_columns": { "patient": [ "Diagnosis", "ID" ], "laboratory": [ "ID", "PLT" ] }, "missi...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
For the male patients that have a normal prothrombin time, what is their average prothrombin time?
SELECT AVG(T2.PT) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.PT < 14 AND T1.SEX = 'M'
simple
{ "gold_sql": "SELECT AVG(T2.PT) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.PT < 14 AND T1.SEX = 'M'", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "laboratory": [ "ID", "PT" ] }, "missing_columns": {}, "reason"...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalResearcher
{ "Examination": [ "ID", "Examination Date", "aCL IgG", "aCL IgM", "ANA", "ANA Pattern", "aCL IgA", "Diagnosis", "KCT", "RVVT", "LAC", "Symptoms", "Thrombosis" ], "Patient": [ "ID", "SEX", "Birthday" ], "Laboratory": [ "ID", "Date", "...
How many patients with severe thrombosis have a normal prothrombin time?
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.PT < 14 AND T3.Thrombosis < 3 AND T3.Thrombosis > 0
moderate
{ "gold_sql": "SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.PT < 14 AND T3.Thrombosis < 3 AND T3.Thrombosis > 0", "permission": "allowed", "query_columns": { "patient": [ "ID" ], "laboratory": [ "...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Are there more in-patient or outpatient who were male? What is the deviation in percentage?
SELECT CAST(SUM(CASE WHEN Admission = '+' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN Admission = '-' THEN 1 ELSE 0 END) FROM Patient WHERE SEX = 'M'
moderate
{ "gold_sql": "SELECT CAST(SUM(CASE WHEN Admission = '+' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN Admission = '-' THEN 1 ELSE 0 END) FROM Patient WHERE SEX = 'M'", "permission": "allowed", "query_columns": { "patient": [ "Admission", "SEX" ] }, "missing_columns": {}, "reason": "...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the percentage of female patient were born after 1930?
SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', Birthday) > '1930' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient WHERE SEX = 'F'
moderate
{ "gold_sql": "SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', Birthday) > '1930' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient WHERE SEX = 'F'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "SEX" ] }, "missing_columns": {}, "reason": "All required columns ar...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For patient born between Year 1930 to 1940, how many percent of them were inpatient?
SELECT CAST(SUM(CASE WHEN Admission = '+' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient WHERE STRFTIME('%Y', Birthday) BETWEEN '1930' AND '1940'
moderate
{ "gold_sql": "SELECT CAST(SUM(CASE WHEN Admission = '+' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient WHERE STRFTIME('%Y', Birthday) BETWEEN '1930' AND '1940'", "permission": "allowed", "query_columns": { "patient": [ "Admission", "Birthday" ] }, "missing_columns": {}, "reas...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the ratio of outpatient to inpatient followed up treatment among all the 'SLE' diagnosed patient?
SELECT SUM(CASE WHEN Admission = '-' THEN 1.0 ELSE 0 END) / NULLIF(SUM(CASE WHEN Admission = '+' THEN 1 ELSE 0 END), 0) FROM Patient WHERE Diagnosis = 'SLE'
moderate
{ "gold_sql": "SELECT SUM(CASE WHEN Admission = '-' THEN 1.0 ELSE 0 END) / NULLIF(SUM(CASE WHEN Admission = '+' THEN 1 ELSE 0 END), 0) FROM Patient WHERE Diagnosis = 'SLE'", "permission": "allowed", "query_columns": { "patient": [ "Admission", "Diagnosis" ] }, "missing_columns": {}, "rea...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the disease patient '30609' diagnosed with. List all the date of laboratory tests done for this patient.
SELECT T1.Diagnosis, T2.Date FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.ID = 30609
simple
{ "gold_sql": "SELECT T1.Diagnosis, T2.Date FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.ID = 30609", "permission": "allowed", "query_columns": { "patient": [ "Diagnosis", "ID" ], "laboratory": [ "Date", "ID" ] }, "missing_columns": {}, "re...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
State the sex and birthday of patient ID '163109'. When was the examination taken and what symptom does the patient had.
SELECT T1.SEX, T1.Birthday, T2.`Examination Date`, T2.Symptoms FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.ID = 163109
simple
{ "gold_sql": "SELECT T1.SEX, T1.Birthday, T2.`Examination Date`, T2.Symptoms FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.ID = 163109", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID", "SEX" ], "examination": [ "Examinatio...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
List the patient ID, sex and birthday of patient with LDH beyond normal range.
SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH > 500
simple
{ "gold_sql": "SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH > 500", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID", "SEX" ], "laboratory": [ "ID", "LDH" ] }, "mis...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
State the ID and age of patient with positive degree of coagulation.
SELECT DISTINCT T1.ID, STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) AS Age FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.RVVT = '+'
moderate
{ "gold_sql": "SELECT DISTINCT T1.ID, STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) AS Age FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.RVVT = '+'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "examination": [ ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For patients with severe degree of thrombosis, list their ID, sex and disease the patient is diagnosed with.
SELECT DISTINCT T1.ID, T1.SEX, T1.Diagnosis FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Thrombosis = 2
simple
{ "gold_sql": "SELECT DISTINCT T1.ID, T1.SEX, T1.Diagnosis FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Thrombosis = 2", "permission": "allowed", "query_columns": { "patient": [ "Diagnosis", "ID", "SEX" ], "examination": [ "ID", "Thrombosis" ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
List all patients who were born in 1937 whose total cholesterol was beyond the normal range.
SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T1.Birthday) = '1937' AND T2.`T-CHO` >= 250
moderate
{ "gold_sql": "SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T1.Birthday) = '1937' AND T2.`T-CHO` >= 250", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "laboratory": [ "ID", "T-CHO" ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For patient with albumin level lower than 3.5, list their ID, sex and diagnosis.
SELECT DISTINCT T1.ID, T1.SEX, T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.ALB < 3.5
simple
{ "gold_sql": "SELECT DISTINCT T1.ID, T1.SEX, T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.ALB < 3.5", "permission": "allowed", "query_columns": { "patient": [ "Diagnosis", "ID", "SEX" ], "laboratory": [ "ALB", "ID" ] }, "m...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the percentage of female patient had total protein not within the normal range?
SELECT CAST(SUM(CASE WHEN T1.SEX = 'F' AND (T2.TP < 6.0 OR T2.TP > 8.5) THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F'
moderate
{ "gold_sql": "SELECT CAST(SUM(CASE WHEN T1.SEX = 'F' AND (T2.TP < 6.0 OR T2.TP > 8.5) THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F'", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For in-patients, what is the average IgG concentration measured when they were age 50 or above?
SELECT AVG(T2.`aCL IgG`) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T2.`Examination Date`) - STRFTIME('%Y', T1.Birthday) >= 50 AND T1.Admission = '+'
challenging
{ "gold_sql": "SELECT AVG(T2.`aCL IgG`)\nFROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID \nWHERE STRFTIME('%Y', T2.`Examination Date`) - STRFTIME('%Y', T1.Birthday) >= 50 AND T1.Admission = '+'", "permission": "allowed", "query_columns": { "patient": [ "Admission", "Birthday", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many female patients who came at the hospital in 1997 was immediately followed at the outpatient clinic?
Sorry, I cannot answer.
moderate
{ "gold_sql": "SELECT COUNT(*) FROM Patient WHERE STRFTIME('%Y', Description) = '1997' AND SEX = 'F' AND Admission = '-'", "permission": "denied", "query_columns": { "patient": [ "Admission", "Description", "SEX" ] }, "missing_columns": { "patient": [ "Description" ] ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What was the age of the youngest patient when they initially arrived at the hospital?
SELECT MIN(STRFTIME('%Y', `First Date`) - STRFTIME('%Y', Birthday)) FROM Patient
simple
{ "gold_sql": "SELECT MIN(STRFTIME('%Y', `First Date`) - STRFTIME('%Y', Birthday)) FROM Patient", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "First Date" ] }, "missing_columns": {}, "reason": "All required columns are permitted", "question_id": 1163, "eviden...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many of the patients with the most serious thrombosis cases examined in 1997 are women?
SELECT COUNT(*) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F' AND STRFTIME('%Y', T2.`Examination Date`) = '1997' AND T2.Thrombosis = 1
moderate
{ "gold_sql": "SELECT COUNT(*) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F' AND STRFTIME('%Y', T2.`Examination Date`) = '1997' AND T2.Thrombosis = 1", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "examination": [ "Exa...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the age gap between the youngest and oldest patient with a normal triglyceride recorded?
SELECT STRFTIME('%Y', MAX(T1.Birthday)) - STRFTIME('%Y', MIN(T1.Birthday)) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG >= 200
moderate
{ "gold_sql": "SELECT STRFTIME('%Y', MAX(T1.Birthday)) - STRFTIME('%Y', MIN(T1.Birthday)) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG >= 200", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "laboratory": [ "ID", "TG"...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What are the symptoms observed by the youngest patient to ever did a medical examination? Identify their diagnosis.
SELECT T2.Symptoms, T1.Diagnosis FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Symptoms IS NOT NULL ORDER BY T1.Birthday DESC LIMIT 1
simple
{ "gold_sql": "SELECT T2.Symptoms, T1.Diagnosis FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Symptoms IS NOT NULL ORDER BY T1.Birthday DESC LIMIT 1", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "Diagnosis", "ID" ], "examination": ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For the year that concluded on December 31, 1998, how many male patients on average were tested in the lab each month?
SELECT CAST(COUNT(T1.ID) AS REAL) / 12 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T2.Date) = '1998' AND T1.SEX = 'M'
moderate
{ "gold_sql": "SELECT CAST(COUNT(T1.ID) AS REAL) / 12 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T2.Date) = '1998' AND T1.SEX = 'M'", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "laboratory": [ "Date", "ID" ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
The oldest SJS patient's latest medical laboratory work was completed on what date, and what age was the patient when they initially arrived at the hospital?
SELECT Max(T1.Date) AS LatestLabDate, STRFTIME('%Y', T2.`First Date`) - STRFTIME('%Y', T2.Birthday) AS AgeFirstArrived,T2.Birthday FROM Laboratory AS T1 INNER JOIN Patient AS T2 ON T1.ID = T2.ID WHERE T2.ID = (SELECT ID FROM Patient WHERE Diagnosis = 'SJS' AND Birthday IS NOT NULL ORDER BY Birthday ASC LIMIT 1)
challenging
{ "gold_sql": "SELECT Max(T1.Date) AS LatestLabDate, STRFTIME('%Y', T2.`First Date`) - STRFTIME('%Y', T2.Birthday) AS AgeFirstArrived,T2.Birthday FROM Laboratory AS T1 INNER JOIN Patient AS T2 ON T1.ID = T2.ID WHERE T2.ID = (SELECT ID FROM Patient WHERE Diagnosis = 'SJS' AND Birthday IS NOT NULL ORDER BY Birthday ASC...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the ratio of male to female patients among all those with abnormal uric acid counts?
SELECT CAST(SUM(CASE WHEN T2.UA <= 8.0 AND T1.SEX = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.UA <= 6.5 AND T1.SEX = 'F' THEN 1 ELSE 0 END) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID
challenging
{ "gold_sql": "SELECT CAST(SUM(CASE WHEN T2.UA <= 8.0 AND T1.SEX = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.UA <= 6.5 AND T1.SEX = 'F' THEN 1 ELSE 0 END) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX"...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many patients hadn't undergone a medical examination until at least a year following their initial hospital visit?
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.Admission = '+' AND JULIANDAY(T2.`Examination Date`) - JULIANDAY(T1.`First Date`) >= 365
moderate
{ "gold_sql": "SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.Admission = '+' AND JULIANDAY(T2.`Examination Date`) - JULIANDAY(T1.`First Date`) >= 365", "permission": "allowed", "query_columns": { "patient": [ "Admission", "First Date", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many underage patients were examined during the course of the three-year period from 1990 to 1993?
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T2.`Examination Date`) BETWEEN '1990' AND '1993' AND STRFTIME('%Y', T2.`Examination Date`) - STRFTIME('%Y', T1.Birthday) < 18
challenging
{ "gold_sql": "SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T2.`Examination Date`) BETWEEN '1990' AND '1993' AND STRFTIME('%Y', T2.`Examination Date`) - STRFTIME('%Y', T1.Birthday) < 18", "permission": "allowed", "query_columns": { "patient": [ ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many male patients have elevated total bilirubin count?
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-BIL` >= 2.0 AND T1.SEX = 'M'
simple
{ "gold_sql": "SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-BIL` >= 2.0 AND T1.SEX = 'M'", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "laboratory": [ "ID", "T-BIL" ] }, "missing_col...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the most common illness that doctors identified among the patients whose lab work was done between 1/1/1985 and 12/31/1995?
SELECT T2.Diagnosis FROM Examination AS T1 INNER JOIN Patient AS T2 ON T1.ID = T2.ID WHERE T1.`Examination Date` BETWEEN '1985-01-01' AND '1995-12-31' GROUP BY T2.Diagnosis ORDER BY COUNT(T2.Diagnosis) DESC, T2.Diagnosis DESC LIMIT 1
challenging
{ "gold_sql": "SELECT T2.Diagnosis FROM Examination AS T1 INNER JOIN Patient AS T2 ON T1.ID = T2.ID WHERE T1.`Examination Date` BETWEEN '1985-01-01' AND '1995-12-31' GROUP BY T2.Diagnosis ORDER BY COUNT(T2.Diagnosis) DESC, T2.Diagnosis DESC LIMIT 1", "permission": "allowed", "query_columns": { "patient": [ ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the average age of patients as of year 1999 examined in the laboratory for the October of the year 1991?
SELECT AVG('1999' - STRFTIME('%Y', T2.Birthday)) FROM Laboratory AS T1 INNER JOIN Patient AS T2 ON T1.ID = T2.ID WHERE T1.Date BETWEEN '1991-10-01' AND '1991-10-30'
moderate
{ "gold_sql": "SELECT AVG('1999' - STRFTIME('%Y', T2.Birthday)) FROM Laboratory AS T1 INNER JOIN Patient AS T2 ON T1.ID = T2.ID WHERE T1.Date BETWEEN '1991-10-01' AND '1991-10-30'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "laboratory": [ "Date", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How old was the patient who had the highest hemoglobin count on the date of laboratory tests , and what is the doctor's diagnosis?
SELECT STRFTIME('%Y', T2.Date) - STRFTIME('%Y', T1.Birthday), T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.HGB = (SELECT MAX(HGB) FROM Laboratory)
moderate
{ "gold_sql": "SELECT STRFTIME('%Y', T2.Date) - STRFTIME('%Y', T1.Birthday), T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.HGB = (SELECT MAX(HGB) FROM Laboratory)", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "Diagnosis", "ID" ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What was the anti-nucleus antibody concentration level for the patient id 3605340 on 1996/12/2?
SELECT ANA FROM Examination WHERE ID = 3605340 AND `Examination Date` = '1996-12-02'
simple
{ "gold_sql": "SELECT ANA FROM Examination WHERE ID = 3605340 AND `Examination Date` = '1996-12-02'", "permission": "allowed", "query_columns": { "examination": [ "ANA", "Examination Date", "ID" ] }, "missing_columns": {}, "reason": "All required columns are permitted", "question...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Was the total cholesterol status for the patient id 2927464 on 1995-9-4 at the normal level?
SELECT CASE WHEN `T-CHO` < 250 THEN 'Normal' ELSE 'Abnormal' END FROM Laboratory WHERE ID = 2927464 AND Date = '1995-09-04'
simple
{ "gold_sql": "SELECT CASE WHEN `T-CHO` < 250 THEN 'Normal' ELSE 'Abnormal' END FROM Laboratory WHERE ID = 2927464 AND Date = '1995-09-04'", "permission": "allowed", "query_columns": { "laboratory": [ "ID", "T-CHO" ] }, "missing_columns": {}, "reason": "All required columns are permitted...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What was the gender of the first AORTITIS diagnosed patient?
SELECT SEX FROM Patient WHERE Diagnosis = 'AORTITIS' AND `First Date` IS NOT NULL ORDER BY `First Date` ASC, ID DESC LIMIT 1
simple
{ "gold_sql": "SELECT SEX FROM Patient WHERE Diagnosis = 'AORTITIS' AND `First Date` IS NOT NULL ORDER BY `First Date` ASC, ID DESC LIMIT 1", "permission": "allowed", "query_columns": { "patient": [ "Diagnosis", "First Date", "ID", "SEX" ] }, "missing_columns": {}, "reason": ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For the patient who was diagnosed with SLE on 1994/2/19, what was his/her anti-Cardiolipin antibody concentration status on 1993/11/12?
Sorry, I cannot answer.
moderate
{ "gold_sql": "SELECT `aCL IgA`, `aCL IgG`, `aCL IgM` FROM Examination WHERE ID IN ( SELECT ID FROM Patient WHERE Diagnosis = 'SLE' AND Description = '1994-02-19' ) AND `Examination Date` = '1993-11-12'", "permission": "denied", "query_columns": { "patient": [ "Description", "Diagnosis", "ID...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Was the patient a man or a woman whose ALT glutamic pylvic transaminase status got 9 on 1992-6-12?
SELECT T1.SEX FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GPT = 9 AND T2.Date = '1992-06-12'
moderate
{ "gold_sql": "SELECT T1.SEX FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GPT = 9 AND T2.Date = '1992-06-12'", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "laboratory": [ "Date", "GPT", "ID" ] }, "missing_col...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For the patient who got the laboratory test of uric acid level as 8.4 on 1991-10-21, how old was he/she at that time?
SELECT STRFTIME('%Y', T2.`Date`) - STRFTIME('%Y', T1.Birthday) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.UA = 8.4 AND T2.`Date` = '1991-10-21'
moderate
{ "gold_sql": "SELECT STRFTIME('%Y', T2.`Date`) - STRFTIME('%Y', T1.Birthday) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.UA = 8.4 AND T2.`Date` = '1991-10-21'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "laboratory": [ ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For the patient who first came to the hospital on 1991/6/13 who was diagnosed with SJS, what is the total number of his/her Laboratory tests in 1995?
SELECT COUNT(*) FROM Laboratory WHERE ID = ( SELECT ID FROM Patient WHERE `First Date` = '1991-06-13' AND Diagnosis = 'SJS' ) AND STRFTIME('%Y', Date) = '1995'
moderate
{ "gold_sql": "SELECT COUNT(*) FROM Laboratory WHERE ID = ( SELECT ID FROM Patient WHERE `First Date` = '1991-06-13' AND Diagnosis = 'SJS' ) AND STRFTIME('%Y', Date) = '1995'", "permission": "allowed", "query_columns": { "patient": [ "Diagnosis", "First Date", "ID" ], "laboratory": [...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For the patient who was diagnosed SLE on 1997/1/27, what was his/her original diagnose when he/she came to the hospital for the first time?
SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.ID = ( SELECT ID FROM Examination WHERE `Examination Date` = '1997-01-27' AND Diagnosis = 'SLE' ORDER BY ID ASC LIMIT 1 ) AND T2.`Examination Date` = T1.`First Date`
challenging
{ "gold_sql": "SELECT T1.Diagnosis \nFROM Patient AS T1 \nINNER JOIN Examination AS T2 ON T1.ID = T2.ID \nWHERE T1.ID = ( \n SELECT ID \n FROM Examination \n WHERE `Examination Date` = '1997-01-27' AND Diagnosis = 'SLE' \n ORDER BY ID ASC \n LIMIT 1 \n) \nAND T2.`Examination Date` = T1.`First Date`", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For the patient whose birthday was 1959/3/1, what symptoms did he/she have during the examination on 1993/9/27?
SELECT T2.Symptoms FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.Birthday = '1959-03-01' AND T2.`Examination Date` = '1993-09-27'
simple
{ "gold_sql": "SELECT T2.Symptoms FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.Birthday = '1959-03-01' AND T2.`Examination Date` = '1993-09-27'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "examination": [ "Examination Da...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For the patient who was born on 1959/2/18, what is the decrease rate for his/her total cholesterol from November to December in 1981?
SELECT CAST((SUM(CASE WHEN T2.Date LIKE '1981-11-%' THEN T2.`T-CHO` ELSE 0 END) - SUM(CASE WHEN T2.Date LIKE '1981-12-%' THEN T2.`T-CHO` ELSE 0 END)) AS REAL) / SUM(CASE WHEN T2.Date LIKE '1981-12-%' THEN T2.`T-CHO` ELSE 0 END) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Birthday = '1959-02...
challenging
{ "gold_sql": "SELECT CAST((SUM(CASE WHEN T2.Date LIKE '1981-11-%' THEN T2.`T-CHO` ELSE 0 END) - SUM(CASE WHEN T2.Date LIKE '1981-12-%' THEN T2.`T-CHO` ELSE 0 END)) AS REAL) / SUM(CASE WHEN T2.Date LIKE '1981-12-%' THEN T2.`T-CHO` ELSE 0 END) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Bi...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Lists all patients by ID who were diagnosed with Behcet's and had their exams between 01/01/197 and 12/31/1997.
SELECT ID FROM Examination WHERE `Examination Date` BETWEEN '1997-01-01' AND '1997-12-31' AND Diagnosis = 'Behcet'
moderate
{ "gold_sql": "SELECT ID FROM Examination WHERE `Examination Date` BETWEEN '1997-01-01' AND '1997-12-31' AND Diagnosis = 'Behcet'", "permission": "allowed", "query_columns": { "examination": [ "Diagnosis", "Examination Date", "ID" ] }, "missing_columns": {}, "reason": "All required...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many patients who were examined between 1987/7/6 and 1996/1/31 had a GPT level greater than 30 and an ALB level less than 4? List them by their ID.
SELECT DISTINCT ID FROM Laboratory WHERE Date BETWEEN '1987-07-06' AND '1996-01-31' AND GPT > 30 AND ALB < 4
moderate
{ "gold_sql": "SELECT DISTINCT ID FROM Laboratory WHERE Date BETWEEN '1987-07-06' AND '1996-01-31' AND GPT > 30 AND ALB < 4", "permission": "allowed", "query_columns": { "laboratory": [ "ALB", "GPT", "ID" ] }, "missing_columns": {}, "reason": "All required columns are permitted", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many female patients born in 1964 were admitted to the hospital? List them by ID.
SELECT ID FROM Patient WHERE STRFTIME('%Y', Birthday) = '1964' AND SEX = 'F' AND Admission = '+'
simple
{ "gold_sql": "SELECT ID FROM Patient WHERE STRFTIME('%Y', Birthday) = '1964' AND SEX = 'F' AND Admission = '+'", "permission": "allowed", "query_columns": { "patient": [ "Admission", "Birthday", "ID", "SEX" ] }, "missing_columns": {}, "reason": "All required columns are perm...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What number of patients with a degree of thrombosis level 2 and ANA pattern of only S, have a level of anti-Cardiolipin antibody (IgM) 20% higher than average?
SELECT COUNT(*) FROM Examination WHERE Thrombosis = 2 AND `ANA Pattern` = 'S' AND `aCL IgM` > (SELECT AVG(`aCL IgM`) * 1.2 FROM Examination WHERE Thrombosis = 2 AND `ANA Pattern` = 'S')
challenging
{ "gold_sql": "SELECT COUNT(*) FROM Examination WHERE Thrombosis = 2 AND `ANA Pattern` = 'S' AND `aCL IgM` > (SELECT AVG(`aCL IgM`) * 1.2 FROM Examination WHERE Thrombosis = 2 AND `ANA Pattern` = 'S')", "permission": "allowed", "query_columns": { "examination": [ "ANA Pattern", "Thrombosis", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What percentage of patients with a proteinuria level within the normal range have a uric acid level below the normal range?
SELECT CAST(SUM(CASE WHEN UA <= 6.5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(ID) FROM Laboratory WHERE CAST(`U-PRO` AS REAL) > 0 AND CAST(`U-PRO` AS REAL) < 30
challenging
{ "gold_sql": "SELECT CAST(SUM(CASE WHEN UA <= 6.5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(ID) FROM Laboratory WHERE CAST(`U-PRO` AS REAL) > 0 AND CAST(`U-PRO` AS REAL) < 30", "permission": "allowed", "query_columns": { "laboratory": [ "ID", "U-PRO", "UA" ] }, "missing_columns": {}...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What percentage of male patients who first presented to the hospital in 1981 were diagnosed with BEHCET?
SELECT CAST(SUM(CASE WHEN Diagnosis = 'BEHCET' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(ID) FROM Patient WHERE STRFTIME('%Y', `First Date`) = '1981' AND SEX = 'M'
challenging
{ "gold_sql": "SELECT CAST(SUM(CASE WHEN Diagnosis = 'BEHCET' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(ID) FROM Patient WHERE STRFTIME('%Y', `First Date`) = '1981' AND SEX = 'M'", "permission": "allowed", "query_columns": { "patient": [ "Diagnosis", "First Date", "ID", "SEX" ] }...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
List all patients who were followed up at the outpatient clinic who underwent a laboratory test in October 1991 and had a total blood bilirubin level within the normal range.
SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Admission = '-' AND T2.`T-BIL` < 2.0 AND T2.Date LIKE '1991-10-%'
challenging
{ "gold_sql": "SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Admission = '-' AND T2.`T-BIL` < 2.0 AND T2.Date LIKE '1991-10-%'", "permission": "allowed", "query_columns": { "patient": [ "Admission", "ID" ], "laboratory": [ "Date", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Excluding all P only ANA Pattern patients, how many of the remainder are women born between 1980 and 1989?
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.`ANA Pattern` != 'P' AND STRFTIME('%Y', T1.Birthday) BETWEEN '1980' AND '1989' AND T1.SEX = 'F'
moderate
{ "gold_sql": "SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.`ANA Pattern` != 'P' AND STRFTIME('%Y', T1.Birthday) BETWEEN '1980' AND '1989' AND T1.SEX = 'F'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID", "...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What sex is the patient who in a medical examination was diagnosed with PSS and in a laboratory examination had a blood level of C-reactive protein de 2+, createnine 1 and LDH 123?
SELECT T1.SEX FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID INNER JOIN Laboratory AS T3 ON T3.ID = T2.ID WHERE T2.Diagnosis = 'PSS' AND T3.CRP = '2+' AND T3.CRE = 1.0 AND T3.LDH = 123
challenging
{ "gold_sql": "SELECT T1.SEX FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID INNER JOIN Laboratory AS T3 ON T3.ID = T2.ID WHERE T2.Diagnosis = 'PSS' AND T3.CRP = '2+' AND T3.CRE = 1.0 AND T3.LDH = 123", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the average blood albumin level for female patients with a PLT greater than 400 who have been diagnosed with SLE?
SELECT AVG(T2.ALB) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.PLT > 400 AND T1.Diagnosis = 'SLE' AND T1.SEX = 'F'
moderate
{ "gold_sql": "SELECT AVG(T2.ALB) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.PLT > 400 AND T1.Diagnosis = 'SLE' AND T1.SEX = 'F'", "permission": "allowed", "query_columns": { "patient": [ "Diagnosis", "ID", "SEX" ], "laboratory": [ "ALB", "ID...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the most common sign of patients with SLE disease?
SELECT Symptoms FROM Examination WHERE Diagnosis = 'SLE' GROUP BY Symptoms ORDER BY COUNT(Symptoms) DESC LIMIT 1
simple
{ "gold_sql": "SELECT Symptoms FROM Examination WHERE Diagnosis = 'SLE' GROUP BY Symptoms ORDER BY COUNT(Symptoms) DESC LIMIT 1", "permission": "allowed", "query_columns": { "examination": [ "Diagnosis", "Symptoms" ] }, "missing_columns": {}, "reason": "All required columns are permitted...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
When was the medical information on patient number 48473 first documented, and what disease did she have?
SELECT `First Date`, Diagnosis FROM Patient WHERE ID = 48473
simple
{ "gold_sql": "SELECT `First Date`, Diagnosis FROM Patient WHERE ID = 48473", "permission": "allowed", "query_columns": { "patient": [ "Diagnosis", "First Date", "ID" ] }, "missing_columns": {}, "reason": "All required columns are permitted", "question_id": 1197, "evidence": "m...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many female patients were given an APS diagnosis?
SELECT COUNT(ID) FROM Patient WHERE SEX = 'F' AND Diagnosis = 'APS'
simple
{ "gold_sql": "SELECT COUNT(ID) FROM Patient WHERE SEX = 'F' AND Diagnosis = 'APS'", "permission": "allowed", "query_columns": { "patient": [ "Diagnosis", "ID", "SEX" ] }, "missing_columns": {}, "reason": "All required columns are permitted", "question_id": 1198, "evidence": "f...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many patients who underwent testing in 1997 had protein levels outside the normal range?
SELECT COUNT(DISTINCT ID) AS abnormal_protein_patient_count FROM Laboratory WHERE (TP <= 6.0 OR TP >= 8.5) AND STRFTIME('%Y', Date) = '1997';
simple
{ "gold_sql": "SELECT COUNT(DISTINCT ID) AS abnormal_protein_patient_count\nFROM Laboratory\nWHERE \n (TP <= 6.0 OR TP >= 8.5) \n AND STRFTIME('%Y', Date) = '1997';", "permission": "allowed", "query_columns": { "laboratory": [ "ID", "TP" ] }, "missing_columns": {}, "reason": "All requi...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What proportion of patients who had signs of thrombocytopenia had SLE diagnosed?
SELECT CAST(SUM(CASE WHEN Diagnosis LIKE '%SLE%' THEN 1 ELSE 0 END) AS REAL) * 100 / NULLIF(COUNT(DISTINCT ID), 0) AS proportion FROM Examination WHERE Symptoms = 'thrombocytopenia';
moderate
{ "gold_sql": "SELECT \n CAST(SUM(CASE WHEN Diagnosis LIKE '%SLE%' THEN 1 ELSE 0 END) AS REAL) * 100 / NULLIF(COUNT(DISTINCT ID), 0) AS proportion\nFROM Examination \nWHERE Symptoms = 'thrombocytopenia';", "permission": "allowed", "query_columns": { "examination": [ "Diagnosis", "ID", "Sy...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What percentage of patients who were born in 1980 and were diagnosed with RA are women?
SELECT CAST(SUM(CASE WHEN SEX = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(ID) FROM Patient WHERE Diagnosis = 'RA' AND STRFTIME('%Y', Birthday) = '1980'
moderate
{ "gold_sql": "SELECT CAST(SUM(CASE WHEN SEX = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(ID) FROM Patient WHERE Diagnosis = 'RA' AND STRFTIME('%Y', Birthday) = '1980'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "Diagnosis", "ID", "SEX" ] }, "missi...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many male patients who underwent testing between 1995 and 1997 and were subsequently diagnosed with Behcet disease did not stay in the hospital for treatment?
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Diagnosis = 'Behcet' AND T1.SEX = 'M' AND STRFTIME('%Y', T2.`Examination Date`) BETWEEN '1995' AND '1997' AND T1.Admission = '-'
challenging
{ "gold_sql": "SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Diagnosis = 'Behcet' AND T1.SEX = 'M' AND STRFTIME('%Y', T2.`Examination Date`) BETWEEN '1995' AND '1997' AND T1.Admission = '-'", "permission": "allowed", "query_columns": { "patient": [ "Admiss...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many patients who were female got white blood cells that were below 3.5?
SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.WBC < 3.5 AND T1.SEX = 'F'
simple
{ "gold_sql": "SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.WBC < 3.5 AND T1.SEX = 'F'", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "laboratory": [ "ID", "WBC" ] }, "missing_columns": {}, "re...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How long did it take after patient number 821298 arrived at the hospital for the first time before her first evaluation began?
SELECT MIN(JULIANDAY(T3.`Examination Date`)) - JULIANDAY(T1.`First Date`) FROM Patient AS T1 INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T1.ID = 821298
simple
{ "gold_sql": "SELECT MIN(JULIANDAY(T3.`Examination Date`)) - JULIANDAY(T1.`First Date`) FROM Patient AS T1 INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T1.ID = 821298", "permission": "allowed", "query_columns": { "patient": [ "First Date", "ID" ], "examination": [ "Examinatio...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Was the patient with the number 57266's uric acid within a normal range?
SELECT CASE WHEN (T1.SEX = 'F' AND T2.UA > 6.5) OR (T1.SEX = 'M' AND T2.UA > 8.0) THEN true ELSE false END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.ID = 57266
moderate
{ "gold_sql": "SELECT CASE WHEN (T1.SEX = 'F' AND T2.UA > 6.5) OR (T1.SEX = 'M' AND T2.UA > 8.0) THEN true ELSE false END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.ID = 57266", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "laborator...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
When is the laboratory examination of patient '48473' where his/her AST glutamic oxaloacetic transaminase (GOT) index is above the normal range.
SELECT Date FROM Laboratory WHERE ID = 48473 AND GOT >= 60
simple
{ "gold_sql": "SELECT Date FROM Laboratory WHERE ID = 48473 AND GOT >= 60", "permission": "allowed", "query_columns": { "laboratory": [ "GOT", "ID" ] }, "missing_columns": {}, "reason": "All required columns are permitted", "question_id": 1206, "evidence": "AST glutamic oxaloacetic t...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
List all patients with their sex and date of birthday, whose AST glutamic oxaloacetic transaminase (GOT) index is within normal range for laboratory examination in 1994.
SELECT DISTINCT T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT < 60 AND STRFTIME('%Y', T2.Date) = '1994'
moderate
{ "gold_sql": "SELECT DISTINCT T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT < 60 AND STRFTIME('%Y', T2.Date) = '1994'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID", "SEX" ], "laboratory": [ "Date"...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Provide IDs for male patients with ALT glutamic pylvic transaminase (GPT) that have history of ALT glutamic pylvic transaminase (GPT) exceed the normal range.
SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'M' AND T2.GPT >= 60
moderate
{ "gold_sql": "SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'M' AND T2.GPT >= 60", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "laboratory": [ "GPT", "ID" ] }, "missing_columns": {}, "...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Please provide the diagnosis of patients with ALT glutamic pylvic transaminase beyond the normal range by ascending order of their date of birth.
SELECT DISTINCT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GPT > 60 ORDER BY T1.Birthday ASC
moderate
{ "gold_sql": "SELECT DISTINCT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GPT > 60 ORDER BY T1.Birthday ASC", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "Diagnosis", "ID" ], "laboratory": [ "GPT", "ID" ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the average index of the lactate dehydrogenase (LDH) for all patients with lactate dehydrogenase (LDH) within the normal range.
SELECT AVG(LDH) FROM Laboratory WHERE LDH < 500
simple
{ "gold_sql": "SELECT AVG(LDH) FROM Laboratory WHERE LDH < 500", "permission": "allowed", "query_columns": { "laboratory": [ "LDH" ] }, "missing_columns": {}, "reason": "All required columns are permitted", "question_id": 1210, "evidence": "average index of the lactate dehydrogenase (LDH) ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Provide the ID and age of patient with lactate dehydrogenase (LDH) between 100-300 index above the normal range.
SELECT DISTINCT T1.ID, STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH > 600 AND T2.LDH < 800
moderate
{ "gold_sql": "SELECT DISTINCT T1.ID, STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH > 600 AND T2.LDH < 800", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "laborato...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For patients with alkaliphophatase (ALP) within normal range, were they treated as inpatient or outpatient?
SELECT T1.Admission FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.ALP < 300
moderate
{ "gold_sql": "SELECT T1.Admission FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.ALP < 300", "permission": "allowed", "query_columns": { "patient": [ "Admission", "ID" ], "laboratory": [ "ALP", "ID" ] }, "missing_columns": {}, "reason": "All...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Name the ID of the patient who is born on the April 1st, 1982. Is his/her alkaliphophatase (ALP) within normal range?
SELECT T1.ID , CASE WHEN T2.ALP < 300 THEN 'normal' ELSE 'abNormal' END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Birthday = '1982-04-01'
moderate
{ "gold_sql": "SELECT T1.ID , CASE WHEN T2.ALP < 300 THEN 'normal' ELSE 'abNormal' END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Birthday = '1982-04-01'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "laboratory": [ "ALP"...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
List ID, sex and date of birth of the patient whose total protein (TP) is below the lower range of the normal index.
SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TP < 6.0
simple
{ "gold_sql": "SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TP < 6.0", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID", "SEX" ], "laboratory": [ "ID", "TP" ] }, "missi...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For all female patient with total protein (TP) beyond the normal index, what is the deviation of their TP index from the normal?
SELECT T2.TP - 8.5 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F' AND T2.TP > 8.5
moderate
{ "gold_sql": "SELECT T2.TP - 8.5 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F' AND T2.TP > 8.5", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "laboratory": [ "ID", "TP" ] }, "missing_columns": {}, "reaso...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Sort in descending order all patients by birthday for male patient with albumin not within range.
SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'M' AND (T2.ALB <= 3.5 OR T2.ALB >= 5.5) ORDER BY T1.Birthday DESC
simple
{ "gold_sql": "SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'M' AND (T2.ALB <= 3.5 OR T2.ALB >= 5.5) ORDER BY T1.Birthday DESC", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID", "SEX" ], "laboratory": [...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For all patient born in 1982, state if their albumin is within normal range.
SELECT CASE WHEN T2.ALB >= 3.5 AND T2.ALB <= 5.5 THEN 'normal' ELSE 'abnormal' END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T1.Birthday) = '1982'
moderate
{ "gold_sql": "SELECT CASE WHEN T2.ALB >= 3.5 AND T2.ALB <= 5.5 THEN 'normal' ELSE 'abnormal' END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T1.Birthday) = '1982'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "labor...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the percentage of the female patient whose uric acid (UA) beyond the normal range?
SELECT CAST(SUM(CASE WHEN T2.UA > 6.5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F'
moderate
{ "gold_sql": "SELECT CAST(SUM(CASE WHEN T2.UA > 6.5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F'", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "laboratory": [ "ID", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For all patients with normal uric acid (UA), what is the average UA index based on their latest laboratory examination result?
SELECT AVG(T2.UA) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.UA < 6.5 AND T1.SEX = 'F') OR (T2.UA < 8.0 AND T1.SEX = 'M') AND T2.Date = ( SELECT MAX(Date) FROM Laboratory )
moderate
{ "gold_sql": "SELECT AVG(T2.UA) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.UA < 6.5 AND T1.SEX = 'F') OR (T2.UA < 8.0 AND T1.SEX = 'M') AND T2.Date = ( SELECT MAX(Date) FROM Laboratory )", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Provide all ID, sex and birthday of patients whose urea nitrogen (UN) just within the borderline of passing?
SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.UN = 29
simple
{ "gold_sql": "SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.UN = 29", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID", "SEX" ], "laboratory": [ "ID", "UN" ] }, "missin...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Provide the ID, sex, birthday of all patients diagnosed with 'RA' that are within the UN normal index.
SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.UN < 30 AND T1.Diagnosis = 'RA'
simple
{ "gold_sql": "SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.UN < 30 AND T1.Diagnosis = 'RA'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "Diagnosis", "ID", "SEX" ], "laboratory": [ ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
How many male patients have creatinine index out of the normal range?
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.CRE >= 1.5 AND T1.SEX = 'M'
simple
{ "gold_sql": "SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.CRE >= 1.5 AND T1.SEX = 'M'", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "laboratory": [ "CRE", "ID" ] }, "missing_columns":...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Are there more male patients with creatinine not within the normal range than female? True or False?
SELECT CASE WHEN SUM(CASE WHEN T1.SEX = 'M' THEN 1 ELSE 0 END) > SUM(CASE WHEN T1.SEX = 'F' THEN 1 ELSE 0 END) THEN 'True' ELSE 'False' END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.CRE >= 1.5
challenging
{ "gold_sql": "SELECT CASE WHEN SUM(CASE WHEN T1.SEX = 'M' THEN 1 ELSE 0 END) > SUM(CASE WHEN T1.SEX = 'F' THEN 1 ELSE 0 END) THEN 'True' ELSE 'False' END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.CRE >= 1.5", "permission": "allowed", "query_columns": { "patient": [ "ID", ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the highest total bilirubin level recorded? List out the patient details with ID, sex and birthday with that index.
SELECT T2.`T-BIL`, T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID ORDER BY T2.`T-BIL` DESC LIMIT 1
simple
{ "gold_sql": "SELECT T2.`T-BIL`, T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID ORDER BY T2.`T-BIL` DESC LIMIT 1", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID", "SEX" ], "laboratory": [ "ID", "T-BIL...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
List and group all patients by sex for total bilirubin (T-BIL) level not within the normal range.
SELECT T1.ID,T1.SEX FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-BIL` >= 2.0 GROUP BY T1.SEX,T1.ID
moderate
{ "gold_sql": "SELECT T1.ID,T1.SEX FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-BIL` >= 2.0 GROUP BY T1.SEX,T1.ID", "permission": "allowed", "query_columns": { "patient": [ "ID", "SEX" ], "laboratory": [ "ID", "T-BIL" ] }, "missing_columns...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Who is the oldest patient with the highest total cholesterol (T-CHO). State the patient ID and T-CHO index.
SELECT T1.ID, T2.`T-CHO` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID ORDER BY T2.`T-CHO` DESC, T1.Birthday ASC LIMIT 1
simple
{ "gold_sql": "SELECT T1.ID, T2.`T-CHO` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID ORDER BY T2.`T-CHO` DESC, T1.Birthday ASC LIMIT 1", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "laboratory": [ "ID", "T-CHO" ] }, "m...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
What is the average age of the male patient with high cholesterol?
SELECT AVG(STRFTIME('%Y', date('NOW')) - STRFTIME('%Y', T1.Birthday)) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-CHO` >= 250 AND T1.SEX = 'M'
moderate
{ "gold_sql": "SELECT AVG(STRFTIME('%Y', date('NOW')) - STRFTIME('%Y', T1.Birthday)) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-CHO` >= 250 AND T1.SEX = 'M'", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID", "SEX" ], "laborat...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
Provide list of patients and their diagnosis with triglyceride (TG) index greater than 100 of the normal range?
SELECT DISTINCT T1.ID, T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG > 300
simple
{ "gold_sql": "SELECT DISTINCT T1.ID, T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG > 300", "permission": "allowed", "query_columns": { "patient": [ "Diagnosis", "ID" ], "laboratory": [ "ID", "TG" ] }, "missing_columns": {}, ...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
For all patients with triglyceride (TG) level beyond the normal range, how many are age more than 50 years?
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG >= 200 AND STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) > 50
moderate
{ "gold_sql": "SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG >= 200 AND STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) > 50", "permission": "allowed", "query_columns": { "patient": [ "Birthday", "ID" ], "laboratory...
thrombosis_prediction
##Instruction: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Database: thrombosis_prediction Total Tables: 3 Total Columns: 64 Table Schemas: Table: Examination (13 columns) ------------------------------- • ID (integer): identification of the patient • Examination Date (date): Ex...
ClinicalDiagnostician
{ "Examination": [ "*" ], "Patient": [ "ID", "SEX", "Birthday", "First Date", "Admission", "Diagnosis" ], "Laboratory": [ "*" ] }
List all outpatient within normal range of creatinine phosphokinase. Give me the distinct ids.
SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.CPK < 250 AND T1.Admission = '-'
simple
{ "gold_sql": "SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.CPK < 250 AND T1.Admission = '-'", "permission": "allowed", "query_columns": { "patient": [ "Admission", "ID" ], "laboratory": [ "CPK", "ID" ] }, "missing_colum...