input stringlengths 122 2.7k | output stringlengths 24 805 |
|---|---|
[INST] Here is a database schema:
sport :
id [ INTEGER ] primary_key
sport_name [ TEXT ]
Please write me a SQL statement that answers the following question: State the name of sport id 19. [/INST] [/INST] | SELECT sport_name FROM sport WHERE id = 19; |
[INST] Here is a database schema:
event :
id [ INTEGER ] primary_key
sport_id [ INTEGER ] event.sport_id = sport.id
event_name [ TEXT ]
Please write me a SQL statement that answers the following question: Give the id of the event "Shooting Mixed Skeet". [/INST] [/INST] | SELECT id FROM event WHERE event_name = 'Shooting Mixed Skeet'; |
[INST] Here is a database schema:
sport :
id [ INTEGER ] primary_key
sport_name [ TEXT ]
Please write me a SQL statement that answers the following question: Provide hockey's sport id. [/INST] [/INST] | SELECT id FROM sport WHERE sport_name = 'Hockey'; |
[INST] Here is a database schema:
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
Please write me a SQL statement that answers the following question: Tell the weight of Dagfinn Sverre Aarskog. [/INST] [/INST] | SELECT weight FROM person WHERE full_name = 'Dagfinn Sverre Aarskog'; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
Please write me a SQL statement that answers the following question: What is the id of Rio de Janeiro? [/INST] [/INST] | SELECT id FROM city WHERE city_name = 'Rio de Janeiro'; |
[INST] Here is a database schema:
medal :
id [ INTEGER ] primary_key
medal_name [ TEXT ]
event :
id [ INTEGER ] primary_key
sport_id [ INTEGER ] event.sport_id = sport.id
event_name [ TEXT ]
competitor_event :
event_id [ INTEGER ] competitor_event.event_id = event.id
competitor_id [ INTEGER ] competitor_event.competito... | 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'; |
[INST] Here is a database schema:
sport :
id [ INTEGER ] primary_key
sport_name [ TEXT ]
event :
id [ INTEGER ] primary_key
sport_id [ INTEGER ] event.sport_id = sport.id
event_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many kinds of events belong to the sport of 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'; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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'; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL st... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
Please wri... | 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; |
[INST] Here is a database schema:
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGE... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
Please wri... | 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; |
[INST] Here is a database schema:
sport :
id [ INTEGER ] primary_key
sport_name [ TEXT ]
event :
id [ INTEGER ] primary_key
sport_id [ INTEGER ] event.sport_id = sport.id
event_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many kinds of events does athletics have? [/INST] [/INS... | 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'; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL st... | 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'; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_region.region_id = noc_region.id
Please write me a SQL statement that answers the following question: Which ... | 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; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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'; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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'; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL st... | 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'; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL st... | 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; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL st... | 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'; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL st... | 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'; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL statement that answers the following question: Which city hosted the most games? [/INST] [/INST] | 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; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL st... | 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; |
[INST] Here is a database schema:
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
competitor_event :
event_id [ INTEGER ] competitor_event.event_id = event.id
competitor_id [ INTEGER ] co... | 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; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
Please wri... | 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; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor... | 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; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor... | 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; |
[INST] Here is a database schema:
sport :
id [ INTEGER ] primary_key
sport_name [ TEXT ]
event :
id [ INTEGER ] primary_key
sport_id [ INTEGER ] event.sport_id = sport.id
event_name [ TEXT ]
Please write me a SQL statement that answers the following question: What is the sport name of "Cross Country Skiing Men's 10/15... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
Please wri... | 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; |
[INST] Here is a database schema:
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_region.region_id = noc_region.id
Please write me a SQL statement that ans... | 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'; |
[INST] Here is a database schema:
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_region.region_id = noc_region.id
Please write me a SQL statement that ans... | SELECT T2.height FROM person_region AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.id WHERE T1.region_id = 7; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL statement that answers the following question: State the name of the city that held game id 3. [... | 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; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL statement that answers the following question: What are the id of the games held in London? [/IN... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
Please wri... | 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; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
Please wri... | 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; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
Please wri... | SELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Winter'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
Please wri... | 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'; |
[INST] Here is a database schema:
sport :
id [ INTEGER ] primary_key
sport_name [ TEXT ]
event :
id [ INTEGER ] primary_key
sport_id [ INTEGER ] event.sport_id = sport.id
event_name [ TEXT ]
Please write me a SQL statement that answers the following question: State the event name of Basketball. [/INST] [/INST] | SELECT T2.event_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Basketball'; |
[INST] Here is a database schema:
medal :
id [ INTEGER ] primary_key
medal_name [ TEXT ]
competitor_event :
event_id [ INTEGER ] competitor_event.event_id = event.id
competitor_id [ INTEGER ] competitor_event.competitor_id = games_competitor.id
medal_id [ INTEGER ] competitor_event.medal_id = medal.id
Please write me ... | 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; |
[INST] Here is a database schema:
medal :
id [ INTEGER ] primary_key
medal_name [ TEXT ]
competitor_event :
event_id [ INTEGER ] competitor_event.event_id = event.id
competitor_id [ INTEGER ] competitor_event.competitor_id = games_competitor.id
medal_id [ INTEGER ] competitor_event.medal_id = medal.id
Please write me ... | 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'; |
[INST] Here is a database schema:
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
Please write me a SQL statement that answers the following question: Who is the heaviest athlete? [/INST] [/INST] | SELECT full_name FROM person ORDER BY weight DESC LIMIT 1; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL st... | 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; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_region.region_id = noc_region.id
Please write me a SQL statement that answers the following question: Which ... | 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; |
[INST] Here is a database schema:
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGE... | 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; |
[INST] Here is a database schema:
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGE... | 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'; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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'; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INT... | 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'; |
[INST] Here is a database schema:
sport :
id [ INTEGER ] primary_key
sport_name [ TEXT ]
event :
id [ INTEGER ] primary_key
sport_id [ INTEGER ] event.sport_id = sport.id
event_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many different football events are there? [/INST] [/INS... | 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'; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_comp... | 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'; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL statement that answers the following question: In Barcelona, how many Olympic games were held? [... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
Please wri... | 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; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
games_competitor :
id [ I... | 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; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ IN... | 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'; |
[INST] Here is a database schema:
medal :
id [ INTEGER ] primary_key
medal_name [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
event :
id [ INTEGER ] primary_key
sport_id [ INTE... | 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 '... |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor... | 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'; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
Please wri... | 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'; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL st... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor... | 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'; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
games_competitor :
id [ I... | 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; |
[INST] Here is a database schema:
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGE... | 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; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL statement that answers the following question: List down the games ID of games held in 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'; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor... | 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'; |
[INST] Here is a database schema:
medal :
id [ INTEGER ] primary_key
medal_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGE... | 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'; |
[INST] Here is a database schema:
city :
id [ INTEGER ] primary_key
city_name [ TEXT ]
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_city :
games_id [ INTEGER ] games_city.games_id = games.id
city_id [ INTEGER ] games_city.city_id = city.id
Please write me a SQL st... | 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'; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor... | 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; |
[INST] Here is a database schema:
medal :
id [ INTEGER ] primary_key
medal_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGE... | 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'; |
[INST] Here is a database schema:
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGE... | 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; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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'; |
[INST] Here is a database schema:
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGE... | 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; |
[INST] Here is a database schema:
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGE... | 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; |
[INST] Here is a database schema:
games :
id [ INTEGER ] primary_key
games_year [ INTEGER ]
games_name [ TEXT ]
season [ TEXT ]
games_competitor :
id [ INTEGER ] primary_key
games_id [ INTEGER ] games_competitor.games_id = games.id
person_id [ INTEGER ] games_competitor.person_id = person.id
age [ INTEGER ]
Please wri... | 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'; |
[INST] Here is a database schema:
noc_region :
id [ INTEGER ] primary_key
noc [ TEXT ]
region_name [ TEXT ]
person :
id [ INTEGER ] primary_key
full_name [ TEXT ]
gender [ TEXT ]
height [ INTEGER ]
weight [ INTEGER ]
person_region :
person_id [ INTEGER ] person_region.person_id = person.id
region_id [ INTEGER ] person_... | 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; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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'; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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'; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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'; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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'; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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'; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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'; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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'; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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; |
[INST] Here is a database schema:
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
longitude [ REAL ]
elevation [ INTEGER ]
state_fips [ IN... | 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'; |
[INST] Here is a database schema:
state :
abbreviation [ TEXT ] primary_key
name [ TEXT ]
country :
zip_code [ INTEGER ] country.zip_code = zip_data.zip_code
county [ TEXT ]
state [ TEXT ] country.state = state.abbreviation
Please write me a SQL statement that answers the following question: How many counties are ther... | SELECT COUNT(T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Alabama'; |
[INST] Here is a database schema:
state :
abbreviation [ TEXT ] primary_key
name [ TEXT ]
zip_data :
zip_code [ INTEGER ] primary_key
city [ TEXT ]
state [ TEXT ] zip_data.state = state.abbreviation
multi_county [ TEXT ]
type [ TEXT ]
organization [ TEXT ]
time_zone [ TEXT ]
daylight_savings [ TEXT ]
latitude [ REAL ]
... | 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'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.