db_id
stringclasses
69 values
question
stringlengths
24
325
evidence
stringlengths
0
673
SQL
stringlengths
23
804
question_id
int64
0
9.43k
difficulty
stringclasses
1 value
olympics
State the name of sport id 19.
name of sport refers to sport_name
SELECT sport_name FROM sport WHERE id = 19
5,000
olympics
Give the id of the event "Shooting Mixed Skeet".
"Shooting Mixed Skeet" refers to event_name = 'Shooting Mixed Skeet';
SELECT id FROM event WHERE event_name = 'Shooting Mixed Skeet'
5,001
olympics
Provide hockey's sport id.
hockey's sport refers to sport_name = 'hockey';
SELECT id FROM sport WHERE sport_name = 'Hockey'
5,002
olympics
Tell the weight of Dagfinn Sverre Aarskog.
SELECT weight FROM person WHERE full_name = 'Dagfinn Sverre Aarskog'
5,003
olympics
What is the id of Rio de Janeiro?
Rio de Janeiro refers to city_name = 'Rio de Janeiro';
SELECT id FROM city WHERE city_name = 'Rio de Janeiro'
5,004
olympics
How many people have won the gold medal of the event "Rowing Women's Coxed Eights"?
won the gold medal refers to medal_name = 'Gold'; event "Rowing Women's Coxed Eights" refers to event_name = 'Rowing Women''s Coxed Eights';
SELECT COUNT(T1.competitor_id) FROM competitor_event AS T1 INNER JOIN event AS T2 ON T1.event_id = T2.id INNER JOIN medal AS T3 ON T1.medal_id = T3.id WHERE T2.event_name LIKE 'Rowing Women%s Coxed Eights' AND T3.medal_name = 'Gold'
5,005
olympics
How many kinds of events belong to the sport of cycling?
kinds of events refer to event_name; sport of cycling refers to sport_name = 'Cycling';
SELECT COUNT(T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Cycling'
5,006
olympics
What is Vijay Singh Chauhan's region name?
SELECT T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Vijay Singh Chauhan'
5,007
olympics
When did Roma host the Olympic Games?
Roma refers to city_name = 'Roma'; When host refers to games_year;
SELECT T3.games_year FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Roma'
5,008
olympics
How many 20 years old athletes were there in the 1984 Summer Olympic Games?
20 years old athletes refer to person_id where age = 20; 1984 Summer Olympic Games refer to games_name = '1984 Summer';
SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '1984 Summer' AND T2.age = 20
5,009
olympics
How many games has Prithipal Singh participated in?
games refer to games_id;
SELECT COUNT(T2.games_id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T1.full_name = 'Prithipal Singh'
5,010
olympics
State the number of athletes in the 1984 Summer Olympic Games who were more than 50 years old.
the 1984 Summer Olympic Games refer to games_name = '1984 Summer'; athletes more than 50 years old refer to person_id where age > 50;
SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '1984 Summer' AND T2.age > 50
5,011
olympics
How many kinds of events does athletics have?
kinds of events refer to event_name; athletics refer to sport_name = 'Athletics';
SELECT COUNT(T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Athletics'
5,012
olympics
Who is the heaviest athlete from Russia?
the heaviest athlete refers to full_name where MAX(weight); from Russia refers to region_name = 'Russia';
SELECT T3.full_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Russia' ORDER BY T3.weight DESC LIMIT 1
5,013
olympics
Give the height of the tallest athlete from Portugal.
the tallest athlete refers to id where MAX(height); from Portugal refers to region_name = 'Portugal';
SELECT T3.height FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Portugal' ORDER BY T3.height DESC LIMIT 1
5,014
olympics
Tell the host city of the 1968 Winter Olympic Games.
host city refers to city_name; the 1968 Winter Olympic Games refer to games_name = '1968 Winter';
SELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name = '1968 Winter'
5,015
olympics
Which region has the most athletes?
region refers to region_name; the most athletes refer to MAX(COUNT(region_name));
SELECT T2.region_name FROM person_region AS T1 INNER JOIN noc_region AS T2 ON T1.region_id = T2.id GROUP BY T2.region_name ORDER BY COUNT(T1.person_id) DESC LIMIT 1
5,016
olympics
What is the percentage of athletes from Vanuatu who are taller than 175?
DIVIDE(COUNT(id where height > 175), COUNT(id)) as percentage where region_name = 'Vanuatu';
SELECT CAST(COUNT(CASE WHEN T3.height > 175 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Vanuatu'
5,017
olympics
Calculate the average weight of male athletes from Tonga.
AVG(weight) where region_name = 'Tonga' and gender = 'M';
SELECT AVG(T3.weight) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Tonga' AND T3.gender = 'M'
5,018
olympics
Where was the 1920 Summer held?
where it was held refers to city_name; the 1920 Summer refers to games_name = '1920 Summer';
SELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name = '1920 Summer'
5,019
olympics
From 1900 to 1992, how many games did London host?
From 1900 to 1992 refers to games_year BETWEEN 1900 AND 1992; London refers to city_name = 'London'; games refer to games_name;
SELECT COUNT(T3.id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'London' AND T3.games_year BETWEEN 1900 AND 1992
5,020
olympics
How many Summer games are there that were held in Paris?
Summer games refer to games_id where season = 'Summer'; Paris refers to city_name = 'Paris';
SELECT COUNT(T3.id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Paris' AND T3.season = 'Summer'
5,021
olympics
Please list all game names that were held in Los Angeles.
Los Angeles refers to city_name = 'Los Angeles';
SELECT T3.games_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Los Angeles'
5,022
olympics
Which city hosted the most games?
Which city refers to city_name; the most games refer to MAX(COUNT(city_name));
SELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id GROUP BY T2.city_name ORDER BY COUNT(T2.city_name) DESC LIMIT 1
5,023
olympics
What is the game name that was held in Beijing in 2008?
Beijing refers to city_name = 'Beijing'; in 2008 refers to games_year = '2008';
SELECT T3.games_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Beijing' AND T3.games_year = 2008
5,024
olympics
What is the percentage of champions at the age of over 30?
DIVIDE(COUNT(competitor_id where age > 30), COUNT(competitor_id))as percentage where medal_id = 1;
SELECT CAST(COUNT(CASE WHEN T2.age > 30 THEN 1 END) AS REAL) * 100 / COUNT(T2.person_id) FROM competitor_event AS T1 INNER JOIN games_competitor AS T2 ON T1.competitor_id = T2.id WHERE T1.medal_id = 1
5,025
olympics
At which age did A Lamusi participate in 2012 Summer?
2012 Summer refers to games_name = '2012 Summer';
SELECT T2.age FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '2012 Summer' AND T3.full_name = 'A Lamusi'
5,026
olympics
How many competitors were there who participated in 2000 Summer with age 31?
in 2000 Summer refers to games_name = '2000 Summer'; age = 31
SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '2000 Summer' AND T2.age = 31
5,027
olympics
How many male competitors were there who participated in 1948 Summer?
male competitors refers to id where gender = 'M'; in 1948 Summer refers to games_name = '1948 Summer';
SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '1948 Summer' AND T3.gender = 'M'
5,028
olympics
Please list all competitors' names who participated in 1936 Summer.
competitors' names refer to full_name; in 1936 Summer refers to games_name = '1936 Summer';
SELECT T3.full_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '1936 Summer'
5,029
olympics
Who is the youngest competitor that participated in 2014 Winter?
the youngest competitor refers to full_name where MIN(age); in 2014 Winter refers to games_name = '2014 Winter';
SELECT T3.full_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '2014 Winter' ORDER BY T2.age LIMIT 1
5,030
olympics
What is the average age of competitors who participated in 1988 Winter?
AVG(age) where games_name = '1988 Winter';
SELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '1988 Winter'
5,031
olympics
What is the percentage of female competitors whose heights are over 170 that participated in the game in 1988?
DIVIDE(COUNT(person_id where gender = 'F' and height > 170), COUNT(person_id)) as percentage where games_year = 1988;
SELECT CAST(COUNT(CASE WHEN T3.gender = 'F' AND T3.height > 170 THEN 1 END) AS REAL) * 100 / COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_year = 1988
5,032
olympics
What is the sport name of "Cross Country Skiing Men's 10/15 kilometres Pursuit" event?
"Cross Country Skiing Men's 10/15 kilometres Pursuit" refers to event_name = 'Cross Country Skiing Men''s 10/15 kilometres Pursuit';
SELECT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T2.event_name LIKE 'Cross Country Skiing Men%s 10/15 kilometres Pursuit'
5,033
olympics
What is the percentage of people whose age greater than 24 and participate in winter season?
DIVIDE(COUNT(season = 'Winter' and age > 24), COUNT(person_id)) as percentage;
SELECT CAST(COUNT(CASE WHEN T2.age > 24 AND T1.season = 'Winter' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.games_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id
5,034
olympics
What is the region id of Christine Jacoba Aaftink?
SELECT T1.region_id FROM person_region AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.id WHERE T2.full_name = 'Christine Jacoba Aaftink'
5,035
olympics
Mention the height of people who belong to region id 7.
SELECT T2.height FROM person_region AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.id WHERE T1.region_id = 7
5,036
olympics
State the name of the city that held game id 3.
name of city refers to city_name
SELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T1.games_id = 3
5,037
olympics
What are the id of the games held in London?
London refers to city_name = 'London';
SELECT T1.games_id FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'London'
5,038
olympics
How many people who are below 30 and participated in the summer season?
people who are below 30 refer to person_id where age < 30; the summer season refers to season = 'Summer';
SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Summer' AND T2.age < 30
5,039
olympics
List out the name of the game that the people participated in games id 13.
name of games refers to games_name;
SELECT DISTINCT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T2.games_id = 13
5,040
olympics
What is the average age of the people who participated in the winter season?
AVG(age) where season = 'Winter';
SELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Winter'
5,041
olympics
What is the percentage of the people who are under 35 and participated in the summer season?
DIVIDE(COUNT(age < 35) / COUNT(person_id)) as percentage where season = 'Summer';
SELECT CAST(COUNT(CASE WHEN T2.age < 35 THEN 1 END) AS REAL) * 100 / COUNT(T2.games_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Summer'
5,042
olympics
State the event name of Basketball.
basketball refers to sport_name = 'Basketball';
SELECT T2.event_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Basketball'
5,043
olympics
What is the name of medal that competitor id 9 obtained?
name of medal refers to medal_name;
SELECT DISTINCT T1.medal_name FROM medal AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.medal_id WHERE T2.competitor_id = 9
5,044
olympics
List out the id of event that achieve the gold medal.
the gold medal refers to medal_name = 'Gold';
SELECT T2.event_id FROM medal AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.medal_id WHERE T1.medal_name = 'Gold'
5,045
olympics
Who is the heaviest athlete?
Who refers to full_name; the heaviest refers to MAX(weight);
SELECT full_name FROM person ORDER BY weight DESC LIMIT 1
5,046
olympics
Which city were the Olympic games held in 1992?
city refers to city_name; in 1992 refers to games_year = 1992;
SELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_year = 1992
5,047
olympics
Which region is the majority of the athletes from?
region refers to region_name; the majority of the athletes from refer to MAX(COUNT(region_name));
SELECT T2.region_name FROM person_region AS T1 INNER JOIN noc_region AS T2 ON T1.region_id = T2.id GROUP BY T2.region_name ORDER BY COUNT(T1.person_id) DESC LIMIT 1
5,048
olympics
What is the name of the oldest competitor?
name refers to full_name; the oldest refers to MAX(age);
SELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T2.age DESC LIMIT 1
5,049
olympics
Which sport did John Aalberg participate in?
sport refers to sport_name;
SELECT DISTINCT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id INNER JOIN competitor_event AS T3 ON T2.id = T3.event_id INNER JOIN games_competitor AS T4 ON T3.competitor_id = T4.id INNER JOIN person AS T5 ON T4.person_id = T5.id WHERE T5.full_name = 'John Aalberg'
5,050
olympics
How many Belgian men have competed in an Olympic Games?
Belgian men refer to gender = 'M' where region_name = 'Belgium';
SELECT COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Belgium' AND T3.gender = 'M'
5,051
olympics
How many athletes took part in the Olympic games held in Barcelona?
Barcelona refers to city_name = 'Barcelona';
SELECT COUNT(T1.person_id) FROM games_competitor AS T1 INNER JOIN games_city AS T2 ON T1.games_id = T2.games_id INNER JOIN city AS T3 ON T2.city_id = T3.id WHERE T3.city_name = 'Barcelona'
5,052
olympics
How many different football events are there?
events refer to event_name; football refers to sport_name = 'Football';
SELECT COUNT(T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Football'
5,053
olympics
What were the cities in which John Aalberg competed?
cities refer to city_name;
SELECT T4.city_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T1.full_name = 'John Aalberg'
5,054
olympics
In Barcelona, how many Olympic games were held?
Barcelona refers to city_name = 'Barcelona';
SELECT COUNT(T1.games_id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'Barcelona'
5,055
olympics
How many competitors over the age of 30 participated in the 1992 Winter Olympics?
competitors over the age of 30 refer to person_id where age > 30; the 1992 Winter Olympics refers to games_name = '1992 Winter';
SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '1992 Winter' AND T2.age > 30
5,056
olympics
What is the name of the Olympic game with the most competitors held in Barcelona?
Barcelona refers to city_name = 'Barcelona'; the most competitors refer to MAX(COUNT(games_name)); name of game refers to games_name;
SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T4.city_name = 'Barcelona' GROUP BY T1.id ORDER BY COUNT(T2.person_id) DESC LIMIT 1
5,057
olympics
List the name of competitors from Argentina.
name refers to full_name; Argentina refers to region_name = 'Argentina';
SELECT T3.full_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Argentina'
5,058
olympics
What is the average age of Argentina's athletes who participated in the Summer Olympics in 2012?
AVG(age) where games_name = '2012 Summer' and region_name = 'Argentina';
SELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person_region AS T3 ON T2.person_id = T3.person_id INNER JOIN noc_region AS T4 ON T3.region_id = T4.id WHERE T1.games_name = '2012 Summer' AND T4.region_name = 'Argentina'
5,059
olympics
Calculate the percentage of bronze medals won by men's basketball players.
DIVIDE(COUNT(competitor_id where medal_name = 'Bronze'), COUNT(competitor_id)) as percentage where event_name = 'Basketball Men''s Basketball';
SELECT CAST(COUNT(CASE WHEN T4.medal_name = 'Bronze' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.person_id) FROM competitor_event AS T1 INNER JOIN games_competitor AS T2 ON T1.competitor_id = T2.id INNER JOIN event AS T3 ON T1.event_id = T3.id INNER JOIN medal AS T4 ON T1.medal_id = T4.id WHERE T3.event_name LIKE 'Basketball Men%s Basketball'
5,060
olympics
List the name of the games that Georgios Abaris participated.
name of games refers to games_name;
SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Georgios Abaris'
5,061
olympics
Provide the name of competitors from Greece.
name refers to full_name; Greece refers to region_name = 'Greece';
SELECT T3.full_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Greece'
5,062
olympics
Calculate the average age of the competitors who participated in the 1924 Winter.
AVG(age) where games_name = '1924 Winter';
SELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '1924 Winter'
5,063
olympics
What is the NOC code of the region of the competitors weighted 77 kg?
NOC code refers to noc; competitors weighted 77 kg refer to person_id where weight = 77;
SELECT T1.noc FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.weight = 77
5,064
olympics
List the names of the games held in Paris.
Paris refers to city_name = 'Paris'; names of games refers to games_name;
SELECT T3.games_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Paris'
5,065
olympics
Provide the competitors' names who joined the 2000 Summer.
the competitors' names refer to full_name; the 2000 Summer refers to games_name = '2000 Summer';
SELECT T3.full_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '2000 Summer'
5,066
olympics
In which city was the game held where the oldest competitor participated?
in which city refers to city_name; the oldest refers to MAX(age);
SELECT T4.city_name FROM games_competitor AS T1 INNER JOIN games AS T2 ON T1.games_id = T2.id INNER JOIN games_city AS T3 ON T1.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id ORDER BY T1.age DESC LIMIT 1
5,067
olympics
What is the name of the youngest competitor?
name refers to full_name; the youngest refers to MIN(age);
SELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T2.age LIMIT 1
5,068
olympics
List down the games ID of games held in Tokyo.
Tokyo refers to city_name = 'Tokyo';
SELECT T1.games_id FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'Tokyo'
5,069
olympics
Give the NOC code and region name of the heaviest competitor.
NOC code refers to noc; the heaviest refers to MAX(weight);
SELECT T1.noc, T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id ORDER BY T3.weight DESC LIMIT 1
5,070
olympics
In what year and season did Sohail Abbas compete?
year refers to games_year;
SELECT T1.games_year, T1.season FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Sohail Abbas'
5,071
olympics
What is the average weight of the competitors who won a silver medal?
AVG(weight) where medal_name = 'Silver';
SELECT AVG(T1.weight) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T4.medal_name = 'Silver'
5,072
olympics
In which city the 2004 Summer was held?
in which city refers to city_name; the 2004 Summer refers to games_name = '2004 Summer';
SELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name = '2004 Summer'
5,073
olympics
What is the season of the game where a competitor who weighted 73 kg and 180 cm tall, participated?
competitor who weighted 73 kg and 180 cm tall refers to person_id where height = 180 and weight = 73;
SELECT DISTINCT T1.season FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.height = 180 AND T3.weight = 73
5,074
olympics
Provide the names of competitors who received a gold medal.
names of competitors refer to full_name; gold medal refers to medal_name = 'Gold';
SELECT DISTINCT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T4.medal_name = 'Gold'
5,075
olympics
Compute the average height of competitors whose age ranges from 22 to 28.
AVG(height) where age BETWEEN 22 AND 28;
SELECT AVG(T1.height) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T2.age BETWEEN 22 AND 28
5,076
olympics
How many female competitors were from Iran?
female competitors refer to person_id where gender = 'F'; from Iran refers to region_name = 'Iran';
SELECT COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Iran' AND T3.gender = 'F'
5,077
olympics
Provide the age of the tallest competitor.
the tallest refers to MAX(height);
SELECT T2.age FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T1.height DESC LIMIT 1
5,078
olympics
Among the competitors with age ranges 24 and below, calculate the difference between the number of competitors who weighed greater than 70 kg and competitors who weighted less than 70 kg.
SUBTRACT(COUNT(weight > 70), COUNT(weight < 70)) where age < 24;
SELECT COUNT(CASE WHEN T1.weight > 70 THEN 1 ELSE NULL END) - COUNT(CASE WHEN T1.weight < 70 THEN 1 ELSE NULL END) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T2.age < 24
5,079
olympics
In the 2014 Winter game, what is the percentage of competitors who age 28 years old?
DIVIDE(COUNT(age = 28), COUNT(id)) as percentage where games_name = '2014 Winter';
SELECT CAST(COUNT(CASE WHEN T2.age = 28 THEN 1 END) AS REAL) * 100 / COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '2014 Winter'
5,080
olympics
Among the males, list the region name of people with height greater than 87% of the average height of all people listed.
males refer to gender = 'M'; height greater than 87% of the average height refers to height > MULTIPLY(AVG(height), 0.87);
SELECT DISTINCT T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.gender = 'M' AND T3.height * 100 > ( SELECT AVG(height) FROM person WHERE gender = 'M' ) * 87
5,081
address
What is the total number of households in Arecibo county?
"ARECIBO" is the county; total number of households refer to sum(households)
SELECT SUM(T1.households) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO'
5,082
address
Which residential area in Arecibo county has the highest average house value? Please give its zip_code.
"ARECIBO" is the county; highest average house value refers to Max(avg_house_value)
SELECT T1.zip_code FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO' ORDER BY T1.avg_house_value DESC LIMIT 1
5,083
address
Please list the numbers of males in all the residential areas in Arecibo county.
"ARECIBO" is the county; number of males refers to Sum(male_population)
SELECT SUM(T1.male_population) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO'
5,084
address
Among all the residential areas in Delaware, how many of them implement daylight saving?
"Delaware" is a county; implement daylight savings refers to daylight_saving = 'Yes'
SELECT COUNT(T1.zip_code) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'DELAWARE' AND T1.daylight_savings = 'Yes'
5,085
address
Among all the residential areas in Arecibo county, what is the zip_code of the one with the highest white population?
"ARECIBO" is the county; highest white population refers to Max(white_population)
SELECT T1.zip_code FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO' ORDER BY T1.white_population DESC LIMIT 1
5,086
address
In which county is the residential area with the highest average income per household located?
highest average income per household refers to Max(avg_income_per_household)
SELECT T2.county FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO' GROUP BY T2.county ORDER BY T1.avg_income_per_household DESC LIMIT 1
5,087
address
Please list the names of all the counties with at least one residential area that implements daylight saving.
implements daylight savings refers to daylight_savings = 'Yes'
SELECT DISTINCT T2.county FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T1.daylight_savings = 'Yes'
5,088
address
Please list the zip_codes of all the residential areas in Huntingdon county with over 30 employees.
over 30 employees refers to employee > 30; 'HUNTINGDON' is the county
SELECT DISTINCT T1.zip_code FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'HUNTINGDON' AND T1.employees > 30
5,089
address
Please list the Asian populations of all the residential areas with the bad alias "URB San Joaquin".
"URB San Joaquin" is the bad_alias
SELECT SUM(T1.asian_population) FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T2.bad_alias = 'URB San Joaquin'
5,090
address
Among the residential areas with the bad alias "Internal Revenue Service", how many of them are in the Eastern time zone?
"Internal Revenue Service" is the bad_alias; in Eastern time zone refers to time_zone = 'Eastern'
SELECT COUNT(T1.zip_code) FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T2.bad_alias = 'Internal Revenue Service' AND T1.time_zone = 'Eastern'
5,091
address
What is the bad alias of the residential area with the highest average house value?
highest average house value refers to Max(avg_house_value)
SELECT T2.bad_alias FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T1.avg_house_value = ( SELECT MAX(avg_house_value) FROM zip_data ) LIMIT 1
5,092
address
Please list the bad alias of all the residential areas with a median female age of over 32.
median female age of over 32 refers to median_female_age > 32
SELECT DISTINCT T2.bad_alias FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T1.female_median_age > 32
5,093
address
What is the highest gender ratio of the residential areas in Arecibo county?
"ARECIBO" is the county; highest gender ration refers to Max(Divide (male_population, female_population))
SELECT CAST(T1.male_population AS REAL) / T1.female_population FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO' AND T1.female_population <> 0 ORDER BY 1 DESC LIMIT 1
5,094
address
What is the average median female age of all the residential areas in the Arecibo county?
"ARECIBO" is the county; average median female age = Divide (Sum(median_female_age), Count(country))
SELECT SUM(T1.female_median_age) / COUNT(T1.zip_code) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO'
5,095
address
What is the area code of the city with the female median age over 32 years old?
SELECT T1.area_code FROM area_code AS T1 INNER JOIN ZIP_Data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.female_median_age > 32 GROUP BY T1.area_code
5,096
address
What is the alias of the city called Hartford?
"Hartford" is the city
SELECT DISTINCT T2.alias FROM zip_data AS T1 INNER JOIN alias AS T2 ON T1.zip_code = T2.zip_code WHERE T1.city = 'Hartford'
5,097
address
How many counties are there in Alabama?
"Alabama" is the name
SELECT COUNT(T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Alabama'
5,098
address
How many post offices are there in New York?
"New York" refers to state = 'NY' and name = 'New York'; 'Post Office' is the type
SELECT COUNT(DISTINCT T2.zip_code) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.abbreviation = 'NY' AND T2.type = 'Post Office'
5,099