question
stringlengths 23
286
| db_id
stringclasses 11
values | evidence
stringlengths 0
468
| SQL
stringlengths 35
1.58k
| difficulty
stringclasses 3
values | question_id
int64 5
1.53k
|
---|---|---|---|---|---|
Was the patient with the number 57266's uric acid within a normal range? | thrombosis_prediction | uric acid within a normal range refers to UA > 8.0 and SEX = 'M'OR UA > 6.5 and SEX = 'F' | SELECT
CASE
WHEN (
`T1`.`SEX` = 'F' AND `T2`.`UA` > 6.5
)
OR (
`T1`.`SEX` = 'M' AND `T2`.`UA` > 8.0
)
THEN TRUE
ELSE FALSE
END
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID`
WHERE
`T1`.`ID` = 57266 | moderate | 1,205 |
Provide IDs for male patients with ALT glutamic pylvic transaminase (GPT) that have history of ALT glutamic pylvic transaminase (GPT) exceed the normal range. | thrombosis_prediction | male refers to SEX = 'M'; ALT glutamic pylvic transaminase (GPT) exceed the normal range refers to GPT > = 60 | SELECT DISTINCT
`T1`.`ID`
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID`
WHERE
`T1`.`SEX` = 'M' AND `T2`.`GPT` >= 60 | moderate | 1,208 |
Please provide the diagnosis of patients with ALT glutamic pylvic transaminase beyond the normal range by ascending order of their date of birth. | thrombosis_prediction | 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; | SELECT `T1`.`Diagnosis`
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID`
WHERE
`T2`.`GPT` > 60
ORDER BY
`T1`.`Birthday` ASC | moderate | 1,209 |
Provide all ID, sex and birthday of patients whose urea nitrogen (UN) just within the borderline of passing? | thrombosis_prediction | urea nitrogen (UN) just within the borderline of passing refers to UN = 29; | 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 | simple | 1,220 |
List and group all patients by sex for total bilirubin (T-BIL) level not within the normal range. | thrombosis_prediction | total bilirubin (T-BIL) not within normal range refers to T-BIL > = 2.0 | 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 | moderate | 1,225 |
What is the average age of the male patient with high cholesterol? | thrombosis_prediction | average age = DIVIDE(SUM(SUBTRACT(YEAR(NOW()), YEAR(birthday))), COUNT(ID)); male patient refers to sex = 'M'; high cholesterol refers to `T-CHO` > = 250; | SELECT AVG(YEAR(CURRENT_DATE) - YEAR(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' | moderate | 1,227 |
For all patients with triglyceride (TG) level beyond the normal range, how many are age more than 50 years? | thrombosis_prediction | 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; | SELECT
COUNT(DISTINCT `T1`.`ID`)
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID`
WHERE
`T2`.`TG` >= 200
AND DATE_FORMAT(CAST(CURRENT_TIMESTAMP() AS DATETIME), '%Y') - DATE_FORMAT(CAST(`T1`.`Birthday` AS DATETIME), '%Y') > 50 | moderate | 1,229 |
For patient born between 1936-1956, how many male patients have creatinine phosphokinase beyond the normal range? | thrombosis_prediction | 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; | SELECT
COUNT(DISTINCT `T1`.`ID`)
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID`
WHERE
DATE_FORMAT(CAST(`T1`.`Birthday` AS DATETIME), '%Y') BETWEEN '1936' AND '1956'
AND `T1`.`SEX` = 'M'
AND `T2`.`CPK` >= 250 | challenging | 1,231 |
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. | thrombosis_prediction | 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; | SELECT DISTINCT
`T1`.`ID`,
`T1`.`SEX`,
DATE_FORMAT(CAST(CURRENT_TIMESTAMP() AS DATETIME), '%Y') - DATE_FORMAT(CAST(`T1`.`Birthday` AS DATETIME), '%Y')
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID`
WHERE
`T2`.`GLU` >= 180 AND `T2`.`T-CHO` < 250 | challenging | 1,232 |
What are the patient's diagnosis for those who has lower red blood blood cell? State their ID and age. | thrombosis_prediction | patient's diagnosis refers to Diagnosis; lower red blood cell refers to RBC < 3.5; age = SUBTRACT(year(current_timestamp), year(Birthday)); | SELECT DISTINCT
`T1`.`Diagnosis`,
`T1`.`ID`,
DATE_FORMAT(CAST(CURRENT_TIMESTAMP() AS DATETIME), '%Y') - DATE_FORMAT(CAST(`T1`.`Birthday` AS DATETIME), '%Y')
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID`
WHERE
`T2`.`RBC` < 3.5 | moderate | 1,235 |
Among the patients who were diagnosed with SLE, who is the oldest with normal hemoglobin level. Provide the ID and sex. | thrombosis_prediction | 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; | 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 | moderate | 1,238 |
Name the ID and age of patient with two or more laboratory examinations which show their hematoclit level exceeded the normal range. | thrombosis_prediction | 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; | SELECT DISTINCT
`T1`.`ID`,
DATE_FORMAT(CAST(CURRENT_TIMESTAMP() AS DATETIME), '%Y') - DATE_FORMAT(CAST(`T1`.`Birthday` AS DATETIME), '%Y')
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
) | challenging | 1,239 |
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? | thrombosis_prediction | 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; | SELECT
SUM(CASE WHEN `T2`.`PLT` <= 100 THEN 1 ELSE 0 END) - SUM(CASE WHEN `T2`.`PLT` >= 400 THEN 1 ELSE 0 END)
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID` | challenging | 1,241 |
For laboratory examinations take in 1984, list all patients below 50 years old with normal platelet level. | thrombosis_prediction | 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; | 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 DATE_FORMAT(CAST(`T2`.`Date` AS DATETIME), '%Y') - DATE_FORMAT(CAST(`T1`.`Birthday` AS DATETIME), '%Y') < 50
AND DATE_FORMAT(CAST(`T2`.`Date` AS DATETIME), '%Y') = '1984' | challenging | 1,242 |
For all patients who are older than 55 years old, what is the percentage of female who has abnormal prothrombin time (PT)? | thrombosis_prediction | 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'; | SELECT
CAST(SUM(CASE WHEN `T2`.`PT` >= 14 AND `T1`.`SEX` = 'F' THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(CASE WHEN `T2`.`PT` >= 14 THEN 1 ELSE 0 END)
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID`
WHERE
DATE_FORMAT(CAST(CURRENT_TIMESTAMP() AS DATETIME), '%Y') - DATE_FORMAT(CAST(`T1`.`Birthday` AS DATETIME), '%Y') > 55 | challenging | 1,243 |
Among the male patients who have a normal level of white blood cells, how many of them have an abnormal fibrinogen level? | thrombosis_prediction | 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. | SELECT
COUNT(DISTINCT `T1`.`ID`)
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID`
WHERE
`T2`.`FG` <= 150
OR `T2`.`FG` >= 450
AND `T2`.`WBC` > 3.5
AND `T2`.`WBC` < 9.0
AND `T1`.`SEX` = 'M' | challenging | 1,247 |
How many patients with an Ig G higher than normal? | thrombosis_prediction | Ig G higher than normal refers to IGG >= 2000; Should consider DISTINCT in the final result; | 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 | simple | 1,251 |
Among the patients with a normal Ig G level, how many of them have symptoms? | thrombosis_prediction | normal Ig G level refers to IGG > 900 and IGG < 2000; have symptoms refers to Symptoms IS NOT NULL; | 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 NOT `T3`.`Symptoms` IS NULL | moderate | 1,252 |
How many patients with a normal Ig A level came to the hospital after 1990/1/1? | thrombosis_prediction | 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; | SELECT
COUNT(`T1`.`ID`)
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID`
WHERE
`T2`.`IGA` BETWEEN 80 AND 500
AND DATE_FORMAT(CAST(`T1`.`First Date` AS DATETIME), '%Y') > '1990' | moderate | 1,254 |
For the patients with an abnormal Ig M level, what is the most common disease they are diagnosed with? | thrombosis_prediction | abnormal Ig M level refers to IGM <=40 OR IGM >= 400; most common disease refers to MAX(COUNT(Diagnosis)); | SELECT
`T1`.`Diagnosis`
FROM `Patient` AS `T1`
INNER JOIN `Laboratory` AS `T2`
ON `T1`.`ID` = `T2`.`ID`
WHERE
NOT `T2`.`IGM` BETWEEN 40 AND 400
GROUP BY
`T1`.`Diagnosis`
ORDER BY
COUNT(`T1`.`Diagnosis`) DESC
LIMIT 1 | moderate | 1,255 |
How many patients with a abnormal C-reactive protein don't have their data recorded? | thrombosis_prediction | abnormal C-reactive protein refers to CRP ='+'; don't have data recorded refers to Description IS NULL; | SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.CRP = '+' ) AND T1.Description IS NULL; | moderate | 1,256 |
Among the patients whose creatinine level is abnormal, how many of them aren't 70 yet? | thrombosis_prediction | creatinine level is abnormal refers to CRE >= 1.5; aren't 70 yet refers to SUBTRACT((YEAR(CURDATE()), YEAR(Birthday))) < 70; | 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 YEAR(CURDATE()) - YEAR(T1.Birthday) < 70 | challenging | 1,257 |
How many patients have a normal level of anti-ribonuclear protein and have been admitted to the hospital? | thrombosis_prediction | 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; | 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` = '+' | moderate | 1,265 |
Among the patients with normal anti-SM, how many of them does not have thrombosis? | thrombosis_prediction | normal anti-SM refers to SM IN('-', '+-'); SM = 'negative' means '-'; SM = '0' means '+-'; SM = '1' means '+'; does not have thrombosis refers to Thrombosis = 0; | 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 | moderate | 1,267 |
Among the patients who has a normal anti-scl70, how many of them are female and does not have any symptom? | thrombosis_prediction | normal anti-scl70 refers to SC170 IN('negative', '0'); female refers to Sex = 'F'; does not have any symptom refers to symptoms IS NULL; Should consider DISTINCT in the final result; | 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 | challenging | 1,270 |
Among the patients who has a normal level of anti-centromere and a normal level of anti-SSB, how many of them are male? | thrombosis_prediction | normal level of anti-centromere refers to CENTROMEA IN('-', '+-'); normal level of anti-SSB refers to SSB IN('-', '+-'); male refers to Sex = 'M'; Should consider DISTINCT in the final result; | 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' | moderate | 1,275 |
Among the patients who have an abnormal level of glutamic oxaloacetic transaminase, when was the youngest of them born? | thrombosis_prediction | abnormal level of glutamic oxaloacetic transaminase refers to GOT > = 60; The larger the birthday value, the younger the person is, and vice versa; | 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 | moderate | 1,281 |
For the patients with a normal range of creatinine phosphokinase, how many of them have a positive measure of degree of coagulation? | thrombosis_prediction | normal range of creatinine phosphokinase refers to CPK < 250; positive measure of degree of coagulation refers to KCT = '+' or RVVT = '+' or LAC = '+' ; | 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` = '+'
) | challenging | 1,302 |
Give the name of the league had the most goals in the 2016 season? | european_football_2 | league that had the most goals refers to MAX(SUM(home_team_goal, away_team_goal)); 2016 season refers to season = '2015/2016'; | SELECT `t2`.`name` FROM `Match` AS `t1` INNER JOIN `League` AS `t2`
ON `t1`.`league_id` = `t2`.`id`
WHERE
`t1`.`season` = '2015/2016'
GROUP BY
`t2`.`name`
ORDER BY
SUM(`t1`.`home_team_goal` + `t1`.`away_team_goal`) DESC
LIMIT 1 | moderate | 1,025 |
In Scotland Premier League, which away team won the most during the 2010 season? | european_football_2 | Final result should return the Team.team_long_name; Scotland Premier League refers to League.name = 'Scotland Premier League'; away team refers to away_team_api_id; away team that won the most refers to MAX(SUBTRACT(away_team_goal, home_team_goal) > 0); 2010 season refers to season = '2009/2010'; won the most refers to MAX(COUNT(*)); | SELECT
`teamInfo`.`team_long_name`
FROM `League` AS `leagueData`
INNER JOIN `Match` AS `matchData`
ON `leagueData`.`id` = `matchData`.`league_id`
INNER JOIN `Team` AS `teamInfo`
ON `matchData`.`away_team_api_id` = `teamInfo`.`team_api_id`
WHERE
`leagueData`.`name` = 'Scotland Premier League'
AND `matchData`.`season` = '2009/2010'
AND `matchData`.`away_team_goal` - `matchData`.`home_team_goal` > 0
GROUP BY
`matchData`.`away_team_api_id`
ORDER BY
COUNT(*) DESC
LIMIT 1 | challenging | 1,028 |
What are the speed in which attacks are put together of the top 4 teams with the highest build Up Play Speed? | european_football_2 | speed in which attacks are put together refers to buildUpPlaySpeed;highest build up play speed refers to MAX(buildUpPlaySpeed) | SELECT
`t1`.`buildUpPlaySpeed`
FROM `Team_Attributes` AS `t1`
INNER JOIN `Team` AS `t2`
ON `t1`.`team_api_id` = `t2`.`team_api_id`
ORDER BY
`t1`.`buildUpPlaySpeed` ASC
LIMIT 4 | moderate | 1,029 |
Give the name of the league had the most matches end as draw in the 2016 season? | european_football_2 | most matches end as draw refers to MAX(SUM(home_team_goal = away_team_goal)); 2016 season refers to season = '2015/2016'; | SELECT
`t2`.`name`
FROM `Match` AS `t1`
INNER JOIN `League` AS `t2`
ON `t1`.`league_id` = `t2`.`id`
WHERE
`t1`.`season` = '2015/2016' AND `t1`.`home_team_goal` = `t1`.`away_team_goal`
GROUP BY
`t2`.`name`
ORDER BY
COUNT(`t1`.`id`) DESC
LIMIT 1 | moderate | 1,030 |
At present, calculate for the player's age who have a sprint speed of no less than 97 between 2013 to 2015. | european_football_2 | players age at present = SUBTRACT((DATETIME(), birthday)); sprint speed of no less than 97 refers to sprint_speed > = 97; between 2013 to 2015 refers to YEAR(date) > = '2013' AND YEAR(date) < = '2015'; | SELECT DISTINCT YEAR(CURDATE()) - YEAR(t2.birthday) AS age FROM Player_Attributes AS t1 INNER JOIN Player AS t2 ON t1.player_api_id = t2.player_api_id WHERE YEAR(t1.`date`) BETWEEN 2013 AND 2015 AND t1.sprint_speed >= 97 | challenging | 1,031 |
Give the name of the league with the highest matches of all time and how many matches were played in the said league. | european_football_2 | league with highest matches of all time refers to MAX(COUNT(league_id)); | SELECT
`t2`.`name`,
COUNT(`t1`.`id`)
FROM `Match` AS `t1`
INNER JOIN `League` AS `t2`
ON `t1`.`league_id` = `t2`.`id`
GROUP BY
`t2`.`name`
ORDER BY
COUNT(`t1`.`id`) DESC
LIMIT 1 | moderate | 1,032 |
Give the team_fifa_api_id of teams with more than 50 but less than 60 build-up play speed. | european_football_2 | teams with more than 50 but less than 60 build-up play speed refers to buildUpPlaySpeed >50 AND buildUpPlaySpeed <60; | SELECT DISTINCT
`team_fifa_api_id`
FROM `Team_Attributes`
WHERE
`buildUpPlaySpeed` > 50 AND `buildUpPlaySpeed` < 60 | simple | 1,035 |
List the long name of teams with above-average build-up play passing in 2012. | european_football_2 | long name of teams refers to team_long_name; build-up play passing refers to buildUpPlayPassing; above-average build-up play passing = buildUpPlayPassing > DIVIDE(SUM(buildUpPlayPassing), COUNT(team_long_name) WHERE buildUpPlayPassing IS NOT NULL); in 2012 refers to strftime('%Y', date) = '2012'; | SELECT DISTINCT
`t4`.`team_long_name`
FROM `Team_Attributes` AS `t3`
INNER JOIN `Team` AS `t4`
ON `t3`.`team_api_id` = `t4`.`team_api_id`
WHERE
SUBSTR(`t3`.`date`, 1, 4) = '2012'
AND `t3`.`buildUpPlayPassing` > (
SELECT
CAST(SUM(`t2`.`buildUpPlayPassing`) AS DOUBLE) / COUNT(`t1`.`id`)
FROM `Team` AS `t1`
INNER JOIN `Team_Attributes` AS `t2`
ON `t1`.`team_api_id` = `t2`.`team_api_id`
WHERE
DATE_FORMAT(CAST(`t2`.`date` AS DATETIME), '%Y') = '2012'
) | challenging | 1,036 |
Calculate the percentage of players who prefer left foot, who were born between 1987 and 1992. | european_football_2 | players who prefer left foot refers to preferred_foot = 'left'; percentage of players who prefer left foot = DIVIDE(MULTIPLY((SUM(preferred_foot = 'left'), 100)), COUNT(player_fifa_api_id)); born between 1987 and 1992 refers to YEAR(birthday) BETWEEN '1987' AND '1992'; | SELECT
CAST(COUNT(CASE WHEN `t2`.`preferred_foot` = 'left' THEN `t1`.`id` ELSE NULL END) AS DOUBLE) * 100 / COUNT(`t1`.`id`) AS `percent`
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
SUBSTR(`t1`.`birthday`, 1, 4) BETWEEN '1987' AND '1992' | challenging | 1,037 |
Find the average number of long-shot done by Ahmed Samir Farag. | european_football_2 | average number of long shot = DIVIDE(SUM(long_shots), COUNT(player_fifa_api_id)); | SELECT
CAST(SUM(`t2`.`long_shots`) AS DOUBLE) / COUNT(`t2`.`date`)
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
`t1`.`player_name` = 'Ahmed Samir Farag' | simple | 1,039 |
List the top 10 players' names whose heights are above 180 in descending order of average heading accuracy. | european_football_2 | heights are above 180 refers to Player.height > 180; average heading accuracy = DIVIDE(SUM(heading_accuracy), COUNT(player_fifa_api_id)); | SELECT
`t1`.`player_name`
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
`t1`.`height` > 180
GROUP BY
`t1`.`id`
ORDER BY
CAST(SUM(`t2`.`heading_accuracy`) AS DOUBLE) / COUNT(`t2`.`player_fifa_api_id`) DESC
LIMIT 10 | moderate | 1,040 |
List the name of leagues in which the average goals by the home team is higher than the away team in the 2009/2010 season. | european_football_2 | name of league refers to League.name; average goals by the home team is higher than the away team = AVG(home_team_goal) > AVG(away_team_goal); AVG(xx_goal) = SUM(xx_goal) / COUNT(DISTINCT Match.id); 2009/2010 season refers to season = '2009/2010' | SELECT
`t1`.`name`
FROM `League` AS `t1`
INNER JOIN `Match` AS `t2`
ON `t1`.`id` = `t2`.`league_id`
WHERE
`t2`.`season` = '2009/2010'
GROUP BY
`t1`.`name`
HAVING
(
CAST(SUM(`t2`.`home_team_goal`) AS DOUBLE) / COUNT(DISTINCT `t2`.`id`)
) - (
CAST(SUM(`t2`.`away_team_goal`) AS DOUBLE) / COUNT(DISTINCT `t2`.`id`)
) > 0 | challenging | 1,042 |
List the football players with a birthyear of 1970 and a birthmonth of October. | european_football_2 | players with a birthyear of 1970 and a birthmonth of October refers to substr(birthday,1,7) AS 'year-month',WHERE year = '1970' AND month = '10'; | SELECT
`player_name`
FROM `Player`
WHERE
SUBSTR(`birthday`, 1, 7) = '1970-10' | simple | 1,044 |
What is the overall rating of the football player Gabriel Tamas in year 2011? | european_football_2 | in year 2011 refers to strftime('%Y', date) = '2011'; | SELECT `t2`.`overall_rating` FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id` WHERE `t1`.`player_name` = 'Gabriel Tamas' AND DATE_FORMAT(CAST(`t2`.`date` AS DATETIME), '%Y') = '2011' | simple | 1,048 |
Calculate the average home team goal in the 2010/2011 season in the country of Poland. | european_football_2 | average home team goal = AVG(home_team_goal)= SUM(home_team_goal) / COUNT(DISTINCT Match.id) WHERE name = 'Poland' and season = '2010/2011'; | SELECT
CAST(SUM(`t2`.`home_team_goal`) AS DOUBLE) / COUNT(`t2`.`id`)
FROM `Country` AS `t1`
INNER JOIN `Match` AS `t2`
ON `t1`.`id` = `t2`.`country_id`
WHERE
`t1`.`name` = 'Poland' AND `t2`.`season` = '2010/2011' | moderate | 1,057 |
Who has the highest average finishing rate between the highest and shortest football player? | european_football_2 | finishing rate refers to finishing; highest average finishing rate = MAX(AVG(finishing)); highest football player refers to MAX(height); shortest football player refers to MIN(height); | SELECT `A` FROM (SELECT AVG(`finishing`) AS `result`, 'Max' AS `A` FROM `Player` AS `T1` INNER JOIN `Player_Attributes` AS `T2` ON `T1`.`player_api_id` = `T2`.`player_api_id` WHERE `T1`.`height` = (SELECT MAX(`height`) FROM `Player`) UNION SELECT AVG(`finishing`) AS `result`, 'Min' AS `A` FROM `Player` AS `T1` INNER JOIN `Player_Attributes` AS `T2` ON `T1`.`player_api_id` = `T2`.`player_api_id` WHERE `T1`.`height` = (SELECT MIN(`height`) FROM `Player`)) AS `derived` ORDER BY `result` DESC LIMIT 1 | challenging | 1,058 |
From 2010 to 2015, what was the average overall rating of players who are higher than 170? | european_football_2 | from 2010 to 2015 refers to strftime('%Y', date) >= '2010' AND <= '2015'; average overall rating = SUM(t2.overall_rating)/ COUNT(t2.id); higher than 170 refers to Player.height > 170; | SELECT
CAST(SUM(`t2`.`overall_rating`) AS DOUBLE) / COUNT(`t2`.`id`)
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
`t1`.`height` > 170
AND DATE_FORMAT(CAST(`t2`.`date` AS DATETIME), '%Y') >= '2010'
AND DATE_FORMAT(CAST(`t2`.`date` AS DATETIME), '%Y') <= '2015' | moderate | 1,068 |
What is the difference of the average ball control score between Abdou Diallo and Aaron Appindangoye
? | european_football_2 | difference of the average ball control = SUBTRACT(AVG(ball_control WHERE player_name = 'Abdou Diallo'), AVG(ball_control WHERE player_name = 'Aaron Appindangoye')); AVG(ball_control WHERE player_name = 'XX XX') = SUM(CASE WHEN player_name = 'XX XX' THEN ball_control ELSE 0 END) / COUNT(CASE WHEN player_name = 'XX XX' THEN id ELSE NULL END) | SELECT
CAST(SUM(
CASE WHEN `t1`.`player_name` = 'Abdou Diallo' THEN `t2`.`ball_control` ELSE 0 END
) AS DOUBLE) / COUNT(CASE WHEN `t1`.`player_name` = 'Abdou Diallo' THEN `t2`.`id` ELSE NULL END) - CAST(SUM(
CASE
WHEN `t1`.`player_name` = 'Aaron Appindangoye'
THEN `t2`.`ball_control`
ELSE 0
END
) AS DOUBLE) / COUNT(CASE WHEN `t1`.`player_name` = 'Aaron Appindangoye' THEN `t2`.`id` ELSE NULL END)
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id` | challenging | 1,076 |
Which player is older, Aaron Lennon or Abdelaziz Barrada? | european_football_2 | The larger the birthday value, the younger the person is, and vice versa; | SELECT
`player_name`
FROM `Player`
WHERE
`player_name` IN ('Aaron Lennon', 'Abdelaziz Barrada')
ORDER BY
`birthday` ASC
LIMIT 1 | simple | 1,078 |
Which player is the tallest? | european_football_2 | tallest player refers to MAX(height); | SELECT
`player_name`
FROM `Player`
ORDER BY
`height` DESC
LIMIT 1 | simple | 1,079 |
Among the players whose preferred foot was the left foot when attacking, how many of them would remain in his position when the team attacked? | european_football_2 | preferred foot when attacking was the left refers to preferred_foot = 'left'; players who would remain in his position when the team attacked refers to attacking_work_rate = 'low'; | SELECT
COUNT(`player_api_id`)
FROM `Player_Attributes`
WHERE
`preferred_foot` = 'left' AND `attacking_work_rate` = 'low' | moderate | 1,080 |
Among the players born before the year 1986, how many of them would remain in his position and defense while the team attacked? | european_football_2 | players born before the year 1986 refers to strftime('%Y', birthday)<'1986'; players who would remain in his position and defense while the team attacked refers to defensive_work_rate = 'high'; Should consider DISTINCT in the final result; | SELECT
COUNT(DISTINCT `t1`.`player_name`)
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
DATE_FORMAT(CAST(`t1`.`birthday` AS DATETIME), '%Y') < '1986'
AND `t2`.`defensive_work_rate` = 'high' | challenging | 1,084 |
Please list the names of the players whose volley score and dribbling score are over 70. | european_football_2 | volley score are over 70 refers to volleys > 70; dribbling score refers to dribbling are over 70 refers to dribbling > 70; | SELECT DISTINCT
`t1`.`player_name`
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
`t2`.`volleys` > 70 AND `t2`.`dribbling` > 70 | moderate | 1,088 |
How many matches were held in the Belgium Jupiler League in April, 2009? | european_football_2 | Belgium Jupiler League refers to League.name = 'Belgium Jupiler League'; in April, 2009 refers to SUBSTR(`date`, 1, 7); | SELECT
COUNT(`t2`.`id`)
FROM `League` AS `t1`
INNER JOIN `Match` AS `t2`
ON `t1`.`id` = `t2`.`league_id`
WHERE
`t1`.`name` = 'Belgium Jupiler League' AND SUBSTR(`t2`.`date`, 1, 7) = '2009-04' | moderate | 1,091 |
Give the name of the league had the most matches in the 2008/2009 season? | european_football_2 | league that had the most matches in the 2008/2009 season refers to MAX(league_name WHERE season = '2008/2009'); | SELECT `t1`.`name` FROM `League` AS `t1`JOIN `Match` AS `t2` ON `t1`.`id` = `t2`.`league_id` WHERE `t2`.`season` = '2008/2009' GROUP BY `t1`.`name` HAVING COUNT(`t2`.`id`) = (SELECT MAX(match_count) FROM (SELECT COUNT(`t2`.`id`) AS match_count FROM `Match` AS `t2` WHERE `t2`.`season` = '2008/2009' GROUP BY `t2`.`league_id`) AS subquery) | simple | 1,092 |
How much higher in percentage is Ariel Borysiuk's overall rating than that of Paulin Puel? | european_football_2 | how much higher in percentage = MULTIPLY(DIVIDE(SUBTRACT(overall_rating WHERE player_name = 'Ariel Borysiuk', overall_rating WHERE player_name = 'Paulin Puel'), overall_rating WHERE player_name = 'Paulin Puel'), 100); | SELECT
(
SUM(
CASE
WHEN `t1`.`player_name` = 'Ariel Borysiuk'
THEN `t2`.`overall_rating`
ELSE 0
END
) * 1.0 - SUM(
CASE WHEN `t1`.`player_name` = 'Paulin Puel' THEN `t2`.`overall_rating` ELSE 0 END
)
) * 100 / SUM(
CASE WHEN `t1`.`player_name` = 'Paulin Puel' THEN `t2`.`overall_rating` ELSE 0 END
)
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id` | challenging | 1,094 |
Calculate the average overall rating of Pietro Marino. | european_football_2 | Pietro Marino refers to player_name = 'Pietro Marino'; average overall rating AVG(T1.overall_rating) | SELECT
CAST(SUM(`t2`.`overall_rating`) AS DOUBLE) / COUNT(`t2`.`id`)
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
`t1`.`player_name` = 'Pietro Marino' | moderate | 1,096 |
What is Ajax's highest chance creation passing score and what is it classified as? | european_football_2 | Ajax's refers to team_long_name = 'Ajax'; chance creation passing score refers to MAX(chanceCreationPassing); classified refer to chanceCreationPassingClass | SELECT
`t2`.`chanceCreationPassing`,
`t2`.`chanceCreationPassingClass`
FROM `Team` AS `t1`
INNER JOIN `Team_Attributes` AS `t2`
ON `t1`.`team_api_id` = `t2`.`team_api_id`
WHERE
`t1`.`team_long_name` = 'Ajax'
ORDER BY
`t2`.`chanceCreationPassing` DESC
LIMIT 1 | moderate | 1,098 |
For the players who had a 77 points overall rating on 2016/6/23, who was the oldest? Give the name of the player. | european_football_2 | 77 points overall rating refers to overall_rating = 77; on 2016/6/23 refers to date LIKE '2016-06-23%'; The larger the birthday value, the younger the person is, and vice versa; | SELECT
`t1`.`player_name`
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
SUBSTR(`t2`.`date`, 1, 10) = '2016-06-23' AND `t2`.`overall_rating` = 77
ORDER BY
`t1`.`birthday` ASC
LIMIT 1 | moderate | 1,102 |
What was the overall rating for Aaron Mooy on 2016/2/4? | european_football_2 | Aaron Mooy refers to player_name = 'Aaron Mooy'; on 2016/2/4 refers to date LIKE '2016-02-04%'; | SELECT
`t2`.`overall_rating`
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
SUBSTR(`t2`.`date`, 1, 10) = '2016-02-04' AND `t1`.`player_name` = 'Aaron Mooy' | moderate | 1,103 |
How was Francesco Migliore's attacking work rate on 2015/5/1? | european_football_2 | Francesco Migliore refers to player_name = 'Francesco Migliore'; on 2015/5/1 refers to date LIKE '2015-05-01%'; | SELECT
`t2`.`attacking_work_rate`
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
`t2`.`date` LIKE '2015-05-01%' AND `t1`.`player_name` = 'Francesco Migliore' | moderate | 1,105 |
When was the first time did Kevin Constant have his highest crossing score? Give the date. | european_football_2 | Kevin Constant refers to player_name = 'Kevin Constant'; highest crossing score refers to MAX(crossing) | SELECT `date` FROM (SELECT `t2`.`crossing`, `t2`.`date` FROM `Player` AS `t1` INNER JOIN `Player_Attributes` AS `t2` ON `t1`.`player_fifa_api_id` = `t2`.`player_fifa_api_id` WHERE `t1`.`player_name` = 'Kevin Constant' ORDER BY `t2`.`crossing` DESC) AS `subquery` ORDER BY `date` DESC LIMIT 1 | moderate | 1,107 |
Tell the build Up play passing class for "FC Lorient" on 2010/2/22. | european_football_2 | "FC Lorient" refers to team_long_name = 'FC Lorient'; on 2010/2/22 refers to date LIKE '2010-02-22%'; | SELECT
`t2`.`buildUpPlayPassingClass`
FROM `Team` AS `t1`
INNER JOIN `Team_Attributes` AS `t2`
ON `t1`.`team_api_id` = `t2`.`team_api_id`
WHERE
`t1`.`team_long_name` = 'FC Lorient' AND `t2`.`date` LIKE '2010-02-22%' | moderate | 1,110 |
For the team "Hannover 96", what was its defence aggression class on 2015/9/10? | european_football_2 | "Hannover 96" refers to team_long_name = 'Hannover 96'; on 2015/9/10 refers to date LIKE '2015-09-10%'; | SELECT
`t2`.`defenceAggressionClass`
FROM `Team` AS `t1`
INNER JOIN `Team_Attributes` AS `t2`
ON `t1`.`team_api_id` = `t2`.`team_api_id`
WHERE
`t1`.`team_long_name` = 'Hannover 96' AND `t2`.`date` LIKE '2015-09-10%' | moderate | 1,113 |
What was the average overall rating for Marko Arnautovic from 2007/2/22 to 2016/4/21? | european_football_2 | average overall rating refers to avg(overall_rating); Marko Arnautovic refers to player_name = 'Marko Arnautovic'; from 2007/2/22 to 2016/4/21 refers to the first 10 characters of date BETWEEN '2007-02-22' and '2016-04-21' | SELECT
CAST(SUM(`t2`.`overall_rating`) AS DOUBLE) / COUNT(`t2`.`id`)
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_fifa_api_id` = `t2`.`player_fifa_api_id`
WHERE
`t1`.`player_name` = 'Marko Arnautovic'
AND SUBSTR(`t2`.`date`, 1, 10) BETWEEN '2007-02-22' AND '2016-04-21' | challenging | 1,114 |
What percentage is Landon Donovan's overall rating higher than Jordan Bowery on 2013/7/12? | european_football_2 | Landon Donovan's refers to player_name = 'Landon Donovan'; Jordan Bowery refers to player_name = 'Jordan Bowery'; percentage refers to DIVIDE(SUBTRACT(player_name = 'Landon Donovan' overall_rating; player_name = 'Jordan Bowery' overall_rating), player_name = 'Landon Donovan' overall_rating)*100 | SELECT
(
SUM(
CASE
WHEN `t1`.`player_name` = 'Landon Donovan'
THEN `t2`.`overall_rating`
ELSE 0
END
) * 1.0 - SUM(
CASE WHEN `t1`.`player_name` = 'Jordan Bowery' THEN `t2`.`overall_rating` ELSE 0 END
)
) * 100 / SUM(
CASE
WHEN `t1`.`player_name` = 'Landon Donovan'
THEN `t2`.`overall_rating`
ELSE 0
END
) AS `LvsJ_percent`
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_fifa_api_id` = `t2`.`player_fifa_api_id`
WHERE
SUBSTR(`t2`.`date`, 1, 10) = '2013-07-12' | challenging | 1,115 |
List down most tallest players' name. | european_football_2 | tallest refers to rank based on the height in descending order; Most tallest players refers to rank = 1 | SELECT player_name FROM (SELECT player_name, height, DENSE_RANK() OVER (ORDER BY height DESC) as `rank`FROM Player) AS ranked_players WHERE `rank` = 1 | simple | 1,116 |
State the name of the most strongest player. | european_football_2 | strongest players refers to player has MAX(overall_rating) | SELECT DISTINCT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.overall_rating = (SELECT MAX(overall_rating) FROM Player_Attributes) | simple | 1,122 |
Who are the players that tend to be attacking when their mates were doing attack moves? List down their name. | european_football_2 | tend to be attacking when their mates were doing attack moves refers to attacking_work_rate = 'high'; | SELECT DISTINCT
`t1`.`player_name`
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
`t2`.`attacking_work_rate` = 'high' | moderate | 1,124 |
What are the short name of team who played safe while creating chance of passing? | european_football_2 | played safe while creating chance of passing refers to chanceCreationPassingClass = 'Safe'; short name of team refers to team_short_name | SELECT DISTINCT
`t1`.`team_short_name`
FROM `Team` AS `t1`
INNER JOIN `Team_Attributes` AS `t2`
ON `t1`.`team_api_id` = `t2`.`team_api_id`
WHERE
`t2`.`chanceCreationPassingClass` = 'Safe' | moderate | 1,130 |
How many football players born after the 1990s have the first name "Aaron"? | european_football_2 | first name "Aaron" refers to player_name LIKE 'Aaron%'; born after the 1990s refers to birthday > '1990' | SELECT
COUNT(`id`)
FROM `Player`
WHERE
`birthday` > '1990' AND `player_name` LIKE 'Aaron%' | simple | 1,133 |
What is the difference between players 6 and 23's jumping scores? | european_football_2 | difference between players 6 and 23's jumping scores refers to SUBTRACT(jumping AND id = 6,jumping AND id = 23) | SELECT
SUM(CASE WHEN `t1`.`id` = 6 THEN `t1`.`jumping` ELSE 0 END) - SUM(CASE WHEN `t1`.`id` = 23 THEN `t1`.`jumping` ELSE 0 END)
FROM `Player_Attributes` AS `t1` | simple | 1,134 |
Please provide top four football players' IDs who are among the lowest potential players and prefer to use the right foot when attacking. | european_football_2 | lowest potential players refers to MIN(potential); prefer to use the right foot when attacking refers to preferred_foot = 'right' | SELECT
`id`
FROM `Player_Attributes`
WHERE
`preferred_foot` = 'right'
ORDER BY
`potential` ASC
LIMIT 4 | moderate | 1,135 |
How many players had the highest potential score for crossing that preferred to use their left foots while attacking? | european_football_2 | highest potential score for crossing refers to MAX(crossing); preferred to use their left foots while attacking refers to preferred_foot = 'left' | SELECT
COUNT(`t1`.`id`)
FROM `Player_Attributes` AS `t1`
WHERE
`t1`.`preferred_foot` = 'left'
AND `t1`.`crossing` = (
SELECT
MAX(`crossing`)
FROM `Player_Attributes`
) | moderate | 1,136 |
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? | european_football_2 | 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 | SELECT
`t2`.`home_team_goal`,
`t2`.`away_team_goal`
FROM `League` AS `t1`
INNER JOIN `Match` AS `t2`
ON `t1`.`id` = `t2`.`league_id`
WHERE
`t1`.`name` = 'Belgium Jupiler League' AND `t2`.`date` LIKE '2008-09-24%' | challenging | 1,139 |
Does the KSV Cercle Brugge team have a slow, balanced or fast speed class? | european_football_2 | KSV Cercle Brugge refers to team_long_name = 'KSV Cercle Brugge'; speed class refers to buildUpPlaySpeedClass | SELECT DISTINCT
`t1`.`buildUpPlaySpeedClass`
FROM `Team_Attributes` AS `t1`
INNER JOIN `Team` AS `t2`
ON `t1`.`team_api_id` = `t2`.`team_api_id`
WHERE
`t2`.`team_long_name` = 'KSV Cercle Brugge' | moderate | 1,141 |
Please state the finishing rate and curve score of the player who has the heaviest weight. | european_football_2 | finishing rate refer to finishing; curve score refer to curve; heaviest weight refers to MAX(weight) | 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 | simple | 1,144 |
Which top 4 leagues had the most games in the 2015-2016 season? | european_football_2 | in the 2015-2016 season refers to season = '2015/2016'; league with most games refers to League.name where MAX(COUNT(id)); | SELECT
`t1`.`name`
FROM `League` AS `t1`
INNER JOIN `Match` AS `t2`
ON `t1`.`id` = `t2`.`league_id`
WHERE
`t2`.`season` = '2015/2016'
GROUP BY
`t1`.`name`
ORDER BY
COUNT(`t2`.`id`) DESC
LIMIT 4 | simple | 1,145 |
Please provide the full name of the away team that scored the most goals. | european_football_2 | 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) | SELECT
`t2`.`team_long_name`
FROM `Match` AS `t1`
INNER JOIN `Team` AS `t2`
ON `t1`.`away_team_api_id` = `t2`.`team_api_id`
ORDER BY
`t1`.`away_team_goal` DESC
LIMIT 1 | moderate | 1,146 |
Please name one player whose overall strength is the greatest. | european_football_2 | overall strength is the greatest refers to MAX(overall_rating) | SELECT DISTINCT
`t1`.`player_name`
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id`
WHERE
`t2`.`overall_rating` = (
SELECT
MAX(`overall_rating`)
FROM `Player_Attributes`
) | simple | 1,147 |
What is the percentage of players that are under 180 cm who have an overall strength of more than 70? | european_football_2 | percentage refers to DIVIDE(COUNT(height < 180 AND overall_rating > 70),COUNT(id)) * 100 | SELECT
CAST(COUNT(CASE WHEN `t2`.`overall_rating` > 70 AND `t1`.`height` < 180 THEN `t1`.`id` ELSE NULL END) AS DOUBLE) * 100 / COUNT(`t1`.`id`) AS `percent`
FROM `Player` AS `t1`
INNER JOIN `Player_Attributes` AS `t2`
ON `t1`.`player_api_id` = `t2`.`player_api_id` | moderate | 1,148 |
Please list the reference names of the drivers who are eliminated in the first period in race number 20. | formula_1 | driver reference name refers to driverRef; first qualifying period refers to q1; drivers who are eliminated in the first qualifying period refers to 5 drivers with MAX(q1); race number refers to raceId; | SELECT
`T2`.`driverRef`
FROM `qualifying` AS `T1`
INNER JOIN `drivers` AS `T2`
ON `T2`.`driverId` = `T1`.`driverId`
WHERE
`T1`.`raceId` = 20
ORDER BY
`T1`.`q1` DESC
LIMIT 5 | moderate | 846 |
What is the surname of the driver with the best lap time in race number 19 in the second qualifying period? | formula_1 | race number refers to raceId; second qualifying period refers to q2; best lap time refers to MIN(q2); | SELECT
`T2`.`surname`
FROM `qualifying` AS `T1`
INNER JOIN `drivers` AS `T2`
ON `T2`.`driverId` = `T1`.`driverId`
WHERE
`T1`.`raceId` = 19
ORDER BY
`T1`.`q2` ASC
LIMIT 1 | simple | 847 |
Please give the name of the race held on the circuits in Germany. | formula_1 | Germany is a name of country; | SELECT DISTINCT
`T2`.`name`
FROM `circuits` AS `T1`
INNER JOIN `races` AS `T2`
ON `T2`.`circuitID` = `T1`.`circuitId`
WHERE
`T1`.`country` = 'Germany' | simple | 850 |
What is the coordinates location of the circuits for Australian grand prix? | formula_1 | coordinate position/location refers to lat, lng; circuits for Australian grand prix refers to races.name = 'Australian Grand Prix' | SELECT DISTINCT
`T1`.`lat`,
`T1`.`lng`
FROM `circuits` AS `T1`
INNER JOIN `races` AS `T2`
ON `T2`.`circuitID` = `T1`.`circuitId`
WHERE
`T2`.`name` = 'Australian Grand Prix' | simple | 854 |
Give the coordinate position for Abu Dhabi Grand Prix. | formula_1 | coordinate position/location refers to lat, lng; Abu Dhabi Grand Prix refers to races.name = 'Abu Dhabi Grand Prix' | SELECT DISTINCT
`T1`.`lat`,
`T1`.`lng`
FROM `circuits` AS `T1`
INNER JOIN `races` AS `T2`
ON `T2`.`circuitID` = `T1`.`circuitId`
WHERE
`T2`.`name` = 'Abu Dhabi Grand Prix' | simple | 857 |
What's Bruno Senna's Q1 result in the qualifying race No. 354? | formula_1 | race number refers to raceId; Bruno Senna refers to the full name of the driver; Full name of the driver refers to drivers.forename and drivers.surname; | SELECT
`T1`.`q1`
FROM `qualifying` AS `T1`
INNER JOIN `drivers` AS `T2`
ON `T2`.`driverId` = `T1`.`driverId`
WHERE
`T1`.`raceId` = 354 AND `T2`.`forename` = 'Bruno' AND `T2`.`surname` = 'Senna' | simple | 859 |
What is his number of the driver who finished 0:01:54 in the Q3 of qualifying race No.903? | formula_1 | race number refers to raceId; finished 0:0M:SS in the Q3 refers to q3 LIKE 'M:SS%' | SELECT
`T2`.`number`
FROM `qualifying` AS `T1`
INNER JOIN `drivers` AS `T2`
ON `T2`.`driverId` = `T1`.`driverId`
WHERE
`T1`.`raceId` = 903 AND `T1`.`q3` LIKE '1:54%' | simple | 861 |
For the Bahrain Grand Prix in 2007, how many drivers not finished the game? | formula_1 | Bahrain Grand Prix refers to races.name = 'Bahrain Grand Prix'; drivers who finished the race refers to time is not empty (i.e. time IS NOT NULL); | SELECT
COUNT(`T3`.`driverId`)
FROM `races` AS `T1`
INNER JOIN `results` AS `T2`
ON `T2`.`raceId` = `T1`.`raceId`
INNER JOIN `drivers` AS `T3`
ON `T3`.`driverId` = `T2`.`driverId`
WHERE
`T1`.`year` = 2007 AND `T1`.`name` = 'Bahrain Grand Prix' AND `T2`.`time` IS NULL | simple | 862 |
For all the drivers who finished the game in race No. 592, who is the oldest? | formula_1 | drivers who finished the race refers to time is not empty (i.e. time IS NOT NULL); race number refers to raceId; date of birth refers to drivers.dob; The larger the birthday value, the younger the person is, and vice versa; | SELECT
`T1`.`forename`,
`T1`.`surname`
FROM `drivers` AS `T1`
INNER JOIN `results` AS `T2`
ON `T2`.`driverId` = `T1`.`driverId`
WHERE
`T2`.`raceId` = 592 AND NOT `T2`.`time` IS NULL AND NOT `T1`.`dob` IS NULL
ORDER BY
`T1`.`dob` ASC
LIMIT 1 | moderate | 865 |
Who was the player that got the lap time of 0:01:27 in the race No. 161? Show his introduction website. | formula_1 | player and driver are synonyms; the lap time of 0:0M:SS refers to lapTime.time LIKE 'M:SS%';race number refers to raceId; introduction website of the drivers refers to url; | SELECT DISTINCT
`T2`.`forename`,
`T2`.`surname`,
`T2`.`url`
FROM `lapTimes` AS `T1`
INNER JOIN `drivers` AS `T2`
ON `T2`.`driverId` = `T1`.`driverId`
WHERE
`T1`.`raceId` = 161 AND `T1`.`time` LIKE '1:27%' | moderate | 866 |
Where is Malaysian Grand Prix held? Give the location coordinates. | formula_1 | location coordinates refers to (lat, lng); Malaysian Grand Prix refers to races.name = 'Malaysian Grand Prix' | SELECT DISTINCT
`T1`.`lat`,
`T1`.`lng`
FROM `circuits` AS `T1`
INNER JOIN `races` AS `T2`
ON `T2`.`circuitID` = `T1`.`circuitId`
WHERE
`T2`.`name` = 'Malaysian Grand Prix' | simple | 868 |
For the constructor which got the highest point in the race No. 9 , what is its introduction website? | formula_1 | race number refers to raceId; constructor which got the highest point refers to MAX(constructorResults.points); introduction website of the constructor refers to url; | SELECT
`T2`.`url`
FROM `constructorResults` AS `T1`
INNER JOIN `constructors` AS `T2`
ON `T2`.`constructorId` = `T1`.`constructorId`
WHERE
`T1`.`raceId` = 9
ORDER BY
`T1`.`points` DESC
LIMIT 1 | moderate | 869 |
In the race No. 45, for the driver who had the Q3 time as 0:01:33, what is his abbreviated code? | formula_1 | race number refers to raceId; had the Q3 time as 0:0M:SS refers to q3 LIKE 'M:SS%' | SELECT
`T2`.`code`
FROM `qualifying` AS `T1`
INNER JOIN `drivers` AS `T2`
ON `T2`.`driverId` = `T1`.`driverId`
WHERE
`T1`.`raceId` = 45 AND `T1`.`q3` LIKE '1:33%' | simple | 872 |
Show me the season page of year when the race No. 901 took place. | formula_1 | the season page refers to url; race number refers to raceId; | SELECT
`T2`.`url`
FROM `races` AS `T1`
INNER JOIN `seasons` AS `T2`
ON `T2`.`year` = `T1`.`year`
WHERE
`T1`.`raceId` = 901 | simple | 875 |
For all the drivers who finished the game in race No. 872, who is the youngest? | formula_1 | race number refers to raceId; drivers who finished the race refers to time has value; the youngest is a driver where MAX(dob); | SELECT
`T1`.`forename`,
`T1`.`surname`
FROM `drivers` AS `T1`
INNER JOIN `results` AS `T2`
ON `T2`.`driverId` = `T1`.`driverId`
WHERE
`T2`.`raceId` = 872 AND NOT `T2`.`time` IS NULL
ORDER BY
`T1`.`dob` DESC
LIMIT 1 | moderate | 877 |
For the driver who set the fastest lap speed, what is his nationality? | formula_1 | the fastest lap speed refers to (MAX) fastestLapSpeed; | SELECT
`T1`.`nationality`
FROM `drivers` AS `T1`
INNER JOIN `results` AS `T2`
ON `T2`.`driverId` = `T1`.`driverId`
ORDER BY
`T2`.`fastestLapSpeed` DESC
LIMIT 1 | moderate | 879 |
Paul di Resta was in the No. 853 race, what percent faster did he finish in the 853rd race than the next race for the fastest lap speed? | formula_1 | Paul di Resta refers to the full name of the driver; Full name of the driver refers to drivers.forename ='Paul' and drivers.surname = 'di Resta'; race number refers to raceId; percentage = DIVIDE(SUBTRACT(fastestLapSpeed(raceId = 853), (fastestLapSpeed (raceId = 854)) * 100 , (fastestLapSpeed(raceId = 853)) | SELECT
(
SUM(CASE WHEN `T2`.`raceId` = 853 THEN `T2`.`fastestLapSpeed` ELSE 0 END) - SUM(CASE WHEN `T2`.`raceId` = 854 THEN `T2`.`fastestLapSpeed` ELSE 0 END)
) * 100 / SUM(CASE WHEN `T2`.`raceId` = 853 THEN `T2`.`fastestLapSpeed` ELSE 0 END)
FROM `drivers` AS `T1`
INNER JOIN `results` AS `T2`
ON `T2`.`driverId` = `T1`.`driverId`
WHERE
`T1`.`forename` = 'Paul' AND `T1`.`surname` = 'di Resta' | challenging | 880 |
For the drivers who took part in the race in 1983/7/16, what's their race completion rate? | formula_1 | DIVIDE(COUNT(driverid when time has value ), (COUNT(driverid )) as percentage; in 1983/7/16 refers to when date = '1983-07-16' | SELECT
CAST(COUNT(CASE WHEN NOT `T2`.`time` IS NULL THEN `T2`.`driverId` END) AS DOUBLE) * 100 / COUNT(`T2`.`driverId`)
FROM `races` AS `T1`
INNER JOIN `results` AS `T2`
ON `T2`.`raceId` = `T1`.`raceId`
WHERE
`T1`.`date` = '1983-07-16' | moderate | 881 |
List the names of all races that occurred in the earliest recorded year and month. | formula_1 | earliest recorded year and month refers to year = year(min(date)) and month = month(min(date)); | SELECT
`name`
FROM `races`
WHERE
DATE_FORMAT(CAST(`date` AS DATETIME), '%Y') = (
SELECT
DATE_FORMAT(CAST(`date` AS DATETIME), '%Y')
FROM `races`
ORDER BY
`date` ASC
LIMIT 1
)
AND DATE_FORMAT(CAST(`date` AS DATETIME), '%m') = (
SELECT
DATE_FORMAT(CAST(`date` AS DATETIME), '%m')
FROM `races`
ORDER BY
`date` ASC
LIMIT 1
) | moderate | 884 |
State the driver with the most points scored. Find his full name with that points. | formula_1 | the most points scored refers to max(points); Full name of the driver refers to drivers.forename and drivers.surname; | SELECT
`T3`.`forename`,
`T3`.`surname`,
`T2`.`points`
FROM `races` AS `T1`
INNER JOIN `driverStandings` AS `T2`
ON `T2`.`raceId` = `T1`.`raceId`
INNER JOIN `drivers` AS `T3`
ON `T3`.`driverId` = `T2`.`driverId`
ORDER BY
`T2`.`points` DESC
LIMIT 1 | moderate | 892 |
What is the best lap time recorded? List the driver and race with such recorded lap time. | formula_1 | the best lap time refers to min(milliseconds); List the driver refers to drivers.forename and drivers.surname; List the race refers to races.name | SELECT
`T2`.`milliseconds`,
`T1`.`forename`,
`T1`.`surname`,
`T3`.`name`
FROM `drivers` AS `T1`
INNER JOIN `lapTimes` AS `T2`
ON `T1`.`driverId` = `T2`.`driverId`
INNER JOIN `races` AS `T3`
ON `T2`.`raceId` = `T3`.`raceId`
ORDER BY
`T2`.`milliseconds` ASC
LIMIT 1 | moderate | 894 |