question stringlengths 23 286 | sql stringlengths 29 1.45k | db_id stringclasses 11
values | prompt stringlengths 1.09k 6.84k | question_id int64 0 1.53k | difficulty stringclasses 3
values |
|---|---|---|---|---|---|
What proportion of patients who had signs of thrombocytopenia had SLE diagnosed? | SELECT CAST(SUM(CASE WHEN Diagnosis = 'SLE' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(ID) FROM Examination WHERE Symptoms = 'thrombocytopenia' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,200 | moderate |
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' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,201 | moderate |
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 = '-' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,202 | challenging |
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' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,203 | simple |
How long did it take after patient number 821298 arrived at the hospital for the first time before her evaluation began? | SELECT STRFTIME('%d', T3.`Examination Date`) - STRFTIME('%d', T1.`First Date`) FROM Patient AS T1 INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T1.ID = 821298 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,204 | simple |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,205 | moderate |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,206 | simple |
List all patients with their sex and date of birthday, whose AST glutamic oxaloacetic transaminase (GOT) index is within normal range for loboratory 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' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,207 | moderate |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,208 | moderate |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,209 | moderate |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,210 | simple |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,211 | moderate |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,212 | moderate |
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' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,213 | moderate |
List ID, sex and date of birth of patient whose total protein (TP) 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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,214 | simple |
For all female patient with total protein (TP) beyond the normal index, what is the deviation of their TP idex 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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,215 | moderate |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,216 | simple |
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' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,217 | moderate |
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' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,218 | moderate |
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 ) | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,219 | moderate |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,220 | simple |
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' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,221 | simple |
How many male patients are are with creatinine index out of the normal range? | SELECT COUNT(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' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,222 | simple |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,223 | challenging |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,224 | simple |
List and group all patients by sex for total bilirubin (T-BIL) level not within the normal range. | SELECT DISTINCT CASE WHEN T1.SEX = 'F' THEN T1.ID END , CASE WHEN T1.SEX = 'M' THEN T1.ID END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-BIL` >= 2.0 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,225 | moderate |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,226 | simple |
What is the average age of the male patient with high cholesterol? | SELECT AVG(STRFTIME('%Y', CURRENT_TIMESTAMP) - 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' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,227 | moderate |
Provide list of patients and their diagnosis with triglyceride (TG) index greater than 100 of the normal range? | SELECT T1.ID, T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG > 300 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,228 | simple |
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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,229 | moderate |
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 = '-' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,230 | simple |
For patient born between 1936-1956, how many male patients have creatinine phosphokinase beyond the normal range? | SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T1.Birthday) BETWEEN '1936' AND '1956' AND T1.SEX = 'M' AND T2.CPK >= 250 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,231 | challenging |
Provide ID, sex and age of patient who has blood glucose (GLU) not within normal range but with total cholesterol(T-CHO) within normal range. | SELECT DISTINCT T1.ID, T1.SEX , STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GLU >= 180 AND T2.`T-CHO` < 250 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,232 | challenging |
List each patient's ID and blood glucose (GLU) index that were within normal range for patient's whose data was first recorded in 1991. | SELECT DISTINCT T1.ID, T2.GLU FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T1.`First Date`) = '1991' AND T2.GLU < 180 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,233 | moderate |
List the patient ID, sex and birthday who has abnormal white blood cell count. Group them by sex and list the patient by age in ascending order. | SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.WBC <= 3.5 OR T2.WBC >= 9.0 GROUP BY T1.SEX,T1.ID ORDER BY T1.Birthday ASC | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,234 | moderate |
What are the patient's diagnosis for those who has lower red blood blood cell? State their ID and age. | SELECT T1.Diagnosis, 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.RBC < 3.5 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,235 | moderate |
For all the female patient age 50 and above, who has abnormal red blood cell count. State if they were admitted to hospital. | SELECT DISTINCT T1.ID, T1.Admission FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F' AND (T2.RBC <= 3.5 OR T2.RBC >= 6.0) AND STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) >= 50 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,236 | challenging |
Among all outpatients, list out those have low hemoglobin level. State the different IDs and their sex. | SELECT DISTINCT T1.ID, T1.SEX FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.HGB < 10 AND T1.Admission = '-' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,237 | simple |
Among the patients who were diagnosed with SLE, who is the oldest with normal hemoglobin level. Provide the ID and sex. | SELECT T1.ID, T1.SEX FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Diagnosis = 'SLE' AND T2.HGB > 10 AND T2.HGB < 17 ORDER BY T1.Birthday ASC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,238 | moderate |
Name the ID and age of patient with two or more laboratory examinations which show their hematoclit level exceeded 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 T1.ID IN ( SELECT ID FROM Laboratory WHERE HCT >= 52 GROUP BY ID HAVING COUNT(ID) >= 2 ) | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,239 | challenging |
From laboratory examinations in 1991, what is the average hematoclit level that is lower than the normal range. | SELECT AVG(T2.HCT) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.HCT < 29 AND STRFTIME('%Y', T2.Date) = '1991' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,240 | moderate |
For patients with abnormal platelet level, state the number of patients with lower than normal range. How is it compare to the number of patients with higher than normal range? | SELECT SUM(CASE WHEN T2.PLT < 100 THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.PLT > 400 THEN 1 ELSE 0 END) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,241 | challenging |
For laboratory examinations take in 1984, list all patients below 50 years old with normal platelet level. | SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.PLT BETWEEN 100 AND 400 AND STRFTIME('%Y', T2.Date) - STRFTIME('%Y', T1.Birthday) < 50 AND STRFTIME('%Y', T2.Date) = '1984' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,242 | challenging |
For all patients who are older than 55 years old, what is the percentage of female who has abnormal prothrombin time (PT)? | SELECT CAST(SUM(CASE WHEN T2.PT >= 14 AND T1.SEX = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) > 55 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,243 | challenging |
List all patients who first came to the hospital after year 1992 with prothrombin time (PT) level that are normal. | SELECT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T1.`First Date`) > '1992' AND T2.PT < 14 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,244 | moderate |
For the examinations done after 1997/1/1, how many of them have the result of an inactivated partial prothrom bin time? | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.Date > '1997-01-01' AND T2.APTT >= 45 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,245 | moderate |
For the patients with an abnormal activated partial prothrom bin time, how many of them have a mild 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 T3.ID = T2.ID WHERE T3.Thrombosis = 3 AND T2.APTT > 45 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,246 | moderate |
Among the male patients who have a normal level of white blood cells, how many of them have an abnormal fibrinogen level? | SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.FG <= 150 OR T2.FG >= 450 AND T2.WBC > 3.5 AND T2.WBC < 9.0 AND T1.SEX = 'M' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,247 | challenging |
How many patients born after 1980/1/1 have an abnormal fibrinogen level? | SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.FG <= 150 OR T2.FG >= 450 AND T1.Birthday > '1980-01-01' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,248 | moderate |
Please list the disease names of the patients that have a proteinuria level higher than normal. | SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`U-PRO` >= 30 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,249 | simple |
Which patient has a normal proteinuria level and is diagnosed with SLE? Please give his or her patient ID. | SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`U-PRO` > 0 AND T2.`U-PRO` < 30 AND T1.Diagnosis = 'SLE' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,250 | moderate |
How many patients with an Ig G lower than normal has the symptom of abortion? | 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 T3.ID = T2.ID WHERE T2.IGG < 900 AND T3.Symptoms = 'abortion' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,251 | moderate |
Among the patients with a normal Ig G level, how many of them have symptoms? | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE T2.IGG BETWEEN 900 AND 2000 AND T3.Symptoms IS NOT NULL | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,252 | moderate |
For the patient who has the highest Ig A within the normal range, what is his or her diagnosis? | SELECT patientData.Diagnosis FROM Patient AS patientData INNER JOIN Laboratory AS labData ON patientData.ID = labData.ID WHERE labData.IGA BETWEEN 80 AND 500 ORDER BY labData.IGA DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,253 | simple |
How many patients with a normal Ig A level came to the hospital after 1990/1/1? | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGA BETWEEN 80 AND 500 AND T1.`First Date` > '1990-01-01' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,254 | moderate |
For the patients with an abnormal Ig M level, what is the most common disease they are diagnosed with? | SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGM NOT BETWEEN 40 AND 400 GROUP BY T1.Diagnosis ORDER BY COUNT(T1.Diagnosis) DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,255 | moderate |
How many patients with a normal C-reactive protein don't have their data recorded? | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.CRP = '-' OR T2.CRP = '+-' OR T2.CRP < 1.0) AND T1.Description IS NULL | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,256 | moderate |
Among the patients whose C-reactive protein level is abnormal, how many of them aren't 18 yet? | SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.CRP != '-' AND T2.CRP != '+-') AND T2.CRP >= 1.0 AND STRFTIME('%Y', Date('now')) - STRFTIME('%Y', T1.Birthday) < '18' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,257 | challenging |
How many patients with a normal Rhuematoid Factor has a positive measure of degree of coagulation? | 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 T3.ID = T2.ID WHERE (T2.RA = '-' OR T2.RA = '+-') AND T3.KCT = '+' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,258 | moderate |
Please list the diseases of the patients born after 1995-1-1 and have a normal Rhuematoid Factor. | SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.RA = '-' OR T2.RA = '+-') AND T1.Birthday > 1995-01-01 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,259 | moderate |
Please list the ID of the patient whose RF is normal and who is older than 60. | SELECT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.RF < 20 AND STRFTIME('%Y', DATE('now')) - STRFTIME('%Y', T1.Birthday) > 60 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,260 | simple |
How many patients with a normal RF don't have thrombosis? | SELECT COUNT(DISTINCT T1.ID) FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.RF < 20 AND T1.Thrombosis = 0 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,261 | simple |
How many patients with a normal level of complement 3 have a P pattern observed in the sheet of ANA examination? | SELECT COUNT(DISTINCT T1.ID) FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.C3 > 35 AND T1.`ANA Pattern` = 'P' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,262 | moderate |
Among the patients whose level of Hematoclit isn't normal, which patient has the highest anti-Cardiolipin antibody concentration? Please list his or her ID. | SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID INNER JOIN Laboratory AS T3 on T1.ID = T3.ID WHERE (T3.HCT >= 52 OR T3.HCT <= 29) ORDER BY T2.`aCL IgA` DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,263 | moderate |
Among the patients have blood clots in veins, how many of them have a normal level of complement 4? | SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.C4 > 10 AND T1.Diagnosis = 'APS' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,264 | moderate |
How many patients have a normal level of anti-ribonuclear protein and have been admitted to the hospital? | SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.RNP = 'negative' OR T2.RNP = '0' AND T1.Admission = '+' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,265 | moderate |
Which is the youngest patient with an abnormal anti-ribonuclear protein level? Please list his or her date of birth. | SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.RNP != '-' OR '+-' ORDER BY T1.Birthday DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,266 | moderate |
Among the patients with normal anti-SM, how many of them have the most severe degree of thrombosis? | SELECT COUNT(T1.ID) FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SM IN ('negative','0') AND T1.Thrombosis = 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,267 | moderate |
For the patients with an abnormal anti-SM, please list the IDs of the three youngest ones. | SELECT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SM NOT IN ('negative','0') ORDER BY T1.Birthday DESC LIMIT 3 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,268 | simple |
Please list the IDs of the patients who had the examination done after 1997/1/1 and had a normal anti-scl70. | SELECT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SC170 IN ('negative','0') AND T2.Date > 1997-01-01 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,269 | moderate |
Among the patients who has a normal anti-scl70, how many of them are male and have the symptom of vertigo? | 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 T3.ID = T2.ID WHERE (T2.SC170 = '-' OR T2.SC170 = '+-') AND T1.SEX = 'M' AND T3.Symptoms = 'vertigo' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,270 | challenging |
How many patients with a normal anti-SSA came to the hospital before 1990? | SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SSA IN ('negative', '0') AND STRFTIME('%Y', T2.Date) < '1990' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,271 | moderate |
Which patient is the first patient with an abnormal anti-SSA to come to the hospital? Please give his or her ID. | SELECT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.`First Date` IS NOT NULL AND T2.SSA NOT IN ('negative', '0') ORDER BY T1.`First Date` ASC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,272 | moderate |
How many patients have a normal anti-SSB and are diagnosed with SLE in the examination? | SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SSB = 'negative' OR '0' AND T1.Diagnosis = 'SLE' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,273 | moderate |
For the patients whose anti-SSB are normal, how many of them have other symptoms observed in their examination? | SELECT COUNT(DISTINCT T1.ID) FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SSB = 'negative' OR '0' AND T1.Symptoms IS NOT NULL | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,274 | moderate |
Among the patients who has a normal level of anti-centromere and a normal level of anti-SSB, how many of them are male? | SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.CENTROMEA IN ('negative', '0') AND T2.SSB IN ('negative', '0') AND T1.SEX = 'M' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,275 | moderate |
For the patients who have an abnormal level of anti-DNA, please list the diseases they are diagnosed with. | SELECT DISTINCT(T1.Diagnosis) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.DNA >= 8 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,276 | simple |
How many patients have a normal anti-DNA level, yet their data are not recorded. | SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.DNA < 8 AND T1.Description IS NULL | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,277 | moderate |
Of the patients with an abnormal level of anti-DNA-II, how many of them admitted to the hospital? | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`DNA-II` >= 8 AND T1.Admission = '+' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,278 | simple |
What is the percentage of patient who has a abnormal level of glutamic oxaloacetic transaminase level, yet he or she is diagnosed with SLE? | SELECT COUNT(CASE WHEN T1.Diagnosis LIKE '%SLE%' THEN T1.ID ELSE 0 END) / COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`GOT` >= 60 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,279 | moderate |
How many male patients have their glutamic oxaloacetic transaminase in the normal range? | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT < 60 AND T1.SEX = 'M' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,280 | simple |
Among the patients who have an abnormal level of glutamic oxaloacetic transaminase, when was the youngest of them born? | SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT >= 60 ORDER BY T1.Birthday DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,281 | moderate |
Please list the top three patients' birthdays with the highest glutamic pylvic transaminase in the normal range. | SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GPT < 60 ORDER BY T2.GPT DESC LIMIT 3 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,282 | simple |
For the patients with the normal glutamic pylvic transaminase level, how many of them are male? | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT < 60 AND T1.SEX = 'M' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,283 | simple |
For the patient with the highest lactate dehydrogenase in the normal range, when was his or her data first recorded? | SELECT T1.`First Date` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH < 500 ORDER BY T2.LDH DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,284 | moderate |
When is the latest patient's medical data recorded? This patient should have an abnormal level of lactate dehydrogenase. | SELECT T1.`First Date` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH >= 500 ORDER BY T1.`First Date` DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,285 | moderate |
For the patient with an abnormal alkaliphophatase level, how many of them are admitted to the hospital? | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.ALP >= 300 AND T1.Admission = '+' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,286 | simple |
Among the patients followed at the outpatient clinic, how many of them have a normal level of alkaliphophatase? | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.ALP < 300 AND T1.Admission = '-' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,287 | moderate |
Please list the diagnosis of the patients whose total protein is lower than normal. | SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TP < 6.0 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,288 | simple |
For the patients who are diagnosed with SJS, how many of them have a normal level of total protein? | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Diagnosis = 'SJS' AND T2.TP > 6.0 AND T2.TP < 8.5 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,289 | moderate |
What is the examination date of the patient whose albumin is the highest in the normal range? | SELECT Date FROM Laboratory WHERE ALB BETWEEN 3.5 AND 5.5 ORDER BY ALB DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,290 | simple |
How many male patients have a normal level of both albumin and total protein? | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'M' AND T2.ALB BETWEEN 3.5 AND 5.5 AND T2.TP BETWEEN 6.0 AND 8.5 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,291 | moderate |
What is the anti Cardiolipin antibody concentration of the female patient with the highest uric acid level in the normal range? | SELECT T3.`aCL IgG`, T3.`aCL IgM`, T3.`aCL IgA` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE T1.SEX = 'F' AND T2.UA > 6.5 ORDER BY T2.UA DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,292 | challenging |
What is the highest anti-nucleus antibody concentration level of a patient with a normal creatinine level? | SELECT T2.ANA FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID INNER JOIN Laboratory AS T3 ON T1.ID = T3.ID WHERE T3.CRE < 1.5 ORDER BY T2.ANA DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,293 | moderate |
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 ORDER BY T2.`aCL IgA` DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,294 | moderate |
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%' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,295 | challenging |
What is the anti-nucleus antibody concentration of the patient whose total bilirubin is the highest in the normal range? | SELECT T3.ANA 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.0 ORDER BY T2.`T-BIL` DESC LIMIT 1 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,296 | moderate |
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 = '-' | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,297 | moderate |
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(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 T3.`ANA Pattern` = 'P' AND T2.`T-CHO` < 250 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,298 | moderate |
Among the patients with the normal level of triglyceride, how many of them have other symptoms observed? | SELECT COUNT(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 | thrombosis_prediction | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#Examination (ID integer, Examination Date date, aCL IgG real, aCL IgM real, ANA integer, ANA Pattern text, aCL IgA integer, Diagnosis text,... | 1,299 | simple |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.