1sf/bird-sql-dev-xresults huggingface dataset:
Database: superhero
Question: Please list the superhero names of all the superheroes that have blue eyes and blond hair.
Evidence: blue eyes refers to colour = 'Blue' and eye_colour_id = colour.id; blond hair refers to colour = 'Blond' and hair_colour_id = colour.id; super power of "Agility" refers to power_name = 'Agility'
SQL: SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id INNER JOIN colour AS T3 ON T1.hair_colour_id = T3.id WHERE T2.colour = 'Blue' AND T3.colour = 'Blond'
Database: superhero
Question: How many superheroes are published by Marvel Comics?
Evidence: published by Marvel Comics refers to publisher_name = 'Marvel Comics'
SQL: SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Marvel Comics'
Database: superhero
Question: Rank heroes published by Marvel Comics by their height in descending order.
Evidence: name refers to superhero_name; the tallest hero refers to MAX(height_cm); published by Marvel Comics refers to publisher_name = 'Marvel Comics'
SQL: SELECT superhero_name, height_cm, RANK() OVER (ORDER BY height_cm DESC) AS HeightRank FROM superhero INNER JOIN publisher ON superhero.publisher_id = publisher.id WHERE publisher.publisher_name = 'Marvel Comics'
Database: superhero
Question: Who is the publisher of Sauron?
Evidence: the publisher refers to publisher_name; Sauron refers to superhero_name = 'Sauron'
SQL: SELECT T2.publisher_name FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.superhero_name = 'Sauron'
Database: superhero
Question: Rank superheroes from Marvel Comics by their eye color popularity, starting with the most common color.
Evidence: the superheroes from Marvel Comics refers to publisher_name = 'Marvel Comics'; most common color refers to COUNT(superhero.id) DESC;
SQL: SELECT colour.colour AS EyeColor, COUNT(superhero.id) AS Count, RANK() OVER (ORDER BY COUNT(superhero.id) DESC) AS PopularityRank FROM superhero INNER JOIN colour ON superhero.eye_colour_id = colour.id INNER JOIN publisher ON superhero.publisher_id = publisher.id WHERE publisher.publisher_name = 'Marvel Comics' GROUP BY colour.colour
Database: superhero
Question: What is the average height of the superheroes from Marvel Comics?
Evidence: superheroes from Marvel Comics refers to publisher_name = 'Marvel Comics'; average height of the superheroes refers to AVG(height_cm)
SQL: SELECT AVG(T1.height_cm) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Marvel Comics'
Database: superhero
Question: List the superheroes from Marvel Comics who have the super power of 'Super Strength'.
Evidence: the superheroes from Marvel Comics refers to publisher_name = 'Marvel Comics'; super power of "Super Strength" refers to power_name = 'Super Strength';
SQL: SELECT superhero_name FROM superhero AS T1 WHERE EXISTS (SELECT 1 FROM hero_power AS T2 INNER JOIN superpower AS T3 ON T2.power_id = T3.id WHERE T3.power_name = 'Super Strength' AND T1.id = T2.hero_id)AND EXISTS (SELECT 1 FROM publisher AS T4 WHERE T4.publisher_name = 'Marvel Comics' AND T1.publisher_id = T4.id)
Database: superhero
Question: How many superheroes did DC Comics publish?
Evidence: superheroes that DC Comics published refers to publisher_name = 'DC Comics'
SQL: SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'DC Comics'
Database: superhero
Question: Which publisher published the slowest superhero?
Evidence: the slowest superhero refers to attribute_name = 'Speed' where MIN(attribute_value); publisher refers to publisher_name
SQL: SELECT T2.publisher_name FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN hero_attribute AS T3 ON T1.id = T3.hero_id INNER JOIN attribute AS T4 ON T3.attribute_id = T4.id WHERE T4.attribute_name = 'Speed' ORDER BY T3.attribute_value LIMIT 1
Database: superhero
Question: How many gold-eyed superheroes did Marvel Comics publish?
Evidence: gold-eyed refers to colour = 'Gold' where eye_colour_id = colour.id; superheroes that Marvel Comics published refers to publisher_name = 'Marvel Comics'
SQL: SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN colour AS T3 ON T1.eye_colour_id = T3.id WHERE T2.publisher_name = 'Marvel Comics' AND T3.colour = 'Gold'
Database: superhero
Question: What is the publisher's name of Blue Beetle II?
Evidence: Blue Beetle II refers to superhero_name = 'Blue Beetle II'
SQL: SELECT T2.publisher_name FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.superhero_name = 'Blue Beetle II'
Database: superhero
Question: How many superheroes with blonde hair are there?
Evidence: superheroes with blonde hair refers to colour = 'Blond' where hair_colour_id = colour.id
SQL: SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.hair_colour_id = T2.id WHERE T2.colour = 'Blond'
Database: superhero
Question: Who is the dumbest superhero?
Evidence: the dumbest superhero refers to MIN(attribute_value) where attribute_name = 'Intelligence'
SQL: SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id WHERE T3.attribute_name = 'Intelligence' ORDER BY T2.attribute_value LIMIT 1
Database: superhero
Question: What is Copycat's race?
Evidence: Copycat is the superhero_name;
SQL: SELECT T2.race FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T1.superhero_name = 'Copycat'
Database: superhero
Question: Which superheroes have a durability attribute value of less than 50?
Evidence: durability of less than 50 refers to attribute_name = 'Durability' AND attribute_value < 50
SQL: SELECT superhero_name FROM superhero AS T1 WHERE EXISTS (SELECT 1 FROM hero_attribute AS T2 INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id WHERE T3.attribute_name = 'Durability' AND T2.attribute_value < 50 AND T1.id = T2.hero_id)
Database: superhero
Question: What are the names of the superheroes with the power of death touch?
Evidence: name of superheroes refers to refers to superhero_name; the power of death touch refers to power_name = 'Death Touch'
SQL: SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id INNER JOIN superpower AS T3 ON T2.power_id = T3.id WHERE T3.power_name = 'Death Touch'
Database: superhero
Question: How many female superheroes have a strength value of 100?
Evidence: female refers to gender = 'Female'; strength value of 100 refers to attribute_name = 'Strength' AND attribute_value = 100
SQL: SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id INNER JOIN gender AS T4 ON T1.gender_id = T4.id WHERE T3.attribute_name = 'Strength' AND T2.attribute_value = 100 AND T4.gender = 'Female'
Database: superhero
Question: What is the name of the superhero that has the most powers?
Evidence: name of the superhero refers to superhero_name; superhero that has the most powers refers to MAX(COUNT(superhero_name))
SQL: SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id GROUP BY T1.superhero_name ORDER BY COUNT(T2.hero_id) DESC LIMIT 1
Database: superhero
Question: How many vampire superheroes are there?
Evidence: vampire superheroes refers to race = 'Vampire'
SQL: SELECT COUNT(T1.superhero_name) FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T2.race = 'Vampire'
Database: superhero
Question: What is the percentage of superheroes who act in their own self-interest or make decisions based on their own moral code? Indicate how many of the said superheroes were published by Marvel Comics.
Evidence: published by Marvel Comics refers to publisher_name = 'Marvel Comics'; superheroes who act in their own self-interest or make decisions based on their own moral code refers to alignment = 'Bad'; calculation = MULTIPLY(DIVIDE(SUM(alignment = 'Bad); count(id)), 100)
SQL: SELECT (CAST(COUNT(*) AS REAL) * 100 / (SELECT COUNT(*) FROM superhero)), CAST(SUM(CASE WHEN T2.publisher_name = 'Marvel Comics' THEN 1 ELSE 0 END) AS REAL) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN alignment AS T3 ON T3.id = T1.alignment_id WHERE T3.alignment = 'Bad'
Database: superhero
Question: Between DC and Marvel Comics, which publisher has published more superheroes? Find the difference in the number of superheroes they have published.
Evidence: DC refers to publisher_name = 'DC Comics'; Marvel Comics refers to publisher_name = 'Marvel Comics'; calculation = SUBTRACT(SUM(publisher_name = 'Marvel Comics'), SUM(publisher_name = 'DC Comics'))
SQL: SELECT SUM(CASE WHEN T2.publisher_name = 'Marvel Comics' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.publisher_name = 'DC Comics' THEN 1 ELSE 0 END) FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id
Database: superhero
Question: Give the publisher ID of Star Trek.
Evidence: Star Trek is the publisher_name;
SQL: SELECT id FROM publisher WHERE publisher_name = 'Star Trek'
Database: superhero
Question: Calculate the average attribute value of all superheroes.
Evidence: average attribute value of all superheroes refers to AVG(attribute_value)
SQL: SELECT AVG(attribute_value) FROM hero_attribute
Database: superhero
Question: What is the total number of superheroes without full name?
Evidence: superheroes without full name refers to full_name IS NULL
SQL: SELECT COUNT(id) FROM superhero WHERE full_name IS NULL
Database: superhero
Question: What is the eye colour of superhero with superhero ID 75?
Evidence: eye colour refers to colour where eye_colour_id = colour.id;
SQL: SELECT T2.colour FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id WHERE T1.id = 75
Database: superhero
Question: Provide the superpowers of the superhero called Deathlok.
Evidence: superpowers refers to power_name; Deathlok refers to superhero_name = 'Deathlok'
SQL: SELECT T3.power_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id INNER JOIN superpower AS T3 ON T2.power_id = T3.id WHERE T1.superhero_name = 'Deathlok'
Database: thrombosis_prediction
Question: What is the percentage of female patient were born after 1930?
Evidence: female refers to Sex = 'F'; patient who were born after 1930 refers to year(Birthday) > '1930'; calculation = DIVIDE(COUNT(ID) where year(Birthday) > '1930' and SEX = 'F'), (COUNT(ID) where SEX = 'F')
SQL: SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', Birthday) > '1930' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient WHERE SEX = 'F'
Database: thrombosis_prediction
Question: For patient born between Year 1930 to 1940, how many percent of them were inpatient?
Evidence: patient born between Year 1930 to 1940 refers to year(Birthday) BETWEEN '1930-01-01' AND '1940-12-31'; inpatient refers to Admission = '+'
SQL: SELECT CAST(SUM(CASE WHEN Admission = '+' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient WHERE STRFTIME('%Y', Birthday) BETWEEN '1930' AND '1940'
Database: thrombosis_prediction
Question: What is the ratio of outpatient to inpatient followed up treatment among all the 'SLE' diagnosed patient?
Evidence: 'SLE' diagnosed patient means Diagnosis = 'SLE'; inpatient refers to Admission = '+'; outpatient refers to Admission = '-'; calculation =  DIVIDE(COUNT(ID) where Diagnosis = 'SLE' and Admission = '+', COUNT(ID) where Diagnosis = 'SLE' and Admission = '-')
SQL: SELECT SUM(CASE WHEN Admission = '+' THEN 1.0 ELSE 0 END) / SUM(CASE WHEN Admission = '-' THEN 1 ELSE 0 END) FROM Patient WHERE Diagnosis = 'SLE'
Database: thrombosis_prediction
Question: What is the disease patient '30609' diagnosed with. List all the date of laboratory tests done for this patient.
Evidence: '30609' is the Patient ID; disease means Diagnosis
SQL: SELECT T1.Diagnosis, T2.Date FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.ID = 30609
Database: thrombosis_prediction
Question: State the sex and birthday of patient ID '163109'. When was the examination taken and what symptom does the patient had.
Evidence: When was the examination taken refers to `Examination Date`
SQL: SELECT T1.SEX, T1.Birthday, T2.`Examination Date`, T2.Symptoms FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.ID = 163109
Database: thrombosis_prediction
Question: List the patient ID, sex and birthday of patient with LDH beyond normal range.
Evidence: LDH beyond normal range refers to LDH > '500';
SQL: SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH > 500
Database: thrombosis_prediction
Question: State the ID and age of patient with positive degree of coagulation.
Evidence: age refers to SUBTRACT(year(current_timestamp), year(Birthday)); positive degree of coagulation refers to RVVT = '+';
SQL: SELECT DISTINCT T1.ID, STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.RVVT = '+'
Database: thrombosis_prediction
Question: For patients with severe degree of thrombosis, list their ID, sex and disease the patient is diagnosed with.
Evidence: severe degree of thrombosis refers to thrombosis = 2; disease refers to diagnosis;
SQL: SELECT DISTINCT T1.ID, T1.SEX, T1.Diagnosis FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Thrombosis = 2
Database: thrombosis_prediction
Question: List all patients who were born in 1937 whose total cholesterol was beyond the normal range.
Evidence: who were born in 1937 refers to year(birthday) = '1937'; total cholesterol was beyond the normal range refers to `T-CHO` > = '250'
SQL: SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T1.Birthday) = '1937' AND T2.`T-CHO` >= 250
Database: thrombosis_prediction
Question: For patient with albumin level lower than 3.5, list their ID, sex and diagnosis.
Evidence: albumin level lower than 3.5 refers to ALB < 3.5;
SQL: SELECT DISTINCT T1.ID, T1.SEX, T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.ALB < 3.5
Database: thrombosis_prediction
Question: What is the percentage of female patient had total protein not within the normal range?
Evidence: female refers to sex = 'F'; total protein not within the normal range refers to TP < '6.0' or TP > '8.5'; calculation = DIVIDE((ID where sex = 'F' and TP < '6.0' or TP > '8.5'), COUNT(ID)) * 100
SQL: SELECT CAST(SUM(CASE WHEN T1.SEX = 'F' AND (T2.TP < 6.0 OR T2.TP > 8.5) THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F'
Database: thrombosis_prediction
Question: For in-patient age 50 and above, what is their average anti-cardiolipin antibody (IgG) concentration?
Evidence: in-patient refers to Admission = '+'; age 50 and above refers to SUBTRACT(year(current_timestamp), year(Birthday)) >= '50'; average anti-cardiolipin antibody (IgG) concentration refers to AVG(aCL IgG)
SQL: SELECT AVG(T2.`aCL IgG`) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) >= 50 AND T1.Admission = '+'
Database: thrombosis_prediction
Question: How many female patients who came at the hospital in 1997 was immediately followed at the outpatient clinic?
Evidence: female refers to sex = 'F'; came at the hospital in 1997 refers to year(Description) = '1997'; immediately followed at the outpatient clinic refers to Admission = '-'
SQL: SELECT COUNT(*) FROM Patient WHERE STRFTIME('%Y', Description) = '1997' AND SEX = 'F' AND Admission = '-'
Database: thrombosis_prediction
Question: What was the age of the youngest patient when they initially arrived at the hospital?
Evidence: age refers to SUBTRACT(YEAR(`First Date`),YEAR(Birthday))
SQL: SELECT MIN(STRFTIME('%Y', `First Date`) - STRFTIME('%Y', Birthday)) FROM Patient
Database: thrombosis_prediction
Question: How many of the patients with the most serious thrombosis cases examined in 1997 are women?
Evidence: the most serious thrombosis refers to Thrombosis = '1' (the most severe one); women refers to sex = 'F'
SQL: SELECT  COUNT(*) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F' AND STRFTIME('%Y', T2.`Examination Date`) = '1997' AND T2.Thrombosis = 1
Database: thrombosis_prediction
Question: What is the age gap between the youngest and oldest patient with a normal triglyceride recorded?
Evidence: age gap refers to SUBTRACT(MAX(year(Birthday)) - MIN(year(Birthday))); normal triglyceride refers to tg > = 200
SQL: SELECT STRFTIME('%Y', MAX(T1.Birthday)) - STRFTIME('%Y', MIN(T1.Birthday)) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG >= 200
Database: thrombosis_prediction
Question: What are the symptoms observed by the youngest patient to ever did a medical examination? Identify their diagnosis.
Evidence: The larger the birthday value, the younger the person is, and vice versa; symptoms observed refers to the symptoms is not NULL
SQL: SELECT T2.Symptoms, T1.Diagnosis FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T2.Symptoms IS NOT NULL ORDER BY T1.Birthday DESC LIMIT 1
Database: thrombosis_prediction
Question: For the year that concluded on December 31, 1998, how many male patients on average were tested in the lab each month?
Evidence: the year that concluded on December 31, 1998 refers to Date BETWEEN '1998-01-01' AND '1998-12-31'; male refers to SEX = 'M'; calculation = DIVIDE(COUNT(ID), 12)
SQL: SELECT CAST(COUNT(T1.ID) AS REAL) / 12 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T2.Date) = '1998' AND T1.SEX = 'M'
Database: thrombosis_prediction
Question: The oldest SJS patient's medical laboratory work was completed on what date, and what age was the patient when they initially arrived at the hospital?
Evidence: The larger the birthday value, the younger the person is, and vice versa; 'SJS' refers to diagnosis; (SUBTRACT(year(`First Date`)), year(Birthday)); age of the patients when they initially arrived at the hospital refers to year(Birthday)
SQL: SELECT T1.Date, STRFTIME('%Y', T2.`First Date`) - STRFTIME('%Y', T2.Birthday),T2.Birthday FROM Laboratory AS T1 INNER JOIN Patient AS T2 ON T1.ID = T2.ID WHERE T2.Diagnosis = 'SJS' AND T2.Birthday IS NOT NULL ORDER BY T2.Birthday ASC LIMIT 1
Database: thrombosis_prediction
Question: What is the ratio of male to female patients among all those with abnormal uric acid counts?
Evidence: male refers to SEX = 'M'; female refers to SEX = 'F'; abnormal uric acid refers to UA < = '8.0' where SEX = 'M', UA < = '6.5' where SEX = 'F'; calculation = DIVIDE(SUM(UA <= '8.0' and SEX = 'M'), SUM(UA <= '6.5 and SEX = 'F'))
SQL: SELECT CAST(SUM(CASE WHEN T2.UA <= 8.0 AND T1.SEX = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.UA <= 6.5 AND T1.SEX = 'F' THEN 1 ELSE 0 END) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID
Database: thrombosis_prediction
Question: How many patients hadn't undergone a medical examination until at least a year following their initial hospital visit?
Evidence: hadn't undergone a medical examination until at least a year refers to SUBTRACT(year(`Examination Date`), year(`First Date`)) > = 1
SQL: SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.Admission = '+' AND STRFTIME('%Y', T2.`Examination Date`) - STRFTIME('%Y', T1.`First Date`) >= 1
Database: thrombosis_prediction
Question: How many underage patients were examined during the course of the three-year period from 1990 to 1993?
Evidence: underage patients refers to year(Birthday) < 18; three-year period from 1990 to 1993 refers to year(`Examination Date`) between '1990' and '1993'
SQL: SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T2.`Examination Date`) BETWEEN '1990' AND '1993' AND STRFTIME('%Y', T2.`Examination Date`) - STRFTIME('%Y', T1.Birthday) < 18
Database: thrombosis_prediction
Question: How many male patients have elevated total bilirubin count?
Evidence: male refers to SEX = 'M'; elevated means above the normal range; total bilirubin above the normal range refers to `T-BIL` >= '2.0'
SQL: SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-BIL` >= 2.0 AND T1.SEX = 'M'
Database: thrombosis_prediction
Question: What is the most common illness that doctors identified among the patients whose lab work was done between 1/1/1985, and 12/31/1995?
Evidence: the most common illness refers to MAX(COUNT(Diagnosis)); lab work between 1/1/1985 and 12/31/1995 refers to `Examination Date` between '1985-01-01' and '1995-12-31 '
SQL: SELECT T2.Diagnosis FROM Examination AS T1 INNER JOIN Patient AS T2 ON T1.ID = T2.ID WHERE T1.`Examination Date` BETWEEN '1985-01-01' AND '1995-12-31' GROUP BY T2.Diagnosis ORDER BY COUNT(T2.Diagnosis) DESC LIMIT 1
Database: thrombosis_prediction
Question: What is the average age of patients as of year 1999 examined in the laboratory for the October of the year 1991?
Evidence: average age of patients as of year 1999 refers to AVG(SUBTRACT('1999', year(Birthday))); October of 1991 refers to Date BETWEEN '1991-10-01' AND '1991-10-30'
SQL: SELECT AVG('1999'  - STRFTIME('%Y', T2.Birthday)) FROM Laboratory AS T1 INNER JOIN Patient AS T2 ON T1.ID = T2.ID WHERE T1.Date BETWEEN '1991-10-01' AND '1991-10-30'
Database: thrombosis_prediction
Question: How old was the patient who had the highest hemoglobin count at the time of the examination, and what is the doctor's diagnosis?
Evidence: How old the patient refers to SUBTRACT(year(`Examination Date`), year(Birthday)); the highest hemoglobin count refers to MAX(HGB)
SQL: SELECT STRFTIME('%Y', T2.Date) - STRFTIME('%Y', T1.Birthday), T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID ORDER BY T2.HGB DESC LIMIT 1
Database: thrombosis_prediction
Question: What was the anti-nucleus antibody concentration level for the patient id 3605340 on 1996/12/2?
Evidence: anti-nucleus antibody refers to ANA; 1996/12/2 refers to `Examination Date` = '1996-12-02'
SQL: SELECT ANA FROM Examination WHERE ID = 3605340 AND `Examination Date` = '1996-12-02'
Database: thrombosis_prediction
Question: Was the total cholesterol status for the patient id 2927464 on 1995-9-4 at the normal level?
Evidence: total cholesterol normal level refers to N < 250
SQL: SELECT CASE WHEN `T-CHO` < 250 THEN 'Normal' ELSE 'Abnormal' END FROM Laboratory WHERE ID = 2927464 AND Date = '1995-09-04'
Database: thrombosis_prediction
Question: What was the gender of the first AORTITIS diagnosed patient?
Evidence: gender means SEX; 'AORTITIS' refers to Diagnosis;
SQL: SELECT SEX FROM Patient WHERE Diagnosis = 'AORTITIS' AND `First Date` IS NOT NULL ORDER BY `First Date` ASC LIMIT 1
Database: thrombosis_prediction
Question: For the patient who was diagnosed with SLE on 1994/2/19, what was his/her anti-Cardiolipin antibody concentration status on 1993/11/12?
Evidence: diagnosed with SLE refers to Diagnosis = 'SLE'; 1994/2/19 refers to Description = '1994-02-19'; anti-Cardiolipin refers to aCL IgM; 1993/11/12 refers to Examination Date = '1993/11/12'
SQL: SELECT `aCL IgA`, `aCL IgG`, `aCL IgM` FROM Examination WHERE ID IN ( SELECT ID FROM Patient WHERE Diagnosis = 'SLE' AND Description = '1994-02-19' ) AND `Examination Date` = '1993-11-12'
Database: thrombosis_prediction
Question: Was the patient a man or a women whose ALT glutamic pylvic transaminase status got 9 on 1992-6-12?
Evidence: man refers to SEX = 'M'; women refers to SEX = 'F'; ALT glutamic pylvic transaminase status got 9 GPT = '9'; 1992/6/12 refers to Date = '1992-06-12'
SQL: SELECT T1.SEX FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GPT = 9.0 AND T2.Date = '1992-06-12'