1sf/bird-sql-train-with-schema huggingface dataset:
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: How many athletes over the age of 59 competed in the 2016 Summer Olympics?
Evidence: over the age of 59 refers to age > 59; the 2016 Summer Olympics refer to games_name = '2016 Summer';
SQL: 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 = '2016 Summer' AND T2.age > 59
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: Among the Olympic games held in Los Angeles, what is the name of the Olympic game that has the most number of competitors?
Evidence: Los Angeles refers to city_name = 'Lost Angeles'; the Olympic game refers to games_name; the most number of competitors refers to MAX(COUNT(games_name));
SQL: 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 = 'Los Angeles' GROUP BY T1.id ORDER BY COUNT(T2.person_id) DESC LIMIT 1
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: How many 10-year old athletes participated in the Gymnastics Men's Parallel Bars, Teams event?
Evidence: 10-year old athletes refer to competitor_id where age = 10; Gymnastics Men's Parallel Bars, Teams refer to event_name = 'Gymnastics Men''s Parallel Bars, Teams';
SQL: SELECT 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 WHERE T3.event_name LIKE 'Gymnastics Men%s Parallel Bars, Teams' AND T2.age = 10
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: What is the average age of the athletes from the United States of America who competed in the 2016 Summer Olympics?
Evidence: AVG(age) where games_name = '2016 Summer' and region_name = 'USA';
SQL: 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 = '2016 Summer' AND T4.region_name = 'USA'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: Which region does the NOC code "COL" stand for?
Evidence: region refers to region_name; NOC code "COL" refers to noc = 'COL';
SQL: SELECT region_name FROM noc_region WHERE noc = 'COL'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: Which sport did John Aalberg participate in?
Evidence: sport refers to sport_name;
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: How many Belgian men have competed in an Olympic Games?
Evidence: Belgian men refer to gender = 'M' where region_name = 'Belgium';
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: How many athletes took part in the Olympic games held in Barcelona?
Evidence: Barcelona refers to city_name = 'Barcelona';
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: How many different football events are there?
Evidence: events refer to event_name; football refers to sport_name = 'Football';
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: What were the cities in which John Aalberg competed?
Evidence: cities refer to city_name;
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: In Barcelona, how many Olympic games were held?
Evidence: Barcelona refers to city_name = 'Barcelona';
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: How many competitors over the age of 30 participated in the 1992 Winter Olympics?
Evidence: competitors over the age of 30 refer to person_id where age > 30; the 1992 Winter Olympics refers to games_name = '1992 Winter';
SQL: 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
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: What is the name of the Olympic game with the most competitors held in Barcelona?
Evidence: Barcelona refers to city_name = 'Barcelona'; the most competitors refer to MAX(COUNT(games_name)); name of game refers to games_name;
SQL: 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
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: List the name of competitors from Argentina.
Evidence: name refers to full_name; Argentina refers to region_name = 'Argentina';
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: What is the average age of Argentina's athletes who participated in the Summer Olympics in 2012?
Evidence: AVG(age) where games_name = '2012 Summer' and region_name = 'Argentina';
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: Calculate the percentage of bronze medals won by men's basketball players.
Evidence: DIVIDE(COUNT(competitor_id where medal_name = 'Bronze'), COUNT(competitor_id)) as percentage where event_name = 'Basketball Men''s Basketball';
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: List the name of the games that Georgios Abaris participated.
Evidence: name of games refers to games_name;
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: Provide the name of competitors from Greece.
Evidence: name refers to full_name; Greece refers to region_name = 'Greece';
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: Calculate the average age of the competitors who participated in the 1924 Winter.
Evidence: AVG(age) where games_name = '1924 Winter';
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: What is the NOC code of the region of the competitors weighted 77 kg?
Evidence: NOC code refers to noc; competitors weighted 77 kg refer to person_id where weight = 77;
SQL: 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
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: List the names of the games held in Paris.
Evidence: Paris refers to city_name = 'Paris'; names of games refers to games_name;
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: Provide the competitors' names who joined the 2000 Summer.
Evidence: the competitors' names refer to full_name; the 2000 Summer refers to games_name = '2000 Summer';
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: In which city was the game held where the oldest competitor participated?
Evidence: in which city refers to city_name; the oldest refers to MAX(age);
SQL: 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
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: What is the name of the youngest competitor?
Evidence: name refers to full_name; the youngest refers to MIN(age);
SQL: 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
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: List down the games ID of games held in Tokyo.
Evidence: Tokyo refers to city_name = 'Tokyo';
SQL: 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'
Database: olympics
Tables: city, games, games_city, medal, noc_region, person, games_competitor, person_region, sport, event, competitor_event
Columns (table index, column name): -1, *, 0, id, 0, city_name, 1, id, 1, games_year, 1, games_name, 1, season, 2, games_id, 2, city_id, 3, id, 3, medal_name, 4, id, 4, noc, 4, region_name, 5, id, 5, full_name, 5, gender, 5, height, 5, weight, 6, id, 6, games_id, 6, person_id, 6, age, 7, person_id, 7, region_id, 8, id, 8, sport_name, 9, id, 9, sport_id, 9, event_name, 10, event_id, 10, competitor_id, 10, medal_id
Question: Give the NOC code and region name of the heaviest competitor.
Evidence: NOC code refers to noc; the heaviest refers to MAX(weight);
SQL: 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