birdsql/bird_sql_dev_20251106 huggingface dataset:
Database: thrombosis_prediction
Question: List ID, sex and date of birth of the patient whose total protein (TP) is below the lower range of the normal index.
Evidence: total protein (TP) below the lower range of the normal index refers to TP < 6.0
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
Database: thrombosis_prediction
Question: For all female patient with total protein (TP) beyond the normal index, what is the deviation of their TP index from the normal?
Evidence: female refers to SEX = 'F'; total protein (TP) beyond the normal index refers to TP > 8.5; deviation of TP index from normal refers to SUBTRACT(TP, 8.5)
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
Database: thrombosis_prediction
Question: Sort in descending order all patients by birthday for male patient with albumin not within range.
Evidence: male = SEX = 'M'; albumin not within range refers to ALB < = 3.5 or ALB > = 5.5
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
Database: thrombosis_prediction
Question: For all patient born in 1982, state if their albumin is within normal range.
Evidence: Year(Birthday) = '1982'; albumin is within normal range refers to ALB between 3.5 and 5.5
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'
Database: thrombosis_prediction
Question: What is the percentage of the female patient whose uric acid (UA) beyond the normal range?
Evidence: female refers to SEX = 'F'; normal UA range is up to 8.0 for males and up to 6.5 for females
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'
Database: thrombosis_prediction
Question: For all patients with normal uric acid (UA), what is the average UA index based on their latest laboratory examination result?
Evidence: uric acid (UA) with normal range refers to UA < 8.0 and SEX = 'M' or UA < 6.5 and SEX = 'F'; average UA index refers to AVG(UA)
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 )
Database: thrombosis_prediction
Question: Provide all ID, sex and birthday of patients whose urea nitrogen (UN) just within the borderline of passing?
Evidence: urea nitrogen (UN) just within the borderline of passing refers to UN = 29; 
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
Database: thrombosis_prediction
Question: Provide the ID, sex, birthday of all patients diagnosed with 'RA' that are within the UN normal index.
Evidence: within the UN normal index refers to UN < 30; Diagnosis = 'RA'
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'
Database: thrombosis_prediction
Question: How many male patients have creatinine index out of the normal range?
Evidence: creatinine (CRE) out of the normal range refers to CRE > = 1.5; Male refers to Sex = 'M'. Since multiple records may exist per patient, each male patient is counted only once, even if they have multiple results with creatinine index out of the normal range.
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'
Database: thrombosis_prediction
Question: Are there more male patients with creatinine not within the normal range than female? True or False?
Evidence: creatinine not within the normal range refers to CRE >= 1.5; male refers to SEX = 'M'; female refers to SEX = 'F'; need to compare whether there are more male patients than female patients with abnormal creatinine levels
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
Database: thrombosis_prediction
Question: What is the highest total bilirubin level recorded? List out the patient details with ID, sex and birthday with that index.
Evidence: the highest total bilirubin refers to MAX(T-BIL)
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
Database: thrombosis_prediction
Question: List and group all patients by sex for total bilirubin (T-BIL) level not within the normal range.
Evidence: List refers to GROUP_CONCAT(DISTINCT ID); total bilirubin (T-BIL) not within normal range refers to T-BIL > = 2.0
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
Database: thrombosis_prediction
Question: Who is the oldest patient with the highest total cholesterol (T-CHO). State the patient ID and T-CHO index.
Evidence: oldest patient refers to MIN(birthday); highest total cholesterol refers to MAX(T-CHO);
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
Database: thrombosis_prediction
Question: What is the average age of the male patient with high cholesterol?
Evidence: average age = DIVIDE(SUM(SUBTRACT(YEAR(NOW()), YEAR(birthday))), COUNT(ID)); male patient refers to sex = 'M'; high cholesterol refers to `T-CHO` > = 250;
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'
Database: thrombosis_prediction
Question: Provide list of patients and their diagnosis with triglyceride (TG) index greater than 100 of the normal range?
Evidence: triglyceride (TG) index greater than 100 of the normal range refers to TG > 300;
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
Database: thrombosis_prediction
Question: For all patients with triglyceride (TG) level beyond the normal range, how many are age more than 50 years?
Evidence: triglyceride (TG) level beyond the normal range refers to TG > = 200; more than 50 years of age = SUBTRACT(year(current_timestamp), year(Birthday)) > 50;
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
Database: thrombosis_prediction
Question: List all outpatient within normal range of creatinine phosphokinase. Give me the distinct ids.
Evidence: outpatient refers to Admission = '-'; normal range of creatinine phosphokinase refers to CPK < 250;
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 = '-'
Database: thrombosis_prediction
Question: For patient born between 1936-1956, how many male patients have creatinine phosphokinase beyond the normal range?
Evidence: born between 1936-1956 refers to year(Birthday) BETWEEN '1936' AND '1956'; male patients refers to sex = 'M'; creatinine phosphokinase beyond the normal range refers to CPK > = 250; Should consider DISTINCT in the final result;
SQL:
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
Database: thrombosis_prediction
Question: 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.
Evidence: age = SUBTRACT(year(current_timestamp), year(Birthday)); blood glucose (GLU) not within normal range refers to GLU > = 180; total cholesterol(T-CHO) within normal range refers to `T-CHO` < 250; 
SQL:
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
Database: thrombosis_prediction
Question: 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.
Evidence: blood glucose (GLU) index that were within normal range refers to GLU < 180; data that was first recorded in 1991 refers to year(Description) = 1991;
SQL:
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
Database: thrombosis_prediction
Question: 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.
Evidence: abnormal white blood cell count refers to WBC < 3.5 or WBC > 9.0
SQL:
SELECT 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.ID, T1.SEX, T1.Birthday ORDER BY T1.SEX, T1.Birthday ASC
Database: thrombosis_prediction
Question: What are the patient's diagnosis for those who has lower red blood blood cell? State their ID and age.
Evidence: lower red blood cell refers to RBC < 3.5;
SQL:
SELECT DISTINCT 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
Database: thrombosis_prediction
Question: For all the female patient age 50 and above, who has abnormal red blood cell count. State if they were admitted to hospital.
Evidence: female patient refers to Sex = 'F'; age 50 and above = SUBTRACT(year(current_timestamp), year(Birthday)) > = 50; abnormal red blood cell count refers to RBC < = 3.5 or RBC > = 6.0; Admission = '+' means the patient was admitted to the hospital; Admission = '-' means the patient was not admitted to the hospital;
SQL:
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
Database: thrombosis_prediction
Question: Among all outpatients, list out those have low hemoglobin level. State the different IDs and their sex.
Evidence: outpatients refers to Admission = '-'; low hemoglobin level refers to HGB < 10;
SQL:
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 = '-'
Database: thrombosis_prediction
Question: Among the patients who were diagnosed with SLE, who is the oldest with normal hemoglobin level. Provide the ID and sex.
Evidence: diagnosed with SLE refers to Diagnosis = 'SLE'; The larger the birthday value, the younger the person is, and vice versa; normal hemoglobin level refers to 10 < HGB < 17;
SQL:
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
Database: thrombosis_prediction
Question: Name the ID and age of patient with two or more laboratory examinations which show their hematoclit level exceeded the normal range.
Evidence: age = SUBTRACT(year(current_timestamp), year(Birthday)); patient with two or more laboratory examinations refers to COUNT(ID) > 2; hematoclit level exceeded the normal range refers to HCT > = 52;
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 T1.ID IN ( SELECT ID FROM Laboratory WHERE HCT >= 52 GROUP BY ID HAVING COUNT(ID) >= 2 )
Database: thrombosis_prediction
Question: From laboratory examinations in 1991, what is the average hematoclit level that is lower than the normal range.
Evidence: laboratory examinations in 1991 refers to Date like '1991%'; average hematoclit level = AVG(HCT); hematoclit level that is lower than the normal range refers to HCT < 29;
SQL:
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'
Database: thrombosis_prediction
Question: 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?
Evidence: abnormal platelet level refers to PLT <= 100 or PLT >= 400; platelet level lower than normal range refers to PLT <= 100; calculation = SUBTRACT(SUM(PLT < 100), SUM(PLT > 400)); platelet level higher than normal range refers to PLT >= 400;
SQL:
SELECT SUM(CASE WHEN T2.PLT <= 100 THEN 1 ELSE 0 END), 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
Database: thrombosis_prediction
Question: For laboratory examinations take in 1984, list all patients below 50 years old with normal platelet level.
Evidence: laboratory examinations take in 1984 refers to YEAR(Date) = '1984'; below 50 years old = SUBTRACT(year(current_timestamp), year(Birthday)) < 50; normal platelet level refers to PLT between 100 and 400;
SQL:
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'
Database: thrombosis_prediction
Question: For all patients who are older than 55 years old, what is the percentage of female who has abnormal prothrombin time (PT)?
Evidence: older than 55 years old = SUBTRACT(year(current_timestamp), year(Birthday)) > 55; abnormal prothrombin time (PT) refers to PT > = 14; percentage = DIVIDE(SUM(PT > = 14 AND SEX = 'F'), SUM(PT > = 14)) * 100; female refers to sex = 'F'; 
SQL:
SELECT 
    CAST(COUNT(DISTINCT CASE WHEN T2.PT >= 14 AND T1.SEX = 'F' THEN T1.ID END) AS REAL)
    / COUNT(DISTINCT CASE WHEN T2.PT >= 14 THEN T1.ID END)
    * 100 AS abnormal_pt_female_percentage
FROM Patient AS T1
INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID
WHERE STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) > 55;
Database: thrombosis_prediction
Question: List all patients who first came to the hospital after year 1992 with prothrombin time (PT) level that are normal.
Evidence: after year 1992 refers to year 1993 and onward; prothrombin time (PT) level that are normal refers to PT < 14
SQL:
SELECT DISTINCT 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
Database: thrombosis_prediction
Question: For the examinations done after 1997/1/1, how many of them have the result of an inactivated partial prothrom bin time?
Evidence: examinations done after 1997/1/1 refers to `Examination Date` > '1997-01-01'; normal activated partial prothrom bin time refesr to APTT < 45;
SQL:
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
Database: thrombosis_prediction
Question: For the patients with an abnormal activated partial prothrom bin time, how many of them does not have thrombosis?
Evidence: abnormal activated partial prothrom bin time refers to APTT > 45; does not have thrombosis refers to Thrombosis = 0; Only count ones without repetitive.
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 T3.ID = T2.ID WHERE T3.Thrombosis = 0 AND T2.APTT > 45
Database: thrombosis_prediction
Question: Among the male patients who have a normal level of white blood cells, how many of them have an abnormal fibrinogen level?
Evidence: male patients refers to Sex = 'M'; normal level of white blood cells refers to WBC > 3.5 and WBC <9.0; abnormal fibrinogen level refers to FG < = 150 or FG > = 450; Don't compute repetitive ones.
SQL:
SELECT COUNT(DISTINCT p.ID) AS male_count
FROM Patient AS p
JOIN Laboratory AS l ON l.ID = p.ID
WHERE p.SEX = 'M'
  AND (l.FG <= 150 OR l.FG >= 450)
  AND l.WBC > 3.5 AND l.WBC < 9.0;
Database: thrombosis_prediction
Question: How many patients born after 1980/1/1 have an abnormal fibrinogen level?
Evidence: born after 1980/1/1 refers to Birthday > '1980-01-01'; normal fibrinogen level refers to FG between 150 and 450; Should return the number of distinct patients.
SQL:
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'
Database: thrombosis_prediction
Question: Please list the disease names of the patients that have a proteinuria level higher than normal.
Evidence: disease names refers to Diagnosis; proteinuria level higher than normal refers to `U-PRO` > = 30;
SQL:
SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`U-PRO` >= 30
Database: thrombosis_prediction
Question: Which patients have a normal proteinuria level and are diagnosed with SLE? Please give their patient IDs.
Evidence: normal proteinuria level refers to 0 < `U-PRO` < 30; diagnosed with SLE refers to Diagnosis = 'SLE';
SQL:
SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE CAST(T2.`U-PRO` AS REAL) > 0 AND CAST(T2.`U-PRO` AS REAL) < 30 AND T1.Diagnosis = 'SLE'
Database: thrombosis_prediction
Question: How many patients with an Ig G higher than normal?
Evidence: Ig G higher than normal refers to IGG >= 2000
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 T3.ID = T2.ID WHERE T2.IGG >= 2000
Database: thrombosis_prediction
Question: Among the patients with a normal Ig G level, how many of them have symptoms?
Evidence: normal Ig G level refers to IGG > 900 and IGG < 2000; have symptoms refers to Symptoms IS NOT NULL;
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 T3.ID = T2.ID WHERE T2.IGG BETWEEN 900 AND 2000 AND T3.Symptoms IS NOT NULL
Database: thrombosis_prediction
Question: For the patient who has the highest Ig A within the normal range, what is his or her diagnosis?
Evidence: Normal range for Ig A is between 80 and 500 inclusive.
SQL:
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, patientData.ID LIMIT 1
Database: thrombosis_prediction
Question: How many patients with a normal Ig A level came to the hospital after 1990/1/1?
Evidence: normal Ig A level refers to IGA > 80 AND IGA < 500; came to the hospital after 1990/1/1 refers to YEAR(`First Date`) > = 1990;
SQL:
SELECT COUNT(DISTINCT T1.ID) AS normal_iga_patient_count FROM Patient AS T1
INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGA > 80 AND T2.IGA < 500 AND strftime('%Y', T1.`First Date`) >= '1990';
Database: thrombosis_prediction
Question: For the patients with an abnormal Ig M level, what is the most common disease they are diagnosed with?
Evidence: abnormal Ig M level refers to IGM <=40 OR IGM >= 400; most common disease refers to MAX(COUNT(Diagnosis));
SQL:
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
Database: thrombosis_prediction
Question: How many patients with a abnormal C-reactive protein don't have their data recorded?
Evidence: abnormal C-reactive protein refers to CRP ='+'; don't have data recorded refers to Description IS NULL;
SQL:
SELECT COUNT(DISTINCT T1.ID) 
FROM Patient AS T1 
INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID 
WHERE T2.CRP = '+' AND T1.Description IS NULL;
Database: thrombosis_prediction
Question: Among the patients whose creatinine level is abnormal, how many of them aren't 70 yet?
Evidence: creatinine level is abnormal refers to CRE >= 1.5; aren't 70 yet refers to SUBTRACT((YEAR(CURDATE()), YEAR(Birthday))) < 70; 
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 STRFTIME('%Y', Date('now')) - STRFTIME('%Y', T1.Birthday) < 70
Database: thrombosis_prediction
Question: How many patients with a normal Rhuematoid Factor has a positive measure of degree of coagulation?
Evidence: normal Rhuematoid Factor refers TO RA IN('-', '+-'); positive measure of degree of coagulation refers to KCT = '+'; Should compute the number of distinct ones
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 T3.ID = T2.ID WHERE (T2.RA = '-' OR T2.RA = '+-') AND T3.KCT = '+'
Database: thrombosis_prediction
Question: Please list the diseases of the patients born after 1985-1-1 and have a normal Rhuematoid Factor.
Evidence: diseases refers to Diagnosis; born after 1985/1/1 refers to YEAR(Birthday) > = 1985; normal Rhuematoid Factor refers to RA IN('-', '+-');
SQL:
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 > '1985-01-01'
Database: thrombosis_prediction
Question: Please list the ID of patients whose RF test result is normal and who were older than 60 at the time of their laboratory test.
Evidence: RF is normal refers to RF < 20, excluding any '<' or '>' prefix if present; older than 60 means the patient's age at the time of the laboratory test exceeded 60 years
SQL:
SELECT DISTINCT p.ID FROM Patient AS p JOIN Laboratory AS l ON p.ID = l.ID WHERE l.RF IS NOT NULL AND TRIM(l.RF) != '' AND CAST(REPLACE(REPLACE(l.RF, '<', ''), '>', '') AS REAL) < 20 AND (CAST(strftime('%Y', l.Date) AS INTEGER) - CAST(strftime('%Y', p.Birthday) AS INTEGER)) > 60
Database: thrombosis_prediction
Question: How many patients with a normal RF don't have thrombosis?
Evidence: normal RF refers to RF < 20; don't have thrombosis refers to Thrombosis = '0';
SQL:
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
Database: thrombosis_prediction
Question: How many patients with a normal level of complement 3 have a P pattern observed in the sheet of ANA examination?
Evidence: normal level of complement 3 refers to C3 > 35; have a P pattern observed in the sheet of ANA examination refers to ANA Pattern = 'P'; Should compute the number of distinct ones
SQL:
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'
Database: thrombosis_prediction
Question: 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.
Evidence: Hematoclit is normal refers to 29 < N < 52; highest anti-Cardiolipin antibody concentration refers to MAX(`aCL IgA`);
SQL:
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
Database: thrombosis_prediction
Question: Among the patients have blood clots in veins, how many of them have a normal level of complement 4?
Evidence: APS will result in Blood Clots in veins; normal level of complement 4 refers to C4 > 10; Should compute the number of different ones
SQL:
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'
Database: thrombosis_prediction
Question: How many patients have a normal level of anti-ribonuclear protein and have been admitted to the hospital?
Evidence: normal level of anti-ribonuclear protein refers to RNP = '-', '+-'; And'-' means 'negative'; '+-' refers to '0'; admitted to the hospital refers to Admission = '+'; Should consider DISTINCT in the final result;
SQL:
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 = '+'
Database: thrombosis_prediction
Question: What is the date of birth of the youngest patient with an abnormal anti-ribonuclear protein level?
Evidence: youngest patient refers to MAX(Birthday); abnormal anti-ribonuclear protein level refers to RNP NOT IN('-', '+-'); date of birth refers to Birthday;
SQL:
SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.RNP NOT IN ('-', '+-') ORDER BY T1.Birthday DESC LIMIT 1
Database: thrombosis_prediction
Question: Among the patients with normal anti-SM, how many of them does not have thrombosis?
Evidence: normal anti-SM refers to SM IN('-', '+-'); SM = 'negative' means '-'; SM = '0' means '+-'; SM = '1' means '+'; does not have thrombosis refers to Thrombosis = 0;
SQL:
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 = 0
Database: thrombosis_prediction
Question: For the patients with an abnormal anti-SM, please list the IDs of the three youngest ones.
Evidence: abnormal anti-SM refers to SM NOT IN ('negative', '0'); youngest refers to MAX(Birthday);
SQL:
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
Database: thrombosis_prediction
Question: Please list the IDs of the patients who had the examination done after 1997/1/1 and had a normal anti-scl70.
Evidence: examination done after 1997/1/1 refers to `Examination Date` >  1997-01-01; normal anti-scl70 refers to SC170 IN('negative','0');
SQL:
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'
Database: thrombosis_prediction
Question: Among the patients who has a normal anti-scl70, how many of them are female and does not have any symptom?
Evidence: normal anti-scl70 refers to negative test results; female refers to female sex; patients without symptoms have no recorded symptoms; when counting patients across multiple test records, each patient should only be counted once
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 T3.ID = T2.ID WHERE (T2.SC170 = 'negative' OR T2.SC170 = '0') AND T1.SEX = 'F' AND T3.Symptoms IS NULL
Database: thrombosis_prediction
Question: How many patients with a normal anti-SSA came to the hospital before 2000?
Evidence: normal anti-SSA refers to SSA that is 'negative' or '0'; came to the hospital before 2000 refers to laboratory test date before year 2000; Should compute the number of distinct patients
SQL:
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) < '2000'
Database: thrombosis_prediction
Question: Which patient is the first patient with an abnormal anti-SSA to come to the hospital? Please give his or her ID.
Evidence: first patient refers to ID with MIN(`First Date`); abnormal anti-SSA refers to SSA NOT IN('negative', '0');
SQL:
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
Database: thrombosis_prediction
Question: How many patients have a normal anti-SSB and are diagnosed with SLE in the examination?
Evidence: normal anti-SSB refers to SSB IN('-', '+-'); '-' is expressed as 'negative' and '+-' is expressed as '0' in the database ; diagnosed with SLE refers to Diagnosis = 'SLE'; Should compute the number of distinct ones
SQL:
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SSB = 'negative' OR T2.SSB = '0' AND T1.Diagnosis = 'SLE'
Database: thrombosis_prediction
Question: For the patients whose anti-SSB are normal, how many of them have other symptoms observed in their examination?
Evidence: anti-SSB are normal refers to SSB IN ('negative', '0'); have other symptoms refers to Symptoms IS NOT NULL
SQL:
SELECT COUNT(DISTINCT T1.ID) FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.SSB = 'negative' OR T2.SSB = '0') AND T1.Symptoms IS NOT NULL
Database: thrombosis_prediction
Question: Among the patients who has a normal level of anti-centromere and a normal level of anti-SSB, how many of them are male?
Evidence: normal level of anti-centromere refers to CENTROMEA IN('negative', '0'); normal level of anti-SSB refers to SSB IN('negative', '0'); male refers to SEX = 'M';
SQL:
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'
Database: thrombosis_prediction
Question: For the patients who have an abnormal level of anti-DNA, please list the diseases they are diagnosed with.
Evidence: abnormal level of anti-DNA refers to DNA >= 8; diseases refers to Diagnosis;
SQL:
SELECT DISTINCT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.DNA >= 8
Database: thrombosis_prediction
Question: How many patients have a normal anti-DNA level, yet their data are not recorded.
Evidence: normal anti-DNA level refers to DNA < 8; data are not recorded refers to Description IS NULL; Should compute the number of unique ones
SQL:
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
Database: thrombosis_prediction
Question: Based on latest record of each patient,of the patients with an normal level of IGG, how many of them admitted to the hospital?
Evidence: normal level of IGG refers to 900 < IGG < 2000; admitted to the hospital refers to Admission = '+';
SQL:
WITH LatestLab AS (SELECT T1.ID,max(T2.Date) AS LatestLabDate FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID GROUP BY T1.ID) SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN LatestLab AS T3 ON T1.ID=T3.ID AND T2.Date=T3.LatestLabDate WHERE T2.IGG > 900 AND T2.IGG <2000 AND  T1.Admission = '+'
Database: thrombosis_prediction
Question: What is the percentage of patient who has a abnormal level of glutamic oxaloacetic transaminase level, yet he or she is diagnosed with SLE?
Evidence: abnormal level of glutamic oxaloacetic transaminase refers to GOT > = 60; percentage = MULTIPLY(DIVIDE(COUNT(ID WHERE GOT > = 60 AND Diagnosis = 'SLE'), COUNT(ID WHERE GOT > = 60)), 1.0);
SQL:
SELECT SUM(CASE WHEN T1.Diagnosis LIKE '%SLE%' THEN 1 ELSE 0 END) * 100.0 / COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`GOT` >= 60
Database: thrombosis_prediction
Question: How many male patients have their glutamic oxaloacetic transaminase in the normal range?
Evidence: male refers to Sex = 'M'; glutamic oxaloacetic transaminase in the normal range refers to GOT < 60;
SQL:
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'
Database: thrombosis_prediction
Question: Among the patients who have an abnormal level of glutamic oxaloacetic transaminase, when was the youngest of them born?
Evidence: abnormal level of glutamic oxaloacetic transaminase refers to GOT > = 60; The larger the birthday value, the younger the person is, and vice versa;
SQL:
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
Database: thrombosis_prediction
Question: Please list the top three patients' birthdays with the highest glutamic pylvic transaminase in the normal range.
Evidence: normal range for GPT is below 60
SQL:
SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GPT < 60 GROUP BY T1.ID ORDER BY MAX(T2.GPT) DESC, T1.ID ASC LIMIT 3
Database: thrombosis_prediction
Question: For the patients with the normal glutamic pylvic transaminase level, how many of them are male?
Evidence: normal glutamic pylvic transaminase level refers to GOT < 60; male refers to Sex = 'M';
SQL:
SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT < 60 AND T1.SEX = 'M'
Database: thrombosis_prediction
Question: For the patient with the highest lactate dehydrogenase in the normal range, when was his or her data first recorded?
Evidence: highest lactate dehydrogenase in the normal range refers to MAX(LDH < 500); when the data first recorded refers to MIN(First Date);
SQL:
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
Database: thrombosis_prediction
Question: When is the latest patient's medical data recorded? This patient should have an abnormal level of lactate dehydrogenase.
Evidence: latest patient refers to ID with MAX('First Date'); abnormal level of lactate dehydrogenase refers to LDH > = 500;
SQL:
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
Database: thrombosis_prediction
Question: For the patient with an abnormal alkaliphophatase level, how many of them are admitted to the hospital?
Evidence: abnormal alkaliphophatase level refers to ALP > = 300; admitted to the hospital refers to Admission = '+';
SQL:
SELECT COUNT(DISTINCT T1.ID)
FROM Patient AS T1
INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID
WHERE T2.ALP >= 300 AND T1.Admission = '+';
Database: thrombosis_prediction
Question: Among the patients followed at the outpatient clinic, how many of them have a normal level of alkaliphophatase?
Evidence: followed at the outpatient clinic refers to Admission = '-'; normal level of alkaliphophatase refers to ALP < 300;
SQL:
SELECT COUNT(DISTINCT T1.ID) 
FROM Patient AS T1 
INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID 
WHERE T2.ALP < 300 
AND T1.Admission = '-'
Database: thrombosis_prediction
Question: Please list the diagnosis of the patients whose total protein is lower than normal.
Evidence: total protein is lower than normal refers to TP < 6.0;
SQL:
SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TP < 6.0
Database: thrombosis_prediction
Question: For the patients who are diagnosed with SJS, how many of them have a normal level of total protein?
Evidence: diagnosed with SJS refers to Diagnosis = 'SJS'; normal level of total protein refers to TP > 6.0 and TP < 8.5;
SQL:
SELECT COUNT(DISTINCT 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
Database: thrombosis_prediction
Question: What is the examination date of the patient whose albumin is the highest in the normal range?
Evidence: examination date refers to Date; albumin is the highest in the normal range refers to MAX(ALB > 3.5 and ALB < 5.5);
SQL:
SELECT Date FROM Laboratory WHERE ALB > 3.5 AND ALB < 5.5 ORDER BY ALB DESC LIMIT 1
Database: thrombosis_prediction
Question: How many male patients have a normal level of both albumin and total protein?
Evidence: male refers to Sex = 'M'; normal level of both albumin and total protein refers to ALB > 3.5 and ALB < 5.5 AND TP between 6.0 and 8.5;
SQL:
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 > 3.5 AND T2.ALB < 5.5 AND T2.TP BETWEEN 6.0 AND 8.5
Database: thrombosis_prediction
Question: What is the anti Cardiolipin antibody concentration of the female patient with the highest uric acid level above 6.5?
Evidence: anti Cardiolipin antibody concentration refers to `aCL IgG`, `aCL IgM`, `aCL IgA`; female patient refers to SEX = 'F'; uric acid level above 6.5 refers to UA > 6.5
SQL:
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, T1.ID ASC LIMIT 1
Database: thrombosis_prediction
Question: What is the highest anti-nucleus antibody concentration level of a patient with a normal creatinine level?
Evidence: highest refers to the maximum value; normal creatinine level refers to CRE < 1.5
SQL:
SELECT MAX(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
Database: thrombosis_prediction
Question: Please list the patient's ID whose creatinine level is normal and whose anti Cardiolipin antibody concentration level is the highest.
Evidence: creatinine level is normal refers to CRE < 1.5; anti Cardiolipin antibody concentration level is the highest refers to MAX(aCL IgA);
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
Database: thrombosis_prediction
Question: 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?
Evidence: total bilirubin is over the normal range refers to `T-BIL` > = 2.0; peripheral pattern is observed in the sheet of ANA examination refers to that ANA Pattern contains 'P';
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%'
Database: thrombosis_prediction
Question: What is the anti-nucleus antibody concentration of the patient whose total bilirubin is the highest in the normal range?
Evidence: anti-nucleus antibody concentration refers to ANA; total bilirubin is the highest in the normal range refers to MAX(`T-BIL` < 2.0);
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
Database: thrombosis_prediction
Question: For the patients whose total cholesterol is higher than normal, how many of them have a negative measure of degree of coagulation?
Evidence: total cholesterol is higher than normal refers to `T-CHO` > = 250; negative measure of degree of coagulation refers to KCT = '-' ;
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 = '-'
Database: thrombosis_prediction
Question: 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?
Evidence: total cholesterol is within the normal range refers to `T-CHO` < 250; P pattern observed in the sheet of ANA examination refers to ANA Pattern = 'P';
SQL:
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';
Database: thrombosis_prediction
Question: Among the patients with the normal level of triglyceride, how many of them have other symptoms observed?
Evidence: normal level of triglyceride refers to TG < 200; have other symptoms refers to Symptoms is not null;
SQL:
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
Database: thrombosis_prediction
Question: What is the disease name of the patient who has the highest level of triglyceride within the normal range?
Evidence: disease name refers to Diagnosis; highest level of triglyceride within the normal range refers to MAX(TG < 200);
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
Database: thrombosis_prediction
Question: Please list the IDs of the patients with no thrombosis and an abnormal level of creatinine phosphokinase.
Evidence: no thrombosis refers to Thrombosis = 0 ; abnormal level of creatinine phosphokinase refers to CPK < 250;
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
Database: thrombosis_prediction
Question: For the patients with a normal range of creatinine phosphokinase, how many of them have a positive measure of degree of coagulation?
Evidence: normal range of creatinine phosphokinase refers to CPK < 250; positive measure of degree of coagulation refers to KCT = '+' or RVVT = '+' or LAC = '+' ;
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 = '+')
Database: thrombosis_prediction
Question: When is the birthday of the oldest patient whose blood glucose is abnormal?
Evidence: oldest patient refers to MIN(Birthday); blood glucose is abnormal refers to GLU > 180;
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
Database: thrombosis_prediction
Question: Among the patients with a normal blood glucose, how many of them don't have thrombosis?
Evidence: normal blood glucose refers to GLU < 180; patients without thrombosis have Thrombosis value of 0;
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
Database: thrombosis_prediction
Question: How many patients accepted to the hospital have a normal level of white blood cells?
Evidence: accepted to the hospital refers to Admission = '+'; normal level of white blood cells refers to WBC between 3.5 and 9.0;
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 = '+'
Database: thrombosis_prediction
Question: How many patients diagnosed with SLE have a normal white blood cell level?
Evidence: diagnosed with SLE refers to Diagnosis = 'SLE'; normal white blood cell level refers to WBC between 3.5 and 9.0;
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
Database: thrombosis_prediction
Question: 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.
Evidence: RBC < = 3.5 or RBC > = 6.0 means the patient has an abnormal level of red blood cell; 3.5 < RBC < 6.0 means the patient has a normal level of red blood cell; followed at the outpatient clinic refers to Admission = '-';
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 = '-'
Database: thrombosis_prediction
Question: Among the patients who have a normal platelet level, how many of them have other symptoms observed?
Evidence: normal platelet level refers to PLT > 100 and PLT < 400; have other symptoms refers to Diagnosis is not null;
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
Database: thrombosis_prediction
Question: Please list a patient's platelet level if it is within the normal range and if he or she is diagnosed with MCTD.
Evidence: PLT > 100 and PLT < 400 means platelet level is within the normal range; PLT < 100 and PLT > 400 means platelet level is not within the normal range; diagnosed with MCTD refers to Diagnosis = 'MCTD';
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
Database: thrombosis_prediction
Question: For the male patients that have a normal prothrombin time, what is their average prothrombin time?
Evidence: male refers to Sex = 'M'; normal prothrombin time refer to PT < 14; average prothrombin time = AVG(PT);
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'
Database: thrombosis_prediction
Question: How many patients with severe thrombosis have a normal prothrombin time?
Evidence: severe thrombosis refers to Thrombosis = 2 or 1; normal prothrombin time refers to PT < 14;
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
Database: student_club
Question: What's Angela Sanders's major?
Evidence: major refers to major_name
SQL:
SELECT T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.first_name = 'Angela' AND T1.last_name = 'Sanders'
Database: student_club
Question: How many students in the Student_Club are from the College of Engineering?
SQL:
SELECT COUNT(T1.member_id) FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.college = 'College of Engineering'
Database: student_club
Question: Please list the full names of the students in the Student_Club that come from the Art and Design Department.
Evidence: full name refers to first_name, last_name;
SQL:
SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.department = 'Art and Design Department'
Database: student_club
Question: How many students of the Student_Club have attended the event "Women's Soccer"?
Evidence: Women's Soccer is an event name
SQL:
SELECT COUNT(T1.event_id) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event WHERE T1.event_name = 'Women''s Soccer'
Database: student_club
Question: Please list the phone numbers of the students from the Student_Club that has attended the event "Women's Soccer".
Evidence: Women's Soccer is an event name; phone numbers refers to phone
SQL:
SELECT T3.phone FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event INNER JOIN member AS T3 ON T2.link_to_member = T3.member_id WHERE T1.event_name = 'Women''s Soccer'
Database: student_club
Question: Among the students from the Student_Club who attended the event "Women's Soccer", how many of them want a T-shirt that's in medium size?
Evidence: Students refer to members; Women's Soccer is an event name; T-shirt that is in medium size refers to t_shirt_size = 'Medium'
SQL:
SELECT COUNT(DISTINCT T3.member_id) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event INNER JOIN member AS T3 ON T2.link_to_member = T3.member_id WHERE T1.event_name = 'Women''s Soccer' AND T3.t_shirt_size = 'Medium'
Database: student_club
Question: What is the event that has the highest attendance of the students from the Student_Club?
Evidence: highest attendance refers to the event with the most attendees
SQL:
SELECT T1.event_name FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event GROUP BY T1.event_name ORDER BY COUNT(T2.link_to_event) DESC LIMIT 1
Database: student_club
Question: Which college is the vice president of the Student_Club from?
SQL:
SELECT T2.college FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.position LIKE 'vice president'
Database: student_club
Question: Please list the event names of all the events attended by Maya Mclean.
SQL:
SELECT T1.event_name FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event INNER JOIN member AS T3 ON T2.link_to_member = T3.member_id WHERE T3.first_name = 'Maya' AND T3.last_name = 'Mclean'
Database: student_club
Question: How many events of the Student_Club did Sacha Harrison attend in 2019?
Evidence: events attended in 2019 refers to YEAR(event_date) = 2019
SQL:
SELECT COUNT(T1.event_id) FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event INNER JOIN member AS T3 ON T2.link_to_member = T3.member_id WHERE T3.first_name = 'Sacha' AND T3.last_name = 'Harrison' AND SUBSTR(T1.event_date, 1, 4) = '2019'