brief_instruction stringlengths 16 224 | instruction stringlengths 687 8.77k | output stringlengths 18 577 |
|---|---|---|
Show the name of colleges that have at least two players. |
-- Language PostgreSQL
-- Tables:
-- Table: country
columns : [['country id', 'number'], ['country name', 'text'], ['capital', 'text'], ['official native language', 'text']]
-- Table: team
columns : [['team id', 'number'], ['name', 'text']]
-- Table: match season
columns : [['season', 'number'], ['player', 'text'], ['position', 'text'], ['country', 'number'], ['team', 'number'], ['draft pick number', 'number'], ['draft class', 'text'], ['college', 'text']]
-- Table: player
columns : [['player id', 'number'], ['player', 'text'], ['years played', 'text'], ['total wl', 'text'], ['singles wl', 'text'], ['doubles wl', 'text'], ['team', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the name of colleges that have at least two players.` to a syntactically-correct PostgreSQL query.
| SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 |
What are the names of all colleges that have two or more players? |
-- Language PostgreSQL
-- Tables:
-- Table: country
columns : [['country id', 'number'], ['country name', 'text'], ['capital', 'text'], ['official native language', 'text']]
-- Table: team
columns : [['team id', 'number'], ['name', 'text']]
-- Table: match season
columns : [['season', 'number'], ['player', 'text'], ['position', 'text'], ['country', 'number'], ['team', 'number'], ['draft pick number', 'number'], ['draft class', 'text'], ['college', 'text']]
-- Table: player
columns : [['player id', 'number'], ['player', 'text'], ['years played', 'text'], ['total wl', 'text'], ['singles wl', 'text'], ['doubles wl', 'text'], ['team', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of all colleges that have two or more players?` to a syntactically-correct PostgreSQL query.
| SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 |
Show the name of colleges that have at least two players in descending alphabetical order. |
-- Language PostgreSQL
-- Tables:
-- Table: country
columns : [['country id', 'number'], ['country name', 'text'], ['capital', 'text'], ['official native language', 'text']]
-- Table: team
columns : [['team id', 'number'], ['name', 'text']]
-- Table: match season
columns : [['season', 'number'], ['player', 'text'], ['position', 'text'], ['country', 'number'], ['team', 'number'], ['draft pick number', 'number'], ['draft class', 'text'], ['college', 'text']]
-- Table: player
columns : [['player id', 'number'], ['player', 'text'], ['years played', 'text'], ['total wl', 'text'], ['singles wl', 'text'], ['doubles wl', 'text'], ['team', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the name of colleges that have at least two players in descending alphabetical order.` to a syntactically-correct PostgreSQL query.
| SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC |
What are the names of colleges that have two or more players, listed in descending alphabetical order? |
-- Language PostgreSQL
-- Tables:
-- Table: country
columns : [['country id', 'number'], ['country name', 'text'], ['capital', 'text'], ['official native language', 'text']]
-- Table: team
columns : [['team id', 'number'], ['name', 'text']]
-- Table: match season
columns : [['season', 'number'], ['player', 'text'], ['position', 'text'], ['country', 'number'], ['team', 'number'], ['draft pick number', 'number'], ['draft class', 'text'], ['college', 'text']]
-- Table: player
columns : [['player id', 'number'], ['player', 'text'], ['years played', 'text'], ['total wl', 'text'], ['singles wl', 'text'], ['doubles wl', 'text'], ['team', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of colleges that have two or more players, listed in descending alphabetical order?` to a syntactically-correct PostgreSQL query.
| SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC |
What are the names of teams that do no have match season record? |
-- Language PostgreSQL
-- Tables:
-- Table: country
columns : [['country id', 'number'], ['country name', 'text'], ['capital', 'text'], ['official native language', 'text']]
-- Table: team
columns : [['team id', 'number'], ['name', 'text']]
-- Table: match season
columns : [['season', 'number'], ['player', 'text'], ['position', 'text'], ['country', 'number'], ['team', 'number'], ['draft pick number', 'number'], ['draft class', 'text'], ['college', 'text']]
-- Table: player
columns : [['player id', 'number'], ['player', 'text'], ['years played', 'text'], ['total wl', 'text'], ['singles wl', 'text'], ['doubles wl', 'text'], ['team', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of teams that do no have match season record?` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season) |
Return the names of teams that have no match season record. |
-- Language PostgreSQL
-- Tables:
-- Table: country
columns : [['country id', 'number'], ['country name', 'text'], ['capital', 'text'], ['official native language', 'text']]
-- Table: team
columns : [['team id', 'number'], ['name', 'text']]
-- Table: match season
columns : [['season', 'number'], ['player', 'text'], ['position', 'text'], ['country', 'number'], ['team', 'number'], ['draft pick number', 'number'], ['draft class', 'text'], ['college', 'text']]
-- Table: player
columns : [['player id', 'number'], ['player', 'text'], ['years played', 'text'], ['total wl', 'text'], ['singles wl', 'text'], ['doubles wl', 'text'], ['team', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the names of teams that have no match season record.` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season) |
What are the names of countries that have both players with position forward and players with position defender? |
-- Language PostgreSQL
-- Tables:
-- Table: country
columns : [['country id', 'number'], ['country name', 'text'], ['capital', 'text'], ['official native language', 'text']]
-- Table: team
columns : [['team id', 'number'], ['name', 'text']]
-- Table: match season
columns : [['season', 'number'], ['player', 'text'], ['position', 'text'], ['country', 'number'], ['team', 'number'], ['draft pick number', 'number'], ['draft class', 'text'], ['college', 'text']]
-- Table: player
columns : [['player id', 'number'], ['player', 'text'], ['years played', 'text'], ['total wl', 'text'], ['singles wl', 'text'], ['doubles wl', 'text'], ['team', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of countries that have both players with position forward and players with position defender?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender" |
Return the names of countries that have players that play the Forward position, as well as players who play the Defender position. |
-- Language PostgreSQL
-- Tables:
-- Table: country
columns : [['country id', 'number'], ['country name', 'text'], ['capital', 'text'], ['official native language', 'text']]
-- Table: team
columns : [['team id', 'number'], ['name', 'text']]
-- Table: match season
columns : [['season', 'number'], ['player', 'text'], ['position', 'text'], ['country', 'number'], ['team', 'number'], ['draft pick number', 'number'], ['draft class', 'text'], ['college', 'text']]
-- Table: player
columns : [['player id', 'number'], ['player', 'text'], ['years played', 'text'], ['total wl', 'text'], ['singles wl', 'text'], ['doubles wl', 'text'], ['team', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the names of countries that have players that play the Forward position, as well as players who play the Defender position.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender" |
Which college have both players with position midfielder and players with position defender? |
-- Language PostgreSQL
-- Tables:
-- Table: country
columns : [['country id', 'number'], ['country name', 'text'], ['capital', 'text'], ['official native language', 'text']]
-- Table: team
columns : [['team id', 'number'], ['name', 'text']]
-- Table: match season
columns : [['season', 'number'], ['player', 'text'], ['position', 'text'], ['country', 'number'], ['team', 'number'], ['draft pick number', 'number'], ['draft class', 'text'], ['college', 'text']]
-- Table: player
columns : [['player id', 'number'], ['player', 'text'], ['years played', 'text'], ['total wl', 'text'], ['singles wl', 'text'], ['doubles wl', 'text'], ['team', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Which college have both players with position midfielder and players with position defender?` to a syntactically-correct PostgreSQL query.
| SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender" |
Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position. |
-- Language PostgreSQL
-- Tables:
-- Table: country
columns : [['country id', 'number'], ['country name', 'text'], ['capital', 'text'], ['official native language', 'text']]
-- Table: team
columns : [['team id', 'number'], ['name', 'text']]
-- Table: match season
columns : [['season', 'number'], ['player', 'text'], ['position', 'text'], ['country', 'number'], ['team', 'number'], ['draft pick number', 'number'], ['draft class', 'text'], ['college', 'text']]
-- Table: player
columns : [['player id', 'number'], ['player', 'text'], ['years played', 'text'], ['total wl', 'text'], ['singles wl', 'text'], ['doubles wl', 'text'], ['team', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.` to a syntactically-correct PostgreSQL query.
| SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION = "Defender" |
How many climbers are there? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many climbers are there?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM climber |
Count the number of climbers. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Count the number of climbers.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM climber |
List the names of climbers in descending order of points. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the names of climbers in descending order of points.` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM climber ORDER BY Points DESC |
What are the names of the climbers, ordered by points descending? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of the climbers, ordered by points descending?` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM climber ORDER BY Points DESC |
List the names of climbers whose country is not Switzerland. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the names of climbers whose country is not Switzerland.` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM climber WHERE Country != "Switzerland" |
What are the names of climbers who are not from the country of Switzerland? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of climbers who are not from the country of Switzerland?` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM climber WHERE Country != "Switzerland" |
What is the maximum point for climbers whose country is United Kingdom? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the maximum point for climbers whose country is United Kingdom?` to a syntactically-correct PostgreSQL query.
| SELECT max(Points) FROM climber WHERE Country = "United Kingdom" |
Return the maximum number of points for climbers from the United Kingdom. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the maximum number of points for climbers from the United Kingdom.` to a syntactically-correct PostgreSQL query.
| SELECT max(Points) FROM climber WHERE Country = "United Kingdom" |
How many distinct countries are the climbers from? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many distinct countries are the climbers from?` to a syntactically-correct PostgreSQL query.
| SELECT COUNT(DISTINCT Country) FROM climber |
Count the number of different countries that climbers are from. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Count the number of different countries that climbers are from.` to a syntactically-correct PostgreSQL query.
| SELECT COUNT(DISTINCT Country) FROM climber |
What are the names of mountains in ascending alphabetical order? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of mountains in ascending alphabetical order?` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM mountain ORDER BY Name ASC |
Give the names of mountains in alphabetical order. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give the names of mountains in alphabetical order.` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM mountain ORDER BY Name ASC |
What are the countries of mountains with height bigger than 5000? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the countries of mountains with height bigger than 5000?` to a syntactically-correct PostgreSQL query.
| SELECT Country FROM mountain WHERE Height > 5000 |
Return the countries of the mountains that have a height larger than 5000. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the countries of the mountains that have a height larger than 5000.` to a syntactically-correct PostgreSQL query.
| SELECT Country FROM mountain WHERE Height > 5000 |
What is the name of the highest mountain? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the name of the highest mountain?` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1 |
Return the name of the mountain with the greatest height. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the name of the mountain with the greatest height.` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1 |
List the distinct ranges of the mountains with the top 3 prominence. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the distinct ranges of the mountains with the top 3 prominence.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3 |
What are the different ranges of the 3 mountains with the highest prominence? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the different ranges of the 3 mountains with the highest prominence?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3 |
Show names of climbers and the names of mountains they climb. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show names of climbers and the names of mountains they climb.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID |
What are the names of climbers and the corresponding names of mountains that they climb? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of climbers and the corresponding names of mountains that they climb?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID |
Show the names of climbers and the heights of mountains they climb. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the names of climbers and the heights of mountains they climb.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID |
What are the names of climbers and the corresponding heights of the mountains that they climb? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of climbers and the corresponding heights of the mountains that they climb?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID |
Show the height of the mountain climbed by the climber with the maximum points. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the height of the mountain climbed by the climber with the maximum points.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1 |
What is the height of the mountain climbined by the climbing who had the most points? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the height of the mountain climbined by the climbing who had the most points?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1 |
Show the distinct names of mountains climbed by climbers from country "West Germany". |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the distinct names of mountains climbed by climbers from country "West Germany".` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany" |
What are the different names of mountains ascended by climbers from the country of West Germany? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the different names of mountains ascended by climbers from the country of West Germany?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = "West Germany" |
Show the times used by climbers to climb mountains in Country Uganda. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the times used by climbers to climb mountains in Country Uganda.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda" |
What are the times used by climbers who climbed mountains in the country of Uganda? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the times used by climbers who climbed mountains in the country of Uganda?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda" |
Please show the countries and the number of climbers from each country. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Please show the countries and the number of climbers from each country.` to a syntactically-correct PostgreSQL query.
| SELECT Country , COUNT(*) FROM climber GROUP BY Country |
How many climbers are from each country? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many climbers are from each country?` to a syntactically-correct PostgreSQL query.
| SELECT Country , COUNT(*) FROM climber GROUP BY Country |
List the countries that have more than one mountain. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the countries that have more than one mountain.` to a syntactically-correct PostgreSQL query.
| SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1 |
Which countries have more than one mountain? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Which countries have more than one mountain?` to a syntactically-correct PostgreSQL query.
| SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1 |
List the names of mountains that do not have any climber. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the names of mountains that do not have any climber.` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber) |
What are the names of countains that no climber has climbed? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of countains that no climber has climbed?` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber) |
Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200.` to a syntactically-correct PostgreSQL query.
| SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200 |
What are the countries that have both mountains that are higher than 5600 and lower than 5200? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the countries that have both mountains that are higher than 5600 and lower than 5200?` to a syntactically-correct PostgreSQL query.
| SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200 |
Show the range that has the most number of mountains. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the range that has the most number of mountains.` to a syntactically-correct PostgreSQL query.
| SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1 |
Which range contains the most mountains? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Which range contains the most mountains?` to a syntactically-correct PostgreSQL query.
| SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1 |
Show the names of mountains with height more than 5000 or prominence more than 1000. |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the names of mountains with height more than 5000 or prominence more than 1000.` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000 |
What are the names of mountains that have a height of over 5000 or a prominence of over 1000? |
-- Language PostgreSQL
-- Tables:
-- Table: mountain
columns : [['mountain id', 'number'], ['name', 'text'], ['height', 'number'], ['prominence', 'number'], ['range', 'text'], ['country', 'text']]
-- Table: climber
columns : [['climber id', 'number'], ['name', 'text'], ['country', 'text'], ['time', 'text'], ['points', 'number'], ['mountain id', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of mountains that have a height of over 5000 or a prominence of over 1000?` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000 |
How many body builders are there? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many body builders are there?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM body_builder |
List the total scores of body builders in ascending order. |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the total scores of body builders in ascending order.` to a syntactically-correct PostgreSQL query.
| SELECT Total FROM body_builder ORDER BY Total ASC |
List the snatch score and clean jerk score of body builders in ascending order of snatch score. |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the snatch score and clean jerk score of body builders in ascending order of snatch score.` to a syntactically-correct PostgreSQL query.
| SELECT Snatch , Clean_Jerk FROM body_builder ORDER BY Snatch ASC |
What is the average snatch score of body builders? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the average snatch score of body builders?` to a syntactically-correct PostgreSQL query.
| SELECT avg(Snatch) FROM body_builder |
What are the clean and jerk score of the body builder with the highest total score? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the clean and jerk score of the body builder with the highest total score?` to a syntactically-correct PostgreSQL query.
| SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1 |
What are the birthdays of people in ascending order of height? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the birthdays of people in ascending order of height?` to a syntactically-correct PostgreSQL query.
| SELECT Birth_Date FROM People ORDER BY Height ASC |
What are the names of body builders? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of body builders?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID |
What are the names of body builders whose total score is higher than 300? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of body builders whose total score is higher than 300?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300 |
What is the name of the body builder with the greatest body weight? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the name of the body builder with the greatest body weight?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1 |
What are the birth date and birth place of the body builder with the highest total points? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the birth date and birth place of the body builder with the highest total points?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Birth_Date , T2.Birth_Place FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC LIMIT 1 |
What are the heights of body builders with total score smaller than 315? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the heights of body builders with total score smaller than 315?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315 |
What is the average total score of body builders with height bigger than 200? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the average total score of body builders with height bigger than 200?` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200 |
What are the names of body builders in descending order of total scores? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of body builders in descending order of total scores?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC |
List each birth place along with the number of people from there. |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List each birth place along with the number of people from there.` to a syntactically-correct PostgreSQL query.
| SELECT Birth_Place , COUNT(*) FROM people GROUP BY Birth_Place |
What is the most common birth place of people? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the most common birth place of people?` to a syntactically-correct PostgreSQL query.
| SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1 |
What are the birth places that are shared by at least two people? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the birth places that are shared by at least two people?` to a syntactically-correct PostgreSQL query.
| SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2 |
List the height and weight of people in descending order of height. |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the height and weight of people in descending order of height.` to a syntactically-correct PostgreSQL query.
| SELECT Height , Weight FROM people ORDER BY Height DESC |
Show all information about each body builder. |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show all information about each body builder.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM body_builder |
List the names and origins of people who are not body builders. |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the names and origins of people who are not body builders.` to a syntactically-correct PostgreSQL query.
| SELECT Name , birth_place FROM people EXCEPT SELECT T1.Name , T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id = T2.people_id |
How many distinct birth places are there? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many distinct birth places are there?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT Birth_Place) FROM people |
How many persons are not body builders? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many persons are not body builders?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder) |
List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200. |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.` to a syntactically-correct PostgreSQL query.
| SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.snatch > 140 OR T2.height > 200; |
What are the total scores of the body builders whose birthday contains the string "January" ? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the total scores of the body builders whose birthday contains the string "January" ?` to a syntactically-correct PostgreSQL query.
| SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.Birth_Date LIKE "%January%"; |
What is the minimum snatch score? |
-- Language PostgreSQL
-- Tables:
-- Table: body builder
columns : [['body builder id', 'number'], ['people id', 'number'], ['snatch', 'number'], ['clean jerk', 'number'], ['total', 'number']]
-- Table: people
columns : [['people id', 'number'], ['name', 'text'], ['height', 'number'], ['weight', 'number'], ['birth date', 'text'], ['birth place', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the minimum snatch score?` to a syntactically-correct PostgreSQL query.
| SELECT min(snatch) FROM body_builder |
How many elections are there? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many elections are there?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM election |
List the votes of elections in descending order. |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the votes of elections in descending order.` to a syntactically-correct PostgreSQL query.
| SELECT Votes FROM election ORDER BY Votes DESC |
List the dates and vote percents of elections. |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the dates and vote percents of elections.` to a syntactically-correct PostgreSQL query.
| SELECT Date , Vote_Percent FROM election |
What are the minimum and maximum vote percents of elections? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the minimum and maximum vote percents of elections?` to a syntactically-correct PostgreSQL query.
| SELECT min(Vote_Percent) , max(Vote_Percent) FROM election |
What are the names and parties of representatives? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names and parties of representatives?` to a syntactically-correct PostgreSQL query.
| SELECT Name , Party FROM representative |
What are the names of representatives whose party is not "Republican"? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of representatives whose party is not "Republican"?` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM Representative WHERE Party != "Republican" |
What are the life spans of representatives from New York state or Indiana state? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the life spans of representatives from New York state or Indiana state?` to a syntactically-correct PostgreSQL query.
| SELECT Lifespan FROM representative WHERE State = "New York" OR State = "Indiana" |
What are the names of representatives and the dates of elections they participated in. |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of representatives and the dates of elections they participated in.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Name , T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID |
What are the names of representatives with more than 10000 votes in election? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of representatives with more than 10000 votes in election?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000 |
What are the names of representatives in descending order of votes? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of representatives in descending order of votes?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC |
What is the party of the representative that has the smallest number of votes. |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the party of the representative that has the smallest number of votes.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC LIMIT 1 |
What are the lifespans of representatives in descending order of vote percent? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the lifespans of representatives in descending order of vote percent?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC |
What is the average number of votes of representatives from party "Republican"? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the average number of votes of representatives from party "Republican"?` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = "Republican" |
What are the different parties of representative? Show the party name and the number of representatives in each party. |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the different parties of representative? Show the party name and the number of representatives in each party.` to a syntactically-correct PostgreSQL query.
| SELECT Party , COUNT(*) FROM representative GROUP BY Party |
What is the party that has the largest number of representatives? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the party that has the largest number of representatives?` to a syntactically-correct PostgreSQL query.
| SELECT Party , COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1 |
What parties have at least three representatives? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What parties have at least three representatives?` to a syntactically-correct PostgreSQL query.
| SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3 |
What states have at least two representatives? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What states have at least two representatives?` to a syntactically-correct PostgreSQL query.
| SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2 |
List the names of representatives that have not participated in elections listed here. |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the names of representatives that have not participated in elections listed here.` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election) |
Show the parties that have both representatives in New York state and representatives in Pennsylvania state. |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the parties that have both representatives in New York state and representatives in Pennsylvania state.` to a syntactically-correct PostgreSQL query.
| SELECT Party FROM representative WHERE State = "New York" INTERSECT SELECT Party FROM representative WHERE State = "Pennsylvania" |
How many distinct parties are there for representatives? |
-- Language PostgreSQL
-- Tables:
-- Table: election
columns : [['election id', 'number'], ['representative id', 'number'], ['date', 'text'], ['votes', 'number'], ['vote percent', 'number'], ['seats', 'number'], ['place', 'number']]
-- Table: representative
columns : [['representative id', 'number'], ['name', 'text'], ['state', 'text'], ['party', 'text'], ['lifespan', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many distinct parties are there for representatives?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT Party) FROM representative |
How many apartment bookings are there in total? |
-- Language PostgreSQL
-- Tables:
-- Table: apartment buildings
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]
-- Table: apartments
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]
-- Table: apartment facilities
columns : [['apartment id', 'number'], ['facility code', 'text']]
-- Table: guests
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]
-- Table: apartment bookings
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]
-- Table: view unit status
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many apartment bookings are there in total?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Apartment_Bookings |
Count the total number of apartment bookings. |
-- Language PostgreSQL
-- Tables:
-- Table: apartment buildings
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]
-- Table: apartments
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]
-- Table: apartment facilities
columns : [['apartment id', 'number'], ['facility code', 'text']]
-- Table: guests
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]
-- Table: apartment bookings
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]
-- Table: view unit status
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Count the total number of apartment bookings.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Apartment_Bookings |
Show the start dates and end dates of all the apartment bookings. |
-- Language PostgreSQL
-- Tables:
-- Table: apartment buildings
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]
-- Table: apartments
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]
-- Table: apartment facilities
columns : [['apartment id', 'number'], ['facility code', 'text']]
-- Table: guests
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]
-- Table: apartment bookings
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]
-- Table: view unit status
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the start dates and end dates of all the apartment bookings.` to a syntactically-correct PostgreSQL query.
| SELECT booking_start_date , booking_end_date FROM Apartment_Bookings |
What are the start date and end date of each apartment booking? |
-- Language PostgreSQL
-- Tables:
-- Table: apartment buildings
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]
-- Table: apartments
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]
-- Table: apartment facilities
columns : [['apartment id', 'number'], ['facility code', 'text']]
-- Table: guests
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]
-- Table: apartment bookings
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]
-- Table: view unit status
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the start date and end date of each apartment booking?` to a syntactically-correct PostgreSQL query.
| SELECT booking_start_date , booking_end_date FROM Apartment_Bookings |
Show all distinct building descriptions. |
-- Language PostgreSQL
-- Tables:
-- Table: apartment buildings
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]
-- Table: apartments
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]
-- Table: apartment facilities
columns : [['apartment id', 'number'], ['facility code', 'text']]
-- Table: guests
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]
-- Table: apartment bookings
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]
-- Table: view unit status
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show all distinct building descriptions.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT building_description FROM Apartment_Buildings |
Give me a list of all the distinct building descriptions. |
-- Language PostgreSQL
-- Tables:
-- Table: apartment buildings
columns : [['building id', 'number'], ['building short name', 'text'], ['building full name', 'text'], ['building description', 'text'], ['building address', 'text'], ['building manager', 'text'], ['building phone', 'text']]
-- Table: apartments
columns : [['apartment id', 'number'], ['building id', 'number'], ['apartment type code', 'text'], ['apartment number', 'text'], ['bathroom count', 'number'], ['bedroom count', 'number'], ['room count', 'text']]
-- Table: apartment facilities
columns : [['apartment id', 'number'], ['facility code', 'text']]
-- Table: guests
columns : [['guest id', 'number'], ['gender code', 'text'], ['guest first name', 'text'], ['guest last name', 'text'], ['date of birth', 'time']]
-- Table: apartment bookings
columns : [['apartment booking id', 'number'], ['apartment id', 'number'], ['guest id', 'number'], ['booking status code', 'text'], ['booking start date', 'time'], ['booking end date', 'time']]
-- Table: view unit status
columns : [['apartment id', 'number'], ['apartment booking id', 'number'], ['status date', 'time'], ['available yes or no', 'others']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give me a list of all the distinct building descriptions.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT building_description FROM Apartment_Buildings |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.