problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: At what age did Michael Fred Phelps, II join the Olympics?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT T2.age FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T1.full_name = 'Michael Fred Phelps, II' ORDER BY T2.age LIMIT 1
Write SQL query to solve given problem: How many athletes are there in the region where Clara Hughes is from?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT COUNT(person_id) FROM person_region WHERE region_id = ( SELECT T1.region_id FROM person_region AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.id WHERE T2.full_name = 'Clara Hughes' )
Write SQL query to solve given problem: How many Men's 200 Metres Freestyle events did Ian James Thorpe compete in?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT COUNT(T1.id) 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 event AS T4 ON T3.event_id = T4.id WHERE T1.full_name = 'Ian James Thorpe' AND T4.event_name LIKE 'Swimming Men%s 200 metres Freestyle'
Write SQL query to solve given problem: How many times was Larysa Semenivna Latynina (Diriy-) declared as champion in Gymnastics Women's Individual All-Around?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT COUNT(T1.id) FROM event AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.event_id INNER JOIN games_competitor AS T3 ON T2.competitor_id = T3.id INNER JOIN person AS T4 ON T3.person_id = T4.id WHERE T4.full_name = 'Larysa Semenivna Latynina (Diriy-)' AND T1.event_name LIKE 'Gymnastics Women%s Individual All-Around' AND T2.medal_id = 1
Write SQL query to solve given problem: What are the names of the cities where Carl Lewis Borack competed?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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 = 'Carl Lewis Borack'
Write SQL query to solve given problem: How many Olympic games were held in London?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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 = 'London'
Write SQL query to solve given problem: Which city was the 1992 Summer Olympic held?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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 = '1992 Summer'
Write SQL query to solve given problem: How many athletes over the age of 59 competed in the 2016 Summer Olympics?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: Among the Olympic games held in Los Angeles, what is the name of the Olympic game that has the most number of competitors?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: How many 10-year old athletes participated in the Gymnastics Men's Parallel Bars, Teams event?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the average age of the athletes from the United States of America who competed in the 2016 Summer Olympics?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Which region does the NOC code "COL" stand for?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT region_name FROM noc_region WHERE noc = 'COL'
Write SQL query to solve given problem: State the name of sport id 19.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT sport_name FROM sport WHERE id = 19
Write SQL query to solve given problem: Give the id of the event "Shooting Mixed Skeet".. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT id FROM event WHERE event_name = 'Shooting Mixed Skeet'
Write SQL query to solve given problem: Provide hockey's sport id.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT id FROM sport WHERE sport_name = 'Hockey'
Write SQL query to solve given problem: Tell the weight of Dagfinn Sverre Aarskog.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT weight FROM person WHERE full_name = 'Dagfinn Sverre Aarskog'
Write SQL query to solve given problem: What is the id of Rio de Janeiro?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT id FROM city WHERE city_name = 'Rio de Janeiro'
Write SQL query to solve given problem: How many people have won the gold medal of the event "Rowing Women's Coxed Eights"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: How many kinds of events belong to the sport of cycling?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: What is Vijay Singh Chauhan's region name?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: When did Roma host the Olympic Games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: How many 20 years old athletes were there in the 1984 Summer Olympic Games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: How many games has Prithipal Singh participated in?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: State the number of athletes in the 1984 Summer Olympic Games who were more than 50 years old.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: How many kinds of events does athletics have?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Who is the heaviest athlete from Russia?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: Give the height of the tallest athlete from Portugal.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: Tell the host city of the 1968 Winter Olympic Games.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Which region has the most athletes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the percentage of athletes from Vanuatu who are taller than 175?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Calculate the average weight of male athletes from Tonga.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Where was the 1920 Summer held?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: From 1900 to 1992, how many games did London host?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: How many Summer games are there that were held in Paris?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Please list all game names that were held in Los Angeles.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Which city hosted the most games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the game name that was held in Beijing in 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the percentage of champions at the age of over 30?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: At which age did A Lamusi participate in 2012 Summer?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: How many competitors were there who participated in 2000 Summer with age 31?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: How many male competitors were there who participated in 1948 Summer?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Please list all competitors' names who participated in 1936 Summer.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Who is the youngest competitor that participated in 2014 Winter?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the average age of competitors who participated in 1988 Winter?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: What is the percentage of female competitors whose heights are over 170 that participated in the game in 1988?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the sport name of "Cross Country Skiing Men's 10/15 kilometres Pursuit" event?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: What is the percentage of people whose age greater than 24 and participate in winter season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the region id of Christine Jacoba Aaftink?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Mention the height of people who belong to region id 7.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT T2.height FROM person_region AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.id WHERE T1.region_id = 7
Write SQL query to solve given problem: State the name of the city that held game id 3.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What are the id of the games held in London?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: How many people who are below 30 and participated in the summer season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: List out the name of the game that the people participated in games id 13.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the average age of the people who participated in the winter season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Winter'
Write SQL query to solve given problem: What is the percentage of the people who are under 35 and participated in the summer season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: State the event name of Basketball.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT T2.event_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Basketball'
Write SQL query to solve given problem: What is the name of medal that competitor id 9 obtained?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: List out the id of event that achieve the gold medal.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Who is the heaviest athlete?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
SELECT full_name FROM person ORDER BY weight DESC LIMIT 1
Write SQL query to solve given problem: Which city were the Olympic games held in 1992?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: Which region is the majority of the athletes from?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the name of the oldest competitor?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: Which sport did John Aalberg participate in?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: How many Belgian men have competed in an Olympic Games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: How many athletes took part in the Olympic games held in Barcelona?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: How many different football events are there?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: What were the cities in which John Aalberg competed?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: In Barcelona, how many Olympic games were held?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: How many competitors over the age of 30 participated in the 1992 Winter Olympics?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the name of the Olympic game with the most competitors held in Barcelona?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: List the name of competitors from Argentina.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: What is the average age of Argentina's athletes who participated in the Summer Olympics in 2012?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Calculate the percentage of bronze medals won by men's basketball players.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: List the name of the games that Georgios Abaris participated.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Provide the name of competitors from Greece.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Calculate the average age of the competitors who participated in the 1924 Winter.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: What is the NOC code of the region of the competitors weighted 77 kg?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: List the names of the games held in Paris.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Provide the competitors' names who joined the 2000 Summer.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: In which city was the game held where the oldest competitor participated?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the name of the youngest competitor?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: List down the games ID of games held in Tokyo.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Give the NOC code and region name of the heaviest competitor.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: In what year and season did Sohail Abbas compete?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: What is the average weight of the competitors who won a silver medal?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: In which city the 2004 Summer was held?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: What is the season of the game where a competitor who weighted 73 kg and 180 cm tall, participated?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: Provide the names of competitors who received a gold medal.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Compute the average height of competitors whose age ranges from 22 to 28.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: How many female competitors were from Iran?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Provide the age of the tallest competitor.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: In the 2014 Winter game, what is the percentage of competitors who age 28 years old?. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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'
Write SQL query to solve given problem: Among the males, list the region name of people with height greater than 87% of the average height of all people listed.. Keep the solution inside sql tag ```sql [SQL-Query] ```
olympics
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
Write SQL query to solve given problem: What is the total number of households in Arecibo county?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Which residential area in Arecibo county has the highest average house value? Please give its zip_code.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: Please list the numbers of males in all the residential areas in Arecibo county.. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Among all the residential areas in Delaware, how many of them implement daylight saving?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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'
Write SQL query to solve given problem: Among all the residential areas in Arecibo county, what is the zip_code of the one with the highest white population?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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
Write SQL query to solve given problem: In which county is the residential area with the highest average income per household located?. Keep the solution inside sql tag ```sql [SQL-Query] ```
address
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