Chinastark/bird_dataset huggingface dataset:
Database: european_football_2
Note: vision scores of 90 and above refers to vision > 89;
Question: Locate players with vision scores of 90 and above, state the country of these players.
SQL: SELECT DISTINCT country.name FROM player_attributes INNER JOIN player ON player_attributes.player_api_id = player.player_api_id INNER JOIN MATCH ON player.player_api_id = MATCH.home_player_8 INNER JOIN country ON MATCH.country_id = country.id WHERE player_attributes.vision > 89
Database: european_football_2
Note: heaviest average weights refers to MAX(AVG(weight));
Question: Which country's players have the heaviest average weights?
SQL: SELECT country.name FROM country INNER JOIN MATCH ON country.id = MATCH.country_id INNER JOIN player ON MATCH.home_player_1 = player.player_api_id GROUP BY country.name ORDER BY avg(player.weight) DESC LIMIT 1
Database: european_football_2
Note: slow speed class refers to buildupplayspeedclass = 'Slow'; long name refers to team_long_name;
Question: List down the long name for slow speed class team.
SQL: SELECT DISTINCT team.team_long_name FROM team INNER JOIN team_attributes ON team.team_api_id = team_attributes.team_api_id WHERE team_attributes.buildupplayspeedclass = 'Slow'
Database: european_football_2
Note: played safe while creating chance of passing refers to chancecreationpassingclass = 'Safe'; short name of team refers to team_short_name;
Question: What are the short name of team who played safe while creating chance of passing?
SQL: SELECT DISTINCT team.team_short_name FROM team INNER JOIN team_attributes ON team.team_api_id = team_attributes.team_api_id WHERE team_attributes.chancecreationpassingclass = 'Safe'
Database: european_football_2
Note: average heights refers to Avg(height); Italy is name of country;
Question: What is the average heights of Italy players?
SQL: SELECT cast(sum(player.height) AS REAL) / count(player.id) FROM player INNER JOIN MATCH ON player.id = MATCH.id INNER JOIN country ON MATCH.country_id = country.id WHERE country.name = 'Italy'
Database: european_football_2
Note: over 180 cm tall refers to height > 180; name of football player refers to player_name;
Question: Please provide the names of top three football players who are over 180 cm tall in alphabetical order.
SQL: SELECT player_name FROM player WHERE height > 180 ORDER BY player_name LIMIT 3
Database: european_football_2
Note: first name "Aaron" refers to player_name LIKE 'Aaron%'; born after the 1990s refers to birthday > '1990';
Question: How many football players born after the 1990s have the first name "Aaron"?
SQL: SELECT count(id) FROM player WHERE birthday > '1990' AND player_name LIKE 'Aaron%'
Database: european_football_2
Note: difference between players 6 and 23's jumping scores refers to SUBTRACT(jumping AND id = 6,jumping AND id = 23);
Question: What is the difference between players 6 and 23's jumping scores?
SQL: SELECT sum(CASE WHEN player_attributes.id = 6 THEN player_attributes.jumping ELSE 0 END) - sum(CASE WHEN player_attributes.id = 23 THEN player_attributes.jumping ELSE 0 END) FROM player_attributes AS player_attributes
Database: european_football_2
Note: lowest potential players refers to MIN(potential); prefer to use the right foot when attacking refers to preferred_foot = 'right';
Question: Please provide top five football players' IDs who are among the lowest potential players and prefer to use the right foot when attacking.
SQL: SELECT id FROM player_attributes WHERE preferred_foot = 'right' ORDER BY potential DESC LIMIT 5
Database: european_football_2
Note: highest potential score for crossing refers to MAX(crossing); preferred to use their left foots while attacking refers to preferred_foot = 'left';
Question: How many players had the highest potential score for crossing that preferred to use their left foots while attacking?
SQL: SELECT count(player_attributes.id) FROM player_attributes WHERE player_attributes.preferred_foot = 'left' AND player_attributes.crossing = ( SELECT max(crossing) FROM player_attributes)
Database: european_football_2
Note: strength and stamina score of more than 80 refers to stamina > 80 and strength > 80;
Question: What percentage of players have a strength and stamina score of more than 80?
SQL: SELECT cast(count(CASE WHEN strength > 80 AND stamina > 80 THEN id ELSE NULL END) AS REAL) * 100 / count(id) FROM player_attributes t
Database: european_football_2
Question: In what country did the Poland Ekstraklasa take place?
SQL: SELECT name FROM country WHERE id IN ( SELECT country_id FROM league WHERE name = 'Poland Ekstraklasa' )
Database: european_football_2
Note: September 24, 2008 refers to date like '2008-09-24%'; in the Belgian Jupiler league refers to league.name = 'Belgium Jupiler league'; final score for home team refers to home_team_goal; final score for away team refers to away_team_goal;
Question: What was the final score for the match on September 24, 2008, in the Belgian Jupiler League between the home team and the away team?
SQL: SELECT MATCH.home_team_goal, MATCH.away_team_goal FROM league INNER JOIN MATCH ON league.id = MATCH.league_id WHERE league.name = 'Belgium Jupiler League' AND MATCH.`date` LIKE '2008-09-24%'
Database: european_football_2
Note: Alexis Blin's refers to player_name = 'Alexis Blin';
Question: What are Alexis Blin's sprint speed, agility, and acceleration scores?
SQL: SELECT sprint_speed, agility, acceleration FROM player_attributes WHERE player_api_id IN ( SELECT player_api_id FROM player WHERE player_name = 'Alexis Blin' )
Database: european_football_2
Note: KSV Cercle Brugge refers to team_long_name = 'KSV Cercle Brugge'; speed class refers to buildupplayspeedclass;
Question: Does the KSV Cercle Brugge team have a slow, balanced or fast speed class?
SQL: SELECT DISTINCT team_attributes.buildupplayspeedclass FROM team_attributes INNER JOIN team ON team_attributes.team_api_id = team.team_api_id WHERE team.team_long_name = 'KSV Cercle Brugge'
Database: european_football_2
Note: In the 2015–2016 season refers to season = '2015/2016';
Question: In the 2015–2016 season, how many games were played in the Italian Serie A league?
SQL: SELECT count(MATCH.id) FROM league INNER JOIN MATCH ON league.id = MATCH.league_id WHERE league.name = 'Italy Serie A' AND MATCH.season = '2015/2016'
Database: european_football_2
Note: highest score of the home team refers to MAX(home_team_goal);
Question: What was the highest score of the home team in the Netherlands Eredivisie league?
SQL: SELECT max(MATCH.home_team_goal) FROM league INNER JOIN MATCH ON league.id = MATCH.league_id WHERE league.name = 'Netherlands Eredivisie'
Database: european_football_2
Note: finishing rate refer to finishing; curve score refer to curve; heaviest weight refers to MAX(weight);
Question: Please state the finishing rate and curve score of the player who has the heaviest weight.
SQL: SELECT id, finishing, curve FROM player_attributes WHERE player_api_id = ( SELECT player_api_id FROM player ORDER BY weight DESC LIMIT 1 ) LIMIT 1
Database: european_football_2
Note: in the 2015-2016 season refers to season = '2015/2016'; league with most games refers to league.name where MAX(COUNT(id));
Question: Which top 4 leagues had the most games in the 2015-2016 season?
SQL: SELECT league.name FROM league INNER JOIN MATCH ON league.id = MATCH.league_id WHERE MATCH.season = '2015/2016' GROUP BY league.name ORDER BY count(MATCH.id) DESC LIMIT 4
Database: european_football_2
Note: full name refers to team_long_name; away team refers to away_team_api_id; scored the most goals refers to MAX(away_team_goal);
Question: Please provide the full name of the away team that scored the most goals.
SQL: SELECT team.team_long_name FROM MATCH INNER JOIN team ON MATCH.away_team_api_id = team.team_api_id ORDER BY MATCH.away_team_goal DESC LIMIT 1
Database: european_football_2
Note: overall strength is the greatest refers to MAX(overall_rating);
Question: Please name one player whose overall strength is the greatest.
SQL: SELECT DISTINCT player.player_name FROM player INNER JOIN player_attributes ON player.player_api_id = player_attributes.player_api_id WHERE player_attributes.overall_rating = ( SELECT max(overall_rating) FROM player_attributes)
Database: european_football_2
Note: percentage refers to DIVidE(COUNT(height < 180 AND overall_rating > 70),COUNT(id)) * 100;
Question: What is the percentage of players that are under 180 cm who have an overall strength of more than 70?
SQL: SELECT cast(count(CASE WHEN player_attributes.overall_rating > 70 THEN player.id ELSE NULL END) AS REAL) * 100 / count(player.id) percent FROM player INNER JOIN player_attributes ON player.player_api_id = player_attributes.player_api_id WHERE player.height < 180
Database: thrombosis_prediction
Note: male refers to sex = 'M'; in-patient refers to admission = '+'; outpatient refers to admission = '-'; percentage = DIVidE(COunT(id) where sex = 'M' and admission = '+', COunT(id) where sex  = 'M' and admission = '-');
Question: Are there more in-patient or outpatient who were male? What is the deviation in percentage?
SQL: SELECT cast(sum(CASE WHEN admission = '+' THEN 1 ELSE 0 END) AS REAL) * 100 / sum(CASE WHEN admission = '-' THEN 1 ELSE 0 END) FROM patient WHERE sex = 'M'
Database: thrombosis_prediction
Note: 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');
Question: What is the percentage of female patient were born after 1930?
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
Note: patient born between Year 1930 to 1940 refers to year(birthday) BETWEEN '1930-01-01' AND '1940-12-31'; inpatient refers to admission = '+';
Question: For patient born between Year 1930 to 1940, how many percent of them were inpatient?
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
Note: '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 = '-');
Question: What is the ratio of outpatient to inpatient followed up treatment among all the 'SLE' diagnosed patient?
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
Note: '30609' is the patient id; disease means diagnosis;
Question: What is the disease patient '30609' diagnosed with. List all the date of laboratory tests done for this patient.
SQL: SELECT patient.diagnosis, laboratory.date FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE patient.id = 30609
Database: thrombosis_prediction
Note: When was the examination taken refers to `examination date`;
Question: State the sex and birthday of patient ID '163109'. When was the examination taken and what symptom does the patient had.
SQL: SELECT patient.sex, patient.birthday, examination.`examination date`, examination.symptoms FROM patient INNER JOIN examination ON patient.id = examination.id WHERE patient.id = 163109
Database: thrombosis_prediction
Note: ldh beyond normal range refers to ldh > '500';
Question: List the patient ID, sex and birthday of patient with LDH beyond normal range.
SQL: SELECT DISTINCT patient.id, patient.sex, patient.birthday FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.ldh > 500
Database: thrombosis_prediction
Note: age refers to SUBTraCT(year(current_timestamp), year(birthday)); positive degree of coagulation refers to rvvt = '+';
Question: State the ID and age of patient with positive degree of coagulation.
SQL: SELECT DISTINCT patient.id, strftime('%Y', CURRENT_TIMESTAMP) - strftime('%Y', patient.birthday) FROM patient INNER JOIN examination ON patient.id = examination.id WHERE examination.rvvt = '+'
Database: thrombosis_prediction
Note: severe degree of thrombosis refers to thrombosis = 2; disease refers to diagnosis;
Question: For patients with severe degree of thrombosis, list their ID, sex and disease the patient is diagnosed with.
SQL: SELECT DISTINCT patient.id, patient.sex, patient.diagnosis FROM patient INNER JOIN examination ON patient.id = examination.id WHERE examination.thrombosis = 2
Database: thrombosis_prediction
Note: who were born in 1937 refers to year(birthday) = '1937'; total cholesterol was beyond the normal range refers to `t-cho` >= '250';
Question: List all patients who were born in 1937 whose total cholesterol was beyond the normal range.
SQL: SELECT DISTINCT patient.id FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE strftime('%Y', patient.birthday) = '1937' AND laboratory.`t-cho` >= 250
Database: thrombosis_prediction
Note: albumin level lower than 3.5 refers to alb < 3.5;
Question: For patient with albumin level lower than 3.5, list their ID, sex and diagnosis.
SQL: SELECT DISTINCT patient.id, patient.sex, patient.diagnosis FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.alb < 3.5
Database: thrombosis_prediction
Note: 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;
Question: What is the percentage of female patient had total protein not within the normal range?
SQL: SELECT cast(sum(CASE WHEN patient.sex = 'F' AND (laboratory.tp < 6.0 OR laboratory.tp > 8.5) THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE patient.sex = 'F'
Database: thrombosis_prediction
Note: 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);
Question: For in-patient age 50 and above, what is their average anti-cardiolipin antibody (IgG) concentration?
SQL: SELECT avg(examination.`acl igg`) FROM patient INNER JOIN examination ON patient.id = examination.id WHERE strftime('%Y', CURRENT_TIMESTAMP) - strftime('%Y', patient.birthday) >= 50 AND patient.admission = '+'
Database: thrombosis_prediction
Note: 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 = '-';
Question: How many female patients who came at the hospital in 1997 was immediately followed at the outpatient clinic?
SQL: SELECT count(*) FROM patient WHERE strftime('%Y', description) = '1997' AND sex = 'F' AND admission = '-'
Database: thrombosis_prediction
Note: age refers to SUBTraCT(YEAR(`first date`),YEAR(birthday));
Question: What was the age of the youngest patient when they initially arrived at the hospital?
SQL: SELECT min(strftime('%Y', `first date`) - strftime('%Y', birthday)) FROM patient
Database: thrombosis_prediction
Note: the most serious thrombosis refers to thrombosis = '1' (the most severe one); women refers to sex = 'F';
Question: How many of the patients with the most serious thrombosis cases examined in 1997 are women?
SQL: SELECT  count(*) FROM patient INNER JOIN examination ON patient.id = examination.id WHERE patient.sex = 'F' AND strftime('%Y', examination.`examination date`) = '1997' AND examination.thrombosis = 1
Database: thrombosis_prediction
Note: age gap refers to SUBTraCT(MAX(year(birthday)) - MIN(year(birthday))); normal triglyceride refers to tg >= 200;
Question: What is the age gap between the youngest and oldest patient with a normal triglyceride recorded?
SQL: SELECT strftime('%Y', max(patient.birthday)) - strftime('%Y', min(patient.birthday)) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.tg >= 200
Database: thrombosis_prediction
Note: The larger the birthday value, the younger the person is, and vice versa; symptoms observed refers to the symptoms is not NULL;
Question: What are the symptoms observed by the youngest patient to ever did a medical examination? Identify their diagnosis.
SQL: SELECT examination.symptoms, patient.diagnosis FROM patient INNER JOIN examination ON patient.id = examination.id WHERE examination.symptoms IS NOT NULL ORDER BY patient.birthday DESC LIMIT 1
Database: thrombosis_prediction
Note: 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);
Question: For the year that concluded on December 31, 1998, how many male patients on average were tested in the lab each month?
SQL: SELECT cast(count(patient.id) AS REAL) / 12 FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE strftime('%Y', laboratory.date) = '1998' AND patient.sex = 'M'
Database: thrombosis_prediction
Note: 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);
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?
SQL: SELECT laboratory.date, strftime('%Y', patient.`first date`) - strftime('%Y', patient.birthday),patient.birthday FROM laboratory INNER JOIN patient ON laboratory.id = patient.id WHERE patient.diagnosis = 'SJS' AND patient.birthday IS NOT NULL ORDER BY patient.birthday ASC LIMIT 1
Database: thrombosis_prediction
Note: 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'));
Question: What is the ratio of male to female patients among all those with abnormal uric acid counts?
SQL: SELECT cast(sum(CASE WHEN laboratory.ua <= 8.0 AND patient.sex = 'M' THEN 1 ELSE 0 END) AS REAL) / sum(CASE WHEN laboratory.ua <= 6.5 AND patient.sex = 'F' THEN 1 ELSE 0 END) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id
Database: thrombosis_prediction
Note: hadn't undergone a medical examination until at least a year refers to SUBTraCT(year(`examination date`), year(`first date`)) >= 1;
Question: How many patients hadn't undergone a medical examination until at least a year following their initial hospital visit?
SQL: SELECT count(DISTINCT patient.id) FROM patient INNER JOIN examination ON patient.id = examination.id WHERE patient.admission = '+' AND strftime('%Y', examination.`examination date`) - strftime('%Y', patient.`first date`) >= 1
Database: thrombosis_prediction
Note: underage patients refers to year(birthday) < 18; three-year period from 1990 to 1993 refers to year(`examination date`) between '1990' and '1993';
Question: How many underage patients were examined during the course of the three-year period from 1990 to 1993?
SQL: SELECT count(patient.id) FROM patient INNER JOIN examination ON patient.id = examination.id WHERE strftime('%Y', examination.`examination date`) BETWEEN '1990' AND '1993' AND strftime('%Y', examination.`examination date`) - strftime('%Y', patient.birthday) < 18
Database: thrombosis_prediction
Note: male refers to sex = 'M'; elevated means above the normal range; total bilirubin above the normal range refers to `t-bil` >= '2.0';
Question: How many male patients have elevated total bilirubin count?
SQL: SELECT count(DISTINCT patient.id) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.`t-bil` >= 2.0 AND patient.sex = 'M'
Database: thrombosis_prediction
Note: 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 ';
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?
SQL: SELECT patient.diagnosis FROM examination INNER JOIN patient ON examination.id = patient.id WHERE examination.`examination date` BETWEEN '1985-01-01' AND '1995-12-31' GROUP BY patient.diagnosis ORDER BY count(patient.diagnosis) DESC LIMIT 1
Database: thrombosis_prediction
Note: 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';
Question: What is the average age of patients as of year 1999 examined in the laboratory for the October of the year 1991?
SQL: SELECT avg('1999'  - strftime('%Y', patient.birthday)) FROM laboratory INNER JOIN patient ON laboratory.id = patient.id WHERE laboratory.date BETWEEN '1991-10-01' AND '1991-10-30'
Database: thrombosis_prediction
Note: How old the patient refers to SUBTraCT(year(`examination date`), year(birthday)); the highest hemoglobin count refers to MAX(hgb);
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?
SQL: SELECT strftime('%Y', laboratory.date) - strftime('%Y', patient.birthday), patient.diagnosis FROM patient INNER JOIN laboratory ON patient.id = laboratory.id ORDER BY laboratory.hgb DESC LIMIT 1
Database: thrombosis_prediction
Note: anti-nucleus antibody refers to ana; 1996/12/2 refers to `examination date` = '1996-12-02';
Question: What was the anti-nucleus antibody concentration level for the patient id 3605340 on 1996/12/2?
SQL: SELECT ana FROM examination WHERE id = 3605340 AND `examination date` = '1996-12-02'
Database: thrombosis_prediction
Note: total cholesterol normal level refers to N < 250;
Question: Was the total cholesterol status for the patient id 2927464 on 1995-9-4 at the normal level?
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
Note: gender means sex; 'AORTITIS' refers to diagnosis;
Question: What was the gender of the first AORTITIS diagnosed patient?
SQL: SELECT sex FROM patient WHERE diagnosis = 'AORTITIS' AND `first date` IS NOT NULL ORDER BY `first date` ASC LIMIT 1
Database: thrombosis_prediction
Note: 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';
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?
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
Note: 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';
Question: Was the patient a man or a women whose ALT glutamic pylvic transaminase status got 9 on 1992-6-12?
SQL: SELECT patient.sex FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.gpt = 9.0 AND laboratory.date = '1992-06-12'
Database: thrombosis_prediction
Note: how old at that time refers to SUBTraCT(year(test date), year(birthday)); uric acid level as 8.4 refers to ua = '8.4'; 1991/10/21 refers to date = '1991-10-21';
Question: For the patient who got the laboratory test of uric acid level as 8.4 on 1991-10-21, how old was he/she at that time?
SQL: SELECT strftime('%Y', laboratory.date) - strftime('%Y', patient.birthday) FROM patient INNER JOIN laboratory ON patient.id = laboratory.id WHERE laboratory.ua = 8.4 AND laboratory.date = '1991-10-21'