Chinastark/bird_dataset huggingface dataset:
Database: thrombosis_prediction
Note: 1991/6/13 refers to `first date` = '1991-06-13'; 'SJS' refers to diagnosis; total number of his/her laboratory tests refers to COunT(id); 1995 refers to date;
Question: For the patient who first came to the hospital on 1991/6/13 who was diagnosed with SJS, what is the total number of his/her Laboratory tests in 1995?
SQL: SELECT count(*) FROM laboratory WHERE id = ( SELECT id FROM patient WHERE `first date` = '1991-06-13' AND diagnosis = 'SJS' ) AND strftime('%Y', Date) = '1995'
Database: thrombosis_prediction
Note: 'SLE' AND original diagnose refers to diagnosis; 1997/1/27 refer to `examination date` = '1997-01-27'; first came to the hospital refers to patient.`first date`;
Question: For the patient who was diagnosed SLE on 1997/1/27, what was his/her original diagnose when he/she came to the hospital for the first time?
SQL: SELECT patient.diagnosis FROM patient INNER JOIN examination ON patient.id = examination.id WHERE patient.id = ( SELECT id FROM examination WHERE `examination date` = '1997-01-27' AND diagnosis = 'SLE' ) AND examination.`examination date` = patient.`first date`
Database: thrombosis_prediction
Question: For the patient whose birthday was 1959/3/1, what symptoms did he/she have during the examination on 1993/9/27?
SQL: SELECT examination.symptoms FROM patient INNER JOIN examination ON patient.id = examination.id WHERE patient.birthday = '1959-03-01' AND examination.`examination date` = '1993-09-27'
Database: thrombosis_prediction
Note: born on 1959/2/18 refers to birthday = '1959-02-18'; calculation = SUBTraCT(SUM(birthday = '1959-02-18' and date like '1981-11-%' THEN `t-cho`), SUM(birthday = '1959-02-18' and date like '1981-12-%' THEN `t-cho`));
Question: For the patient who was born on 1959/2/18, what is the decrease rate for his/her total cholesterol from November to December in 1981?
SQL: SELECT cast((sum(CASE WHEN laboratory.date LIKE '1981-11-%' THEN laboratory.`t-cho` ELSE 0 END) - sum(CASE WHEN laboratory.date LIKE '1981-12-%' THEN laboratory.`t-cho` ELSE 0 END)) AS REAL) / sum(CASE WHEN laboratory.date LIKE '1981-12-%' THEN laboratory.`t-cho` ELSE 0 END) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE patient.birthday = '1959-02-18'
Database: thrombosis_prediction
Note: 'Behcet' refers to diagnosis; exam between 01/01/1997 and 12/31/1997 refers to YEAR(description) >= '1997-1-1' AND YEAR(description) < '1998-1-1';
Question: Lists all patients by ID who were diagnosed with Behcet's and had their exams between 01/01/197 and 12/31/1997.
SQL: SELECT id FROM examination WHERE `examination date` BETWEEN '1997-01-01' AND '1997-12-31' AND diagnosis = 'Behcet'
Database: thrombosis_prediction
Note: examined between 1987/7/6 and 1996/1/31 refers to date BETWEEN '1987-07-06' AND '1996-01-31'; gpt level greater than 30 refers to gpt > 30; alb level less than 4 alb < 4;
Question: How many patients who were examined between 1987/7/6 and 1996/1/31 had a GPT level greater than 30 and an ALB level less than 4? List them by their ID.
SQL: SELECT DISTINCT id FROM laboratory WHERE Date BETWEEN '1987-07-06' AND '1996-01-31' AND gpt > 30 AND alb < 4
Database: thrombosis_prediction
Note: female refers to sex = 'F'; born in 1964 refers to YEAR(birthday) = 1964; admitted to the hospital refers to admission = '+';
Question: How many female patients born in 1964 were admitted to the hospital? List them by ID.
SQL: SELECT id FROM patient WHERE strftime('%Y', birthday) = '1964' AND sex = 'F' AND admission = '+'
Database: thrombosis_prediction
Note: thrombosis level 2 refers to thrombosis = 2; ana pattern of only S refers to ana = 'S'; average anti-Cardiolip in antibody (igm) refers to AVG(`acl igm`); calculation = MULTIPLY(AVG + AVG, 0.2);
Question: What number of patients with a degree of thrombosis level 2 and ANA pattern of only S, have a level of anti-Cardiolip in antibody (IgM) 20% higher than average?
SQL: SELECT count(*) FROM examination WHERE thrombosis = 2 AND `ana pattern` = 'S' AND `acl igm` > (SELECT avg(`acl igm`) * 1.2 FROM examination WHERE thrombosis = 2 AND `ana pattern` = 'S')
Database: thrombosis_prediction
Note: proteinuria level within the normal range refers to `u-pro` > 0 AND `u-pro` < 30; uric acid level below the normal range refers to ua <= 6.5; calculation = MULTIPLY(DIVidE(ua <= 6.5, `u-pro` > 0 AND `u-pro` < 30)，100);
Question: What percentage of patients with a proteinuria level within the normal range have a uric acid level below the normal range?
SQL: SELECT cast(sum(CASE WHEN ua <= 6.5 THEN 1 ELSE 0 END) AS REAL) * 100 / count(id) FROM laboratory WHERE `u-pro` > 0 AND `u-pro` < 30
Database: thrombosis_prediction
Note: male refers to sex = 'M'; first presented to the hospital in 1981 refers to YEAR(`first date`) = '1981'; BEHCET refers to diagnosis; calculation = DIVidE(SUM(diagnosis = 'BEHCET') where YEAR(`first date`) = '1981', MULTIPLY(COunT(YEAR(`first date`) = '1981')), 100);
Question: What percentage of male patients who first presented to the hospital in 1981 were diagnosed with BEHCET?
SQL: SELECT cast(sum(CASE WHEN diagnosis = 'BEHCET' THEN 1 ELSE 0 END) AS REAL) * 100 / count(id) FROM patient WHERE strftime('%Y', `first date`) = '1981' AND sex = 'M'
Database: thrombosis_prediction
Note: followed up at the outpatient clinic refers to admission = '-'; laboratory test in April 1981 refers to date like '1991-10%'; blood bilirubin level within the normal range refers to t-bil < 2.0;
Question: List all patients who were followed up at the outpatient clinic who underwent a laboratory test in October 1991 and had a total blood bilirubin level within the normal range.
SQL: SELECT DISTINCT patient.id FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE patient.admission = '-' AND laboratory.`t-bil` < 2.0 AND laboratory.date LIKE '1991-10-%'
Database: thrombosis_prediction
Note: Excluding all P only ana pattern refers to `ana pattern`! = 'P'; women refers to sex = 'F'; born between 1980 and 1989 refers to birthday;
Question: Excluding all P only ANA Pattern patients, how many of the remainder are women born between 1980 and 1989?
SQL: SELECT count(DISTINCT patient.id) FROM patient INNER JOIN examination ON patient.id = examination.id WHERE examination.`ana pattern` != 'P' AND strftime('%Y', patient.birthday) BETWEEN '1980' AND '1989' AND patient.sex = 'F'
Database: thrombosis_prediction
Note: PSS' refers to diagnosis; blood level of C-reactive protein de 2+refers to crp > 2; createnine 1 refers to cre = 1; ldh 123 refers to ldh = 123;
Question: What sex is the patient who in a medical examination was diagnosed with PSS and in a laboratory examination had a blood level of C-reactive protein de 2+, createnine 1 and LDH 123?
SQL: SELECT patient.sex FROM patient INNER JOIN examination ON patient.id = examination.id INNER JOIN laboratory ON laboratory.id = examination.id WHERE examination.diagnosis = 'PSS' AND laboratory.crp = '2+' AND laboratory.cre = 1.0 AND laboratory.ldh = 123
Database: thrombosis_prediction
Note: average blood albumin level refers to AVG(alb); female refers to sex = 'F'; plt greater than 400 refers to plt > 400; diagnosed with SLE refers to diagnosis= 'SLE';
Question: What is the average blood albumin level for female patients with a PLT greater than 400 who have been diagnosed with SLE?
SQL: SELECT avg(laboratory.alb) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.plt > 400 AND patient.diagnosis = 'SLE' AND patient.sex = 'F'
Database: thrombosis_prediction
Note: the most common sign refers to MAX(symptoms); 'SLE' refers to diagnosis;
Question: What is the most common sign of patients with SLE disease?
SQL: SELECT symptoms FROM examination WHERE diagnosis = 'SLE' GROUP BY symptoms ORDER BY count(symptoms) DESC LIMIT 1
Database: thrombosis_prediction
Note: medical information first documented refers to description; disease refers to diagnosis; patient number refers to id;
Question: When was the medical information on patient number 48473 first documented, and what disease did she have?
SQL: SELECT `first date`, diagnosis FROM patient WHERE id = 48473
Database: thrombosis_prediction
Note: female refers to sex = 'F'; APS diagnosis refers to diagnosis='APS';
Question: How many female patients were given an APS diagnosis?
SQL: SELECT count(id) FROM patient WHERE sex = 'F' AND diagnosis = 'APS'
Database: thrombosis_prediction
Note: underwent testing in 1997 refers to YEAR(date) = '1997'; protein levels within the normal range refers to tp > 6 and tp < 8.5;
Question: How many patients who underwent testing in 1997 had protein levels outside the normal range?
SQL: SELECT count(id) FROM laboratory WHERE (alb <= 6.0 OR alb >= 8.5) AND strftime('%Y', Date) = '1997'
Database: thrombosis_prediction
Note: thrombocytopenia' refers to symptoms; 'SLE' refers to diagnosis; calculation =  DIVidE(SUM(diagnosis LIKE '%Itp%'), SUM(diagnosis LIKE '%SLE%')) MULTIPLY 100;
Question: What proportion of patients who had signs of thrombocytopenia had SLE diagnosed?
SQL: SELECT cast(sum(CASE WHEN diagnosis = 'SLE' THEN 1 ELSE 0 END) AS REAL) * 100 / count(id) FROM examination WHERE symptoms = 'thrombocytopenia'
Database: thrombosis_prediction
Note: born in 1980 refers to YEAR(birthday) = '1980'; 'ra' refers to diagnosis='ra' ; women refers to sex = 'F'; calculation = DIVidE(SUM(sex = 'F'), COunT(sex)) * 100;
Question: What percentage of patients who were born in 1980 and were diagnosed with RA are women?
SQL: SELECT cast(sum(CASE WHEN sex = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / count(id) FROM patient WHERE diagnosis = 'RA' AND strftime('%Y', birthday) = '1980'
Database: thrombosis_prediction
Note: male refers to sex = 'M'; underwent testing between 1995 and 1997 refers to `examination date` between '1995' and '1997'; Behcet refers to diagnosis; did not stay in the hospital refers to admission = '-';
Question: 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?
SQL: SELECT count(patient.id) FROM patient INNER JOIN examination ON patient.id = examination.id WHERE examination.diagnosis = 'Behcet' AND patient.sex = 'M' AND strftime('%Y', examination.`examination date`) BETWEEN '1995' AND '1997' AND patient.admission = '-'
Database: thrombosis_prediction
Note: female refers to sex = 'F'; white blood cells that were below 3.5 refers to wbc < 3.5;
Question: How many patients who were female got white blood cells that were below 3.5?
SQL: SELECT count(patient.id) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.wbc < 3.5 AND patient.sex = 'F'
Database: thrombosis_prediction
Note: dateDIFF(`examination date`, `first date`);
Question: How long did it take after patient number 821298 arrived at the hospital for the first time before her evaluation began?
SQL: SELECT strftime('%d', examination.`examination date`) - strftime('%d', patient.`first date`) FROM patient INNER JOIN examination ON patient.id = examination.id WHERE patient.id = 821298
Database: thrombosis_prediction
Note: uric acid within a normal range refers to ua > 8.0 and sex = 'M'OR ua > 6.5 and sex = 'F';
Question: Was the patient with the number 57266's uric acid within a normal range?
SQL: SELECT CASE WHEN (patient.sex = 'F' AND laboratory.ua > 6.5) OR (patient.sex = 'M' AND laboratory.ua > 8.0) THEN TRUE ELSE FALSE END FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE patient.id = 57266
Database: thrombosis_prediction
Note: AST glutamic oxaloacetic transaminase (got) index is above the normal range refers to got >= 60; when refers to date;
Question: When is the laboratory examination of patient '48473' where his/her AST glutamic oxaloacetic transaminase (GOT) index is above the normal range.
SQL: SELECT Date FROM laboratory WHERE id = 48473 AND got >= 60
Database: thrombosis_prediction
Note: AST glutamic oxaloacetic transaminase (got) index is within normal range refers to got < 60; examination in 1994 refers to year(date) = 1994;
Question: 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.
SQL: SELECT DISTINCT patient.sex, patient.birthday FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.got < 60 AND strftime('%Y', laboratory.date) = '1994'
Database: thrombosis_prediction
Note: male refers to sex = 'M'; ALT glutamic pylvic transaminase (gpt) exceed the normal range refers to gpt >= 60;
Question: Provide IDs for male patients with ALT glutamic pylvic transaminase (GPT) that have history of ALT glutamic pylvic transaminase (GPT) exceed the normal range.
SQL: SELECT DISTINCT patient.id FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE patient.sex = 'M' AND laboratory.gpt >= 60
Database: thrombosis_prediction
Note: ALT glutamic pylvic transaminase beyond the normal range refers to gpt > 60; The larger the birthday value, the younger the person is, and vice versa;
Question: Please provide the diagnosis of patients with ALT glutamic pylvic transaminase beyond the normal range by ascending order of their date of birth.
SQL: SELECT DISTINCT patient.diagnosis FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.gpt > 60 ORDER BY patient.birthday ASC
Database: thrombosis_prediction
Note: average index of the lactate dehydrogenase (ldh) refers to AVG(ldh); (ldh) within the normal range refers to ldh < 500;
Question: What is the average index of the lactate dehydrogenase (LDH) for all patients with lactate dehydrogenase (LDH) within the normal range.
SQL: SELECT avg(ldh) FROM laboratory WHERE ldh < 500
Database: thrombosis_prediction
Note: age refers to SUBTraCT(year(current_timestamp), year(birthday)); lactate dehydrogenase (ldh) between 100-300 index above the normal range refers to ldh between 600 and 800;
Question: Provide the ID and age of patient with lactate dehydrogenase (LDH) between 100-300 index above the normal range.
SQL: SELECT DISTINCT patient.id, strftime('%Y', CURRENT_TIMESTAMP) - strftime('%Y', patient.birthday) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.ldh > 600 AND laboratory.ldh < 800
Database: thrombosis_prediction
Note: alkaliphophatase (alp) within normal range refers to alp < 300; inpatient refers to admission = '+'; outpatient refers to admission = '-';
Question: For patients with alkaliphophatase (ALP) within normal range, were they treated as inpatient or outpatient?
SQL: SELECT patient.admission FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.alp < 300
Database: thrombosis_prediction
Note: alkaliphophatase (alp) within normal range refers to alp < 300;
Question: Name the ID of the patient who is born on the April 1st, 1982. Is his/her alkaliphophatase (ALP) within normal range?
SQL: SELECT patient.id , CASE WHEN laboratory.alp < 300 THEN 'normal' ELSE 'abNormal' END FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE patient.birthday = '1982-04-01'
Database: thrombosis_prediction
Note: total protein (tp) below the lower range of the normal index refers to tp < 6.0;
Question: List ID, sex and date of birth of patient whose total protein (TP) below the lower range of the normal index.
SQL: SELECT DISTINCT patient.id, patient.sex, patient.birthday FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.tp < 6.0
Database: thrombosis_prediction
Note: 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);
Question: For all female patient with total protein (TP) beyond the normal index, what is the deviation of their TP idex from the normal.
SQL: SELECT laboratory.tp - 8.5 FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE patient.sex = 'F' AND laboratory.tp > 8.5
Database: thrombosis_prediction
Note: male = sex = 'M'; albumin not within range refers to alb <= 3.5 or alb >= 5.5;
Question: Sort in descending order all patients by birthday for male patient with albumin not within range.
SQL: SELECT DISTINCT patient.id FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE patient.sex = 'M' AND (laboratory.alb <= 3.5 OR laboratory.alb >= 5.5) ORDER BY patient.birthday DESC
Database: thrombosis_prediction
Note: Year(birthday) = '1982'; albumin is within normal range refers to alb between 3.5 and 5.5;
Question: For all patient born in 1982, state if their albumin is within normal range.
SQL: SELECT CASE WHEN laboratory.alb >= 3.5 AND laboratory.alb <= 5.5 THEN 'normal' ELSE 'abnormal' END FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE strftime('%Y', patient.birthday) = '1982'
Database: thrombosis_prediction
Note: uric acid (ua) beyond the normal range refers to ua > 8.0 and sex = 'M' or ua > 6.5 and sex = 'F'; female refers to sex = 'F';
Question: What is the percentage of the female patient whose uric acid (UA) beyond the normal range?
SQL: SELECT cast(sum(CASE WHEN laboratory.ua > 6.5 THEN 1 ELSE 0 END) AS REAL) * 100 / count(patient.id) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE patient.sex = 'F'
Database: thrombosis_prediction
Note: 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);
Question: For all patients with normal uric acid (UA), what is the average UA index based on their latest laboratory examination result?
SQL: SELECT avg(laboratory.ua) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE (laboratory.ua < 6.5 AND patient.sex = 'F') OR (laboratory.ua < 8.0 AND patient.sex = 'M') AND laboratory.date = ( SELECT max(Date) FROM laboratory )
Database: thrombosis_prediction
Note: urea nitrogen (un) just within the borderline of passing refers to un = 29;
Question: Provide all ID, sex and birthday of patients whose urea nitrogen (UN) just within the borderline of passing?
SQL: SELECT DISTINCT patient.id, patient.sex, patient.birthday FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.un = 29
Database: thrombosis_prediction
Note: within the un normal index refers to un < 30; diagnosis = 'ra';
Question: Provide the ID, sex, birthday of all patients diagnosed with 'RA' that are within the UN normal index.
SQL: SELECT DISTINCT patient.id, patient.sex, patient.birthday FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.un < 30 AND patient.diagnosis = 'RA'
Database: thrombosis_prediction
Note: creatinine (cre) out of the normal range refers to cre >= 1.5; Male refers to sex = 'M';
Question: How many male patients are are with creatinine index out of the normal range?
SQL: SELECT count(patient.id) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.cre >= 1.5 AND patient.sex = 'M'
Database: thrombosis_prediction
Note: creatinine (cre) not within the normal range refers to cre >= 1.5; male refers to sex = 'M'; female refers to sex = 'F'; calculation = (SUM(sex = 'M') > SUM(sex = 'F')) where cre >= 1.5;
Question: Are there more male patients with creatinine not within the normal range than female? True or False?
SQL: SELECT CASE WHEN sum(CASE WHEN patient.sex = 'M' THEN 1 ELSE 0 END) > sum(CASE WHEN patient.sex = 'F' THEN 1 ELSE 0 END) THEN 'True' ELSE 'False' END FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.cre >= 1.5
Database: thrombosis_prediction
Note: the highest total bilirubin refers to MAX(t-bil);
Question: What is the highest total bilirubin level recorded? List out the patient details with ID, sex and birthday with that index.
SQL: SELECT laboratory.`t-bil`, patient.id, patient.sex, patient.birthday FROM patient INNER JOIN laboratory ON patient.id = laboratory.id ORDER BY laboratory.`t-bil` DESC LIMIT 1
Database: thrombosis_prediction
Note: List refers to GROUP_CONCAT(DISTINCT id); total bilirubin (t-bil) not within normal range refers to t-bil >= 2.0;
Question: List and group all patients by sex for total bilirubin (T-BIL) level not within the normal range.
SQL: SELECT patient.id,patient.sex FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.`t-bil` >= 2.0 GROUP BY patient.sex,patient.id
Database: thrombosis_prediction
Note: oldest patient refers to MIN(birthday); highest total cholesterol refers to MAX(t-cho);
Question: Who is the oldest patient with the highest total cholesterol (T-CHO). State the patient ID and T-CHO index.
SQL: SELECT patient.id, laboratory.`t-cho` FROM patient INNER JOIN laboratory ON patient.id = laboratory.id ORDER BY laboratory.`t-cho` DESC, patient.birthday ASC LIMIT 1
Database: thrombosis_prediction
Note: average age = DIVidE(SUM(SUBTraCT(YEAR(NOW()), YEAR(birthday))), COunT(id)); male patient refers to sex = 'M'; high cholesterol refers to `t-cho` >= 250;
Question: What is the average age of the male patient with high cholesterol?
SQL: SELECT avg(strftime('%Y', date('NOW')) - strftime('%Y', patient.birthday)) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.`t-cho` >= 250 AND patient.sex = 'M'
Database: thrombosis_prediction
Note: triglyceride (tg) index greater than 100 of the normal range refers to tg > 300;
Question: Provide list of patients and their diagnosis with triglyceride (TG) index greater than 100 of the normal range?
SQL: SELECT patient.id, patient.diagnosis FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.tg > 300
Database: thrombosis_prediction
Note: triglyceride (tg) level beyond the normal range refers to tg >= 200; more than 50 years of age = SUBTraCT(year(current_timestamp), year(birthday)) > 50; Should consider DISTINCT in the final result;
Question: For all patients with triglyceride (TG) level beyond the normal range, how many are age more than 50 years?
SQL: SELECT count(DISTINCT patient.id) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.tg >= 200 AND strftime('%Y', CURRENT_TIMESTAMP) - strftime('%Y', patient.birthday) > 50
Database: thrombosis_prediction
Note: outpatient refers to admission = '-'; normal range of creatinine phosphokinase refers to cpk < 250;
Question: List all outpatient within normal range of creatinine phosphokinase. Give me the distinct ids.
SQL: SELECT DISTINCT patient.id FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.cpk < 250 AND patient.admission = '-'
Database: thrombosis_prediction
Note: 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;
Question: For patient born between 1936-1956, how many male patients have creatinine phosphokinase beyond the normal range?
SQL: SELECT count(DISTINCT patient.id) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE strftime('%Y', patient.birthday) BETWEEN '1936' AND '1956' AND patient.sex = 'M' AND laboratory.cpk >= 250
Database: thrombosis_prediction
Note: 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;
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.
SQL: SELECT DISTINCT patient.id, patient.sex , strftime('%Y', CURRENT_TIMESTAMP) - strftime('%Y', patient.birthday) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.glu >= 180 AND laboratory.`t-cho` < 250
Database: thrombosis_prediction
Note: 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;
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.
SQL: SELECT DISTINCT patient.id, laboratory.glu FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE strftime('%Y', patient.`first date`) = '1991' AND laboratory.glu < 180