brief_instruction stringlengths 16 224 | instruction stringlengths 687 8.77k | output stringlengths 18 577 |
|---|---|---|
Find the name of all students who were in the tryout sorted in alphabetic order. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the name of all students who were in the tryout sorted in alphabetic order.` to a syntactically-correct PostgreSQL query.
| SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName |
What are the names of all students who tried out in alphabetical order? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 all students who tried out in alphabetical order?` to a syntactically-correct PostgreSQL query.
| SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName |
Find the name and hours of the students whose tryout decision is yes. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the name and hours of the students whose tryout decision is yes.` to a syntactically-correct PostgreSQL query.
| SELECT T1.pName , T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' |
What are the names and hours spent practicing of every student who received a yes at tryouts? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 hours spent practicing of every student who received a yes at tryouts?` to a syntactically-correct PostgreSQL query.
| SELECT T1.pName , T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' |
Find the states of the colleges that have students in the tryout who played in striker position. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the states of the colleges that have students in the tryout who played in striker position.` to a syntactically-correct PostgreSQL query.
| SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker' |
What are the states of the colleges where students who tried out for the striker position attend? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 states of the colleges where students who tried out for the striker position attend?` to a syntactically-correct PostgreSQL query.
| SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker' |
Find the names of the students who are in the position of striker and got a yes tryout decision. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the names of the students who are in the position of striker and got a yes tryout decision.` to a syntactically-correct PostgreSQL query.
| SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker' |
What are the names of all students who successfully tried out for the position of striker? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 all students who successfully tried out for the position of striker?` to a syntactically-correct PostgreSQL query.
| SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker' |
Find the state of the college which player Charles is attending. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the state of the college which player Charles is attending.` to a syntactically-correct PostgreSQL query.
| SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles' |
In which state is the college that Charles attends? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `In which state is the college that Charles attends?` to a syntactically-correct PostgreSQL query.
| SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles' |
Find the average and maximum hours for the students whose tryout decision is yes. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the average and maximum hours for the students whose tryout decision is yes.` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.HS) , max(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' |
What is the average and maximum number of hours students who made the team practiced? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 and maximum number of hours students who made the team practiced?` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.HS) , max(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' |
Find the average hours for the students whose tryout decision is no. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the average hours for the students whose tryout decision is no.` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no' |
What is the average number of hours spent practicing for students who got rejected? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 hours spent practicing for students who got rejected?` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no' |
What is the maximum training hours for the students whose training hours is greater than 1000 in different positions? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 maximum training hours for the students whose training hours is greater than 1000 in different positions?` to a syntactically-correct PostgreSQL query.
| SELECT max(T1.HS) , pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos |
For each position, what is the maximum number of hours for students who spent more than 1000 hours training? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `For each position, what is the maximum number of hours for students who spent more than 1000 hours training?` to a syntactically-correct PostgreSQL query.
| SELECT max(T1.HS) , pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos |
Which colleges do the tryout players whose name starts with letter D go to? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Which colleges do the tryout players whose name starts with letter D go to?` to a syntactically-correct PostgreSQL query.
| SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%' |
Which colleges does each player with a name that starts with the letter D who tried out go to? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Which colleges does each player with a name that starts with the letter D who tried out go to?` to a syntactically-correct PostgreSQL query.
| SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%' |
Which college has any student who is a goalie and succeeded in the tryout. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Which college has any student who is a goalie and succeeded in the tryout.` to a syntactically-correct PostgreSQL query.
| SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie' |
What college has a student who successfully made the team in the role of a goalie? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 college has a student who successfully made the team in the role of a goalie?` to a syntactically-correct PostgreSQL query.
| SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie' |
Find the name of the tryout players who are from the college with largest size. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the name of the tryout players who are from the college with largest size.` to a syntactically-correct PostgreSQL query.
| SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1) |
What are the names of all tryout participants who are from the largest college? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 all tryout participants who are from the largest college?` to a syntactically-correct PostgreSQL query.
| SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1) |
What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 state and enrollment of the colleges where have any students who got accepted in the tryout decision.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T1.state , T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' |
How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T1.state , T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' |
Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.` to a syntactically-correct PostgreSQL query.
| SELECT cName FROM College WHERE enr < 13000 AND state = "AZ" UNION SELECT cName FROM College WHERE enr > 15000 AND state = "LA" |
What are the names of colleges in LA that have more than 15,000 students and of colleges in AZ with less than 13,000 students? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 colleges in LA that have more than 15,000 students and of colleges in AZ with less than 13,000 students?` to a syntactically-correct PostgreSQL query.
| SELECT cName FROM College WHERE enr < 13000 AND state = "AZ" UNION SELECT cName FROM College WHERE enr > 15000 AND state = "LA" |
Find the names of schools that have some students playing in goalie and mid positions. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the names of schools that have some students playing in goalie and mid positions.` to a syntactically-correct PostgreSQL query.
| SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid' |
What are the names of all schools that have students trying out for the position of goal and 'mid'-field. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 all schools that have students trying out for the position of goal and 'mid'-field.` to a syntactically-correct PostgreSQL query.
| SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid' |
Find the names of states that have some college students playing in goalie and mid positions. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the names of states that have some college students playing in goalie and mid positions.` to a syntactically-correct PostgreSQL query.
| SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' |
What are the names of the states that have some college students playing in the positions of goalie and mid-field? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 the states that have some college students playing in the positions of goalie and mid-field?` to a syntactically-correct PostgreSQL query.
| SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' |
How many schools have some students playing in goalie and mid positions. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 schools have some students playing in goalie and mid positions.` to a syntactically-correct PostgreSQL query.
| SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid') |
How many schools have students playing in goalie and mid-field positions? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 schools have students playing in goalie and mid-field positions?` to a syntactically-correct PostgreSQL query.
| SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid') |
Find the names of schools that have some players in the mid position but not in the goalie position. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the names of schools that have some players in the mid position but not in the goalie position.` to a syntactically-correct PostgreSQL query.
| SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie' |
What are the names of the schools with some players in the mid position but no goalies? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 the schools with some players in the mid position but no goalies?` to a syntactically-correct PostgreSQL query.
| SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie' |
Find the names of states that have some college students playing in the mid position but not in the goalie position. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the names of states that have some college students playing in the mid position but not in the goalie position.` to a syntactically-correct PostgreSQL query.
| SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' |
What are the names of all the states with college students playing in the mid position but no goalies? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 all the states with college students playing in the mid position but no goalies?` to a syntactically-correct PostgreSQL query.
| SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' |
How many states that have some college students playing in the mid position but not in the goalie position. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 states that have some college students playing in the mid position but not in the goalie position.` to a syntactically-correct PostgreSQL query.
| SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie') |
What is the count of states with college students playing in the mid position but not as goalies? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 count of states with college students playing in the mid position but not as goalies?` to a syntactically-correct PostgreSQL query.
| SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie') |
Find the states where have the colleges whose enrollments are less than the largest size. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find the states where have the colleges whose enrollments are less than the largest size.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT state FROM college WHERE enr < (SELECT max(enr) FROM college) |
What are the states with colleges that have enrollments less than the some other college? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 states with colleges that have enrollments less than the some other college?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT state FROM college WHERE enr < (SELECT max(enr) FROM college) |
Find names of colleges with enrollment greater than that of some (at least one) college in the FL state. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find names of colleges with enrollment greater than that of some (at least one) college in the FL state.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT cName FROM college WHERE enr > (SELECT min(enr) FROM college WHERE state = 'FL') |
What are the names of the colleges that are larger than at least one college in Florida? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 the colleges that are larger than at least one college in Florida?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT cName FROM college WHERE enr > (SELECT min(enr) FROM college WHERE state = 'FL') |
Find names of all colleges whose enrollment is greater than that of all colleges in the FL state. |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 `Find names of all colleges whose enrollment is greater than that of all colleges in the FL state.` to a syntactically-correct PostgreSQL query.
| SELECT cName FROM college WHERE enr > (SELECT max(enr) FROM college WHERE state = 'FL') |
What are the names of all colleges with a larger enrollment than the largest college in Florida? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 all colleges with a larger enrollment than the largest college in Florida?` to a syntactically-correct PostgreSQL query.
| SELECT cName FROM college WHERE enr > (SELECT max(enr) FROM college WHERE state = 'FL') |
What is the total number of enrollment of schools that do not have any goalie player? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 total number of enrollment of schools that do not have any goalie player?` to a syntactically-correct PostgreSQL query.
| SELECT sum(enr) FROM college WHERE cName NOT IN (SELECT cName FROM tryout WHERE pPos = "goalie") |
What is the total number of students enrolled in schools without any goalies? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 total number of students enrolled in schools without any goalies?` to a syntactically-correct PostgreSQL query.
| SELECT sum(enr) FROM college WHERE cName NOT IN (SELECT cName FROM tryout WHERE pPos = "goalie") |
What is the number of states that has some college whose enrollment is larger than the average enrollment? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 number of states that has some college whose enrollment is larger than the average enrollment?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT state) FROM college WHERE enr > (SELECT avg(enr) FROM college) |
How many states have a college with more students than average? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 states have a college with more students than average?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT state) FROM college WHERE enr > (SELECT avg(enr) FROM college) |
What is the number of states that has some colleges whose enrollment is smaller than the average enrollment? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 number of states that has some colleges whose enrollment is smaller than the average enrollment?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT state) FROM college WHERE enr < (SELECT avg(enr) FROM college) |
How many states have smaller colleges than average? |
-- Language PostgreSQL
-- Tables:
-- Table: college
columns : [['college name', 'text'], ['state', 'text'], ['enrollment', 'number']]
-- Table: player
columns : [['player id', 'number'], ['player name', 'text'], ['yes card', 'text'], ['training hours', 'number']]
-- Table: tryout
columns : [['player id', 'number'], ['college name', 'text'], ['player position', 'text'], ['decision', '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 states have smaller colleges than average?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT state) FROM college WHERE enr < (SELECT avg(enr) FROM college) |
How many devices are there? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 devices are there?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM device |
Count the number of devices. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 devices.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM device |
List the carriers of devices in ascending alphabetical order. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 carriers of devices in ascending alphabetical order.` to a syntactically-correct PostgreSQL query.
| SELECT Carrier FROM device ORDER BY Carrier ASC |
What are the different carriers for devices, listed in alphabetical order? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 carriers for devices, listed in alphabetical order?` to a syntactically-correct PostgreSQL query.
| SELECT Carrier FROM device ORDER BY Carrier ASC |
What are the carriers of devices whose software platforms are not "Android"? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 carriers of devices whose software platforms are not "Android"?` to a syntactically-correct PostgreSQL query.
| SELECT Carrier FROM device WHERE Software_Platform != 'Android' |
Return the device carriers that do not have Android as their software platform. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 device carriers that do not have Android as their software platform.` to a syntactically-correct PostgreSQL query.
| SELECT Carrier FROM device WHERE Software_Platform != 'Android' |
What are the names of shops in ascending order of open year? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 shops in ascending order of open year?` to a syntactically-correct PostgreSQL query.
| SELECT Shop_Name FROM shop ORDER BY Open_Year ASC |
Return the names of shops, ordered by year of opening ascending. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 shops, ordered by year of opening ascending.` to a syntactically-correct PostgreSQL query.
| SELECT Shop_Name FROM shop ORDER BY Open_Year ASC |
What is the average quantity of stocks? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 average quantity of stocks?` to a syntactically-correct PostgreSQL query.
| SELECT avg(Quantity) FROM stock |
Give the average quantity of stocks. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 average quantity of stocks.` to a syntactically-correct PostgreSQL query.
| SELECT avg(Quantity) FROM stock |
What are the names and location of the shops in ascending alphabetical order of name. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 and location of the shops in ascending alphabetical order of name.` to a syntactically-correct PostgreSQL query.
| SELECT Shop_Name , LOCATION FROM shop ORDER BY Shop_Name ASC |
Return the names and locations of shops, ordered by name in alphabetical order. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 and locations of shops, ordered by name in alphabetical order.` to a syntactically-correct PostgreSQL query.
| SELECT Shop_Name , LOCATION FROM shop ORDER BY Shop_Name ASC |
How many different software platforms are there for devices? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 different software platforms are there for devices?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT Software_Platform) FROM device |
Count the number of different software platforms. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 software platforms.` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT Software_Platform) FROM device |
List the open date of open year of the shop named "Apple". |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 open date of open year of the shop named "Apple".` to a syntactically-correct PostgreSQL query.
| SELECT Open_Date , Open_Year FROM shop WHERE Shop_Name = "Apple" |
What are the open dates and years for the shop named Apple? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 open dates and years for the shop named Apple?` to a syntactically-correct PostgreSQL query.
| SELECT Open_Date , Open_Year FROM shop WHERE Shop_Name = "Apple" |
List the name of the shop with the latest open year. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 name of the shop with the latest open year.` to a syntactically-correct PostgreSQL query.
| SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1 |
What is the shop name corresponding to the shop that opened in the most recent year? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 shop name corresponding to the shop that opened in the most recent year?` to a syntactically-correct PostgreSQL query.
| SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1 |
Show names of shops and the carriers of devices they have in stock. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 shops and the carriers of devices they have in stock.` to a syntactically-correct PostgreSQL query.
| SELECT T3.Shop_Name , T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID |
What are the names of device shops, and what are the carriers that they carry devices in stock for? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 device shops, and what are the carriers that they carry devices in stock for?` to a syntactically-correct PostgreSQL query.
| SELECT T3.Shop_Name , T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID |
Show names of shops that have more than one kind of device in stock. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 shops that have more than one kind of device in stock.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1 |
What are the names of shops that have more than a single kind of device in stock? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 shops that have more than a single kind of device in stock?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1 |
Show the name of the shop that has the most kind of devices in stock. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 the shop that has the most kind of devices in stock.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1 |
What is the name of the shop that has the most different kinds of devices in stock? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 shop that has the most different kinds of devices in stock?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1 |
Show the name of the shop that have the largest quantity of devices in stock. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 the shop that have the largest quantity of devices in stock.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1 |
What is the name of the shop that has the greatest quantity of devices in stock? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 shop that has the greatest quantity of devices in stock?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1 |
Please show different software platforms and the corresponding number of devices using each. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 different software platforms and the corresponding number of devices using each.` to a syntactically-correct PostgreSQL query.
| SELECT Software_Platform , COUNT(*) FROM device GROUP BY Software_Platform |
What are the different software platforms for devices, and how many devices have each? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 software platforms for devices, and how many devices have each?` to a syntactically-correct PostgreSQL query.
| SELECT Software_Platform , COUNT(*) FROM device GROUP BY Software_Platform |
Please show the software platforms of devices in descending order of the count. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 software platforms of devices in descending order of the count.` to a syntactically-correct PostgreSQL query.
| SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC |
What are the different software platforms for devices, ordered by frequency descending? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 software platforms for devices, ordered by frequency descending?` to a syntactically-correct PostgreSQL query.
| SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC |
List the software platform shared by the greatest number of devices. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 software platform shared by the greatest number of devices.` to a syntactically-correct PostgreSQL query.
| SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1 |
What is the software platform that is most common amongst all devices? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 software platform that is most common amongst all devices?` to a syntactically-correct PostgreSQL query.
| SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1 |
List the names of shops that have no devices in stock. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 shops that have no devices in stock.` to a syntactically-correct PostgreSQL query.
| SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock) |
What are the names of shops that do not have any devices in stock? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 shops that do not have any devices in stock?` to a syntactically-correct PostgreSQL query.
| SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock) |
Show the locations shared by shops with open year later than 2012 and shops with open year before 2008. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 locations shared by shops with open year later than 2012 and shops with open year before 2008.` to a syntactically-correct PostgreSQL query.
| SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008 |
Which locations contains both shops that opened after the year 2012 and shops that opened before 2008? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 locations contains both shops that opened after the year 2012 and shops that opened before 2008?` to a syntactically-correct PostgreSQL query.
| SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008 |
List the carriers of devices that have no devices in stock. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 carriers of devices that have no devices in stock.` to a syntactically-correct PostgreSQL query.
| SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock) |
What are the carriers of devices that are not in stock anywhere? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 carriers of devices that are not in stock anywhere?` to a syntactically-correct PostgreSQL query.
| SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock) |
Show the carriers of devices in stock at more than one shop. |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 carriers of devices in stock at more than one shop.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1 |
What are the carriers of devices that are in stock in more than a single shop? |
-- Language PostgreSQL
-- Tables:
-- Table: device
columns : [['device id', 'number'], ['device', 'text'], ['carrier', 'text'], ['package version', 'text'], ['applications', 'text'], ['software platform', 'text']]
-- Table: shop
columns : [['shop id', 'number'], ['shop name', 'text'], ['location', 'text'], ['open date', 'text'], ['open year', 'number']]
-- Table: stock
columns : [['shop id', 'number'], ['device id', 'number'], ['quantity', '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 carriers of devices that are in stock in more than a single shop?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1 |
How many bookings do we have? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', '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 bookings do we have?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM BOOKINGS |
Count the total number of bookings made. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', '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 `Count the total number of bookings made.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM BOOKINGS |
List the order dates of all the bookings. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', '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 order dates of all the bookings.` to a syntactically-correct PostgreSQL query.
| SELECT Order_Date FROM BOOKINGS |
What is the order date of each booking? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', '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 order date of each booking?` to a syntactically-correct PostgreSQL query.
| SELECT Order_Date FROM BOOKINGS |
Show all the planned delivery dates and actual delivery dates of bookings. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', '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 the planned delivery dates and actual delivery dates of bookings.` to a syntactically-correct PostgreSQL query.
| SELECT Planned_Delivery_Date , Actual_Delivery_Date FROM BOOKINGS |
What are the planned delivery date and actual delivery date for each booking? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', '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 planned delivery date and actual delivery date for each booking?` to a syntactically-correct PostgreSQL query.
| SELECT Planned_Delivery_Date , Actual_Delivery_Date FROM BOOKINGS |
How many customers do we have? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', '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 customers do we have?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM CUSTOMERS |
Count the number of customers recorded. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', '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 `Count the number of customers recorded.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM CUSTOMERS |
What are the phone and email for customer Harold? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', '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 phone and email for customer Harold?` to a syntactically-correct PostgreSQL query.
| SELECT Customer_Phone , Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = "Harold" |
Find the phone number and email address of customer "Harold". |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', '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 `Find the phone number and email address of customer "Harold".` to a syntactically-correct PostgreSQL query.
| SELECT Customer_Phone , Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = "Harold" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.