input
stringlengths 667
7.62k
| output
stringlengths 41
600
| db_id
stringlengths 3
31
| query
stringlengths 18
577
| question
stringlengths 3
224
| schema
stringlengths 177
6.14k
| primary_keys
stringlengths 16
545
| foreign_keys
stringlengths 16
1.48k
|
---|---|---|---|---|---|---|---|
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students does each advisor have?</question>
[SQL]:
| <SQL_QUERY>SELECT advisor , count(*) FROM Student GROUP BY advisor</SQL_QUERY> | allergy_1 | SELECT advisor , count(*) FROM Student GROUP BY advisor | How many students does each advisor have? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which advisor has most number of students?</question>
[SQL]:
| <SQL_QUERY>SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | allergy_1 | SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1 | Which advisor has most number of students? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Give the advisor with the most students.</question>
[SQL]:
| <SQL_QUERY>SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | allergy_1 | SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1 | Give the advisor with the most students. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students have cat allergies?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Has_allergy WHERE Allergy = "Cat"</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Has_allergy WHERE Allergy = "Cat" | How many students have cat allergies? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students are affected by cat allergies?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Has_allergy WHERE Allergy = "Cat"</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Has_allergy WHERE Allergy = "Cat" | How many students are affected by cat allergies? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all student IDs who have at least two allergies.</question>
[SQL]:
| <SQL_QUERY>SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2</SQL_QUERY> | allergy_1 | SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2 | Show all student IDs who have at least two allergies. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the students ids of students who have more than one allergy?</question>
[SQL]:
| <SQL_QUERY>SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2</SQL_QUERY> | allergy_1 | SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2 | What are the students ids of students who have more than one allergy? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the student ids of students who don't have any allergies?</question>
[SQL]:
| <SQL_QUERY>SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy</SQL_QUERY> | allergy_1 | SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy | What are the student ids of students who don't have any allergies? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which students are unaffected by allergies?</question>
[SQL]:
| <SQL_QUERY>SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy</SQL_QUERY> | allergy_1 | SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy | Which students are unaffected by allergies? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many female students have milk or egg allergies?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk" OR T1.allergy = "Eggs"</SQL_QUERY> | allergy_1 | SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk" OR T1.allergy = "Eggs" | How many female students have milk or egg allergies? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students who are female are allergic to milk or eggs?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk" OR T1.allergy = "Eggs"</SQL_QUERY> | allergy_1 | SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk" OR T1.allergy = "Eggs" | How many students who are female are allergic to milk or eggs? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students have a food allergy?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food"</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" | How many students have a food allergy? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students are affected by food related allergies?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food"</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" | How many students are affected by food related allergies? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which allergy has most number of students affected?</question>
[SQL]:
| <SQL_QUERY>SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | allergy_1 | SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1 | Which allergy has most number of students affected? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which allergy is the most common?</question>
[SQL]:
| <SQL_QUERY>SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | allergy_1 | SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1 | Which allergy is the most common? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all allergies with number of students affected.</question>
[SQL]:
| <SQL_QUERY>SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy</SQL_QUERY> | allergy_1 | SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy | Show all allergies with number of students affected. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students have each different allergy?</question>
[SQL]:
| <SQL_QUERY>SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy</SQL_QUERY> | allergy_1 | SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy | How many students have each different allergy? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all allergy type with number of students affected.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype</SQL_QUERY> | allergy_1 | SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype | Show all allergy type with number of students affected. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students are affected by each allergy type?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype</SQL_QUERY> | allergy_1 | SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype | How many students are affected by each allergy type? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the last name and age of the student who has allergy to both milk and cat.</question>
[SQL]:
| <SQL_QUERY>SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat")</SQL_QUERY> | allergy_1 | SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") | Find the last name and age of the student who has allergy to both milk and cat. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the last names and ages of the students who are allergic to milk and cat?</question>
[SQL]:
| <SQL_QUERY>SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat")</SQL_QUERY> | allergy_1 | SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") | What are the last names and ages of the students who are allergic to milk and cat? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the allergies and their types that the student with first name Lisa has? And order the result by name of allergies.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" ORDER BY T1.Allergy</SQL_QUERY> | allergy_1 | SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" ORDER BY T1.Allergy | What are the allergies and their types that the student with first name Lisa has? And order the result by name of allergies. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the allergies the girl named Lisa has? And what are the types of them? Order the result by allergy names.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" ORDER BY T1.Allergy</SQL_QUERY> | allergy_1 | SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" ORDER BY T1.Allergy | What are the allergies the girl named Lisa has? And what are the types of them? Order the result by allergy names. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first name and gender of the student who has allergy to milk but not cat.</question>
[SQL]:
| <SQL_QUERY>SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat")</SQL_QUERY> | allergy_1 | SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") | Find the first name and gender of the student who has allergy to milk but not cat. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first name and gender of the students who have allergy to milk but can put up with cats?</question>
[SQL]:
| <SQL_QUERY>SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat")</SQL_QUERY> | allergy_1 | SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") | What are the first name and gender of the students who have allergy to milk but can put up with cats? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the average age of the students who have allergies with food and animal types.</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "animal")</SQL_QUERY> | allergy_1 | SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "animal") | Find the average age of the students who have allergies with food and animal types. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How old are the students with allergies to food and animal types on average?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "animal")</SQL_QUERY> | allergy_1 | SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "animal") | How old are the students with allergies to food and animal types on average? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the first and last name of the students who do not have any food type allergy.</question>
[SQL]:
| <SQL_QUERY>SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food")</SQL_QUERY> | allergy_1 | SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") | List the first and last name of the students who do not have any food type allergy. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the full name of each student who is not allergic to any type of food.</question>
[SQL]:
| <SQL_QUERY>SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food")</SQL_QUERY> | allergy_1 | SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") | What is the full name of each student who is not allergic to any type of food. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of male (sex is 'M') students who have some food type allery.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food")</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") | Find the number of male (sex is 'M') students who have some food type allery. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many male students (sex is 'M') are allergic to any type of food?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food")</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") | How many male students (sex is 'M') are allergic to any type of food? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the different first names and cities of the students who have allergy to milk or cat.</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat"</SQL_QUERY> | allergy_1 | SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat" | Find the different first names and cities of the students who have allergy to milk or cat. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the distinct first names and cities of the students who have allergy either to milk or to cat?</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat"</SQL_QUERY> | allergy_1 | SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat" | What are the distinct first names and cities of the students who have allergy either to milk or to cat? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of students who are older than 18 and do not have allergy to either food or animal.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" OR T2.allergytype = "animal")</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" OR T2.allergytype = "animal") | Find the number of students who are older than 18 and do not have allergy to either food or animal. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students are over 18 and do not have allergy to food type or animal type?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" OR T2.allergytype = "animal")</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" OR T2.allergytype = "animal") | How many students are over 18 and do not have allergy to food type or animal type? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first name and major of the students who are not allegry to soy.</question>
[SQL]:
| <SQL_QUERY>SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy")</SQL_QUERY> | allergy_1 | SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy") | Find the first name and major of the students who are not allegry to soy. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first name and major of the students who are able to consume soy?</question>
[SQL]:
| <SQL_QUERY>SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy")</SQL_QUERY> | allergy_1 | SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy") | What are the first name and major of the students who are able to consume soy? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>A list of the top 5 countries by number of invoices. List country name and number of invoices.</question>
[SQL]:
| <SQL_QUERY>SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5;</SQL_QUERY> | store_1 | SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5; | A list of the top 5 countries by number of invoices. List country name and number of invoices. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the top 5 countries by number of invoices and how many do they have?</question>
[SQL]:
| <SQL_QUERY>SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5;</SQL_QUERY> | store_1 | SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5; | What are the top 5 countries by number of invoices and how many do they have? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size.</question>
[SQL]:
| <SQL_QUERY>SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8;</SQL_QUERY> | store_1 | SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8; | A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the top 8 countries by total invoice size and what are those sizes?</question>
[SQL]:
| <SQL_QUERY>SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8;</SQL_QUERY> | store_1 | SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8; | What are the names of the top 8 countries by total invoice size and what are those sizes? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>A list of the top 10 countries by average invoice size. List country name and average invoice size.</question>
[SQL]:
| <SQL_QUERY>SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10;</SQL_QUERY> | store_1 | SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10; | A list of the top 10 countries by average invoice size. List country name and average invoice size. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the countries and average invoice size of the top countries by size?</question>
[SQL]:
| <SQL_QUERY>SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10;</SQL_QUERY> | store_1 | SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10; | What are the names of the countries and average invoice size of the top countries by size? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find out 5 customers who most recently purchased something. List customers' first and last name.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5;</SQL_QUERY> | store_1 | SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5; | Find out 5 customers who most recently purchased something. List customers' first and last name. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first and last names of the 5 customers who purchased something most recently?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5;</SQL_QUERY> | store_1 | SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5; | What are the first and last names of the 5 customers who purchased something most recently? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10;</SQL_QUERY> | store_1 | SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10; | Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the top 10 customers' first and last names by total number of orders and how many orders did they make?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10;</SQL_QUERY> | store_1 | SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10; | What are the top 10 customers' first and last names by total number of orders and how many orders did they make? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the top 10 customers by total gross sales. List customers' first and last name and total gross sales.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.first_name , T1.last_name , SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10;</SQL_QUERY> | store_1 | SELECT T1.first_name , T1.last_name , SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10; | List the top 10 customers by total gross sales. List customers' first and last name and total gross sales. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the top 10 customers' first and last names with the highest gross sales, and also what are the sales?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.first_name , T1.last_name , SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10;</SQL_QUERY> | store_1 | SELECT T1.first_name , T1.last_name , SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10; | What are the top 10 customers' first and last names with the highest gross sales, and also what are the sales? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the top 5 genres by number of tracks. List genres name and total tracks.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5;</SQL_QUERY> | store_1 | SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5; | List the top 5 genres by number of tracks. List genres name and total tracks. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many tracks does each genre have and what are the names of the top 5?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5;</SQL_QUERY> | store_1 | SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5; | How many tracks does each genre have and what are the names of the top 5? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List every album's title.</question>
[SQL]:
| <SQL_QUERY>SELECT title FROM albums;</SQL_QUERY> | store_1 | SELECT title FROM albums; | List every album's title. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the titles of all the albums?</question>
[SQL]:
| <SQL_QUERY>SELECT title FROM albums;</SQL_QUERY> | store_1 | SELECT title FROM albums; | What are the titles of all the albums? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List every album ordered by album title in ascending order.</question>
[SQL]:
| <SQL_QUERY>SELECT title FROM albums ORDER BY title;</SQL_QUERY> | store_1 | SELECT title FROM albums ORDER BY title; | List every album ordered by album title in ascending order. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the titles of all the albums alphabetically ascending?</question>
[SQL]:
| <SQL_QUERY>SELECT title FROM albums ORDER BY title;</SQL_QUERY> | store_1 | SELECT title FROM albums ORDER BY title; | What are the titles of all the albums alphabetically ascending? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List every album whose title starts with A in alphabetical order.</question>
[SQL]:
| <SQL_QUERY>SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title;</SQL_QUERY> | store_1 | SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title; | List every album whose title starts with A in alphabetical order. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the titles of all albums that start with A in alphabetical order?</question>
[SQL]:
| <SQL_QUERY>SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title;</SQL_QUERY> | store_1 | SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title; | What are the titles of all albums that start with A in alphabetical order? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the customers first and last name of 10 least expensive invoices.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10;</SQL_QUERY> | store_1 | SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10; | List the customers first and last name of 10 least expensive invoices. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first and last names of the customers with the 10 cheapest invoices?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10;</SQL_QUERY> | store_1 | SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10; | What are the first and last names of the customers with the 10 cheapest invoices? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List total amount of invoice from Chicago, IL.</question>
[SQL]:
| <SQL_QUERY>SELECT sum(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL";</SQL_QUERY> | store_1 | SELECT sum(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; | List total amount of invoice from Chicago, IL. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the total amount of money in the invoices billed from Chicago, Illinois?</question>
[SQL]:
| <SQL_QUERY>SELECT sum(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL";</SQL_QUERY> | store_1 | SELECT sum(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; | What are the total amount of money in the invoices billed from Chicago, Illinois? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the number of invoices from Chicago, IL.</question>
[SQL]:
| <SQL_QUERY>SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL";</SQL_QUERY> | store_1 | SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; | List the number of invoices from Chicago, IL. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many invoices were billed from Chicago, IL?</question>
[SQL]:
| <SQL_QUERY>SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL";</SQL_QUERY> | store_1 | SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; | How many invoices were billed from Chicago, IL? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the number of invoices from the US, grouped by state.</question>
[SQL]:
| <SQL_QUERY>SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state;</SQL_QUERY> | store_1 | SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state; | List the number of invoices from the US, grouped by state. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many invoices were billed from each state?</question>
[SQL]:
| <SQL_QUERY>SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state;</SQL_QUERY> | store_1 | SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state; | How many invoices were billed from each state? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the state in the US with the most invoices.</question>
[SQL]:
| <SQL_QUERY>SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1;</SQL_QUERY> | store_1 | SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1; | List the state in the US with the most invoices. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the states with the most invoices?</question>
[SQL]:
| <SQL_QUERY>SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1;</SQL_QUERY> | store_1 | SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1; | What are the states with the most invoices? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the number of invoices and the invoice total from California.</question>
[SQL]:
| <SQL_QUERY>SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = "CA";</SQL_QUERY> | store_1 | SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = "CA"; | List the number of invoices and the invoice total from California. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of invoices and total money billed in them from CA?</question>
[SQL]:
| <SQL_QUERY>SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = "CA";</SQL_QUERY> | store_1 | SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = "CA"; | What is the number of invoices and total money billed in them from CA? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List Aerosmith's albums.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith";</SQL_QUERY> | store_1 | SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith"; | List Aerosmith's albums. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the titles of all the Aerosmith albums?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith";</SQL_QUERY> | store_1 | SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith"; | What are the titles of all the Aerosmith albums? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many albums does Billy Cobham has?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham";</SQL_QUERY> | store_1 | SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham"; | How many albums does Billy Cobham has? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many albums has Billy Cobam released?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham";</SQL_QUERY> | store_1 | SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham"; | How many albums has Billy Cobam released? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Eduardo Martins is a customer at which company?</question>
[SQL]:
| <SQL_QUERY>SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins";</SQL_QUERY> | store_1 | SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"; | Eduardo Martins is a customer at which company? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the company where Eduardo Martins is a customer?</question>
[SQL]:
| <SQL_QUERY>SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins";</SQL_QUERY> | store_1 | SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"; | What is the company where Eduardo Martins is a customer? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is Astrid Gruber's email and phone number?</question>
[SQL]:
| <SQL_QUERY>SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber";</SQL_QUERY> | store_1 | SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber"; | What is Astrid Gruber's email and phone number? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the email and phone number of Astrid Gruber the customer?</question>
[SQL]:
| <SQL_QUERY>SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber";</SQL_QUERY> | store_1 | SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber"; | What is the email and phone number of Astrid Gruber the customer? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many customers live in Prague city?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM customers WHERE city = "Prague";</SQL_QUERY> | store_1 | SELECT count(*) FROM customers WHERE city = "Prague"; | How many customers live in Prague city? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many customers live in the city of Prague?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM customers WHERE city = "Prague";</SQL_QUERY> | store_1 | SELECT count(*) FROM customers WHERE city = "Prague"; | How many customers live in the city of Prague? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many customers in state of CA?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM customers WHERE state = "CA";</SQL_QUERY> | store_1 | SELECT count(*) FROM customers WHERE state = "CA"; | How many customers in state of CA? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many customers are from California?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM customers WHERE state = "CA";</SQL_QUERY> | store_1 | SELECT count(*) FROM customers WHERE state = "CA"; | How many customers are from California? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What country does Roberto Almeida live?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida";</SQL_QUERY> | store_1 | SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida"; | What country does Roberto Almeida live? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>In which country does Roberto Almeida?</question>
[SQL]:
| <SQL_QUERY>SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida";</SQL_QUERY> | store_1 | SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida"; | In which country does Roberto Almeida? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the name of albums that are released by aritist whose name has 'Led'</question>
[SQL]:
| <SQL_QUERY>SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'</SQL_QUERY> | store_1 | SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%' | List the name of albums that are released by aritist whose name has 'Led' | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the title of the album that was released by the artist whose name has the phrase 'Led'?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'</SQL_QUERY> | store_1 | SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%' | What is the title of the album that was released by the artist whose name has the phrase 'Led'? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many customers does Steve Johnson support?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson";</SQL_QUERY> | store_1 | SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson"; | How many customers does Steve Johnson support? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the count of customers that Steve Johnson supports?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson";</SQL_QUERY> | store_1 | SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson"; | What is the count of customers that Steve Johnson supports? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the title, phone and hire date of Nancy Edwards?</question>
[SQL]:
| <SQL_QUERY>SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";</SQL_QUERY> | store_1 | SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | What is the title, phone and hire date of Nancy Edwards? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the title, phone number and hire date for the employee named Nancy Edwards?</question>
[SQL]:
| <SQL_QUERY>SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";</SQL_QUERY> | store_1 | SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | What is the title, phone number and hire date for the employee named Nancy Edwards? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>find the full name of employees who report to Nancy Edwards?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards";</SQL_QUERY> | store_1 | SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards"; | find the full name of employees who report to Nancy Edwards? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the first and last name of the employee who reports to Nancy Edwards?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards";</SQL_QUERY> | store_1 | SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards"; | What is the first and last name of the employee who reports to Nancy Edwards? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the address of employee Nancy Edwards?</question>
[SQL]:
| <SQL_QUERY>SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";</SQL_QUERY> | store_1 | SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | What is the address of employee Nancy Edwards? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is Nancy Edwards's address?</question>
[SQL]:
| <SQL_QUERY>SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";</SQL_QUERY> | store_1 | SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | What is Nancy Edwards's address? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the full name of employee who supported the most number of customers.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | store_1 | SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1 | Find the full name of employee who supported the most number of customers. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the full name of the employee who has the most customers?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | store_1 | SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1 | What is the full name of the employee who has the most customers? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many employees are living in Canada?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM employees WHERE country = "Canada";</SQL_QUERY> | store_1 | SELECT count(*) FROM employees WHERE country = "Canada"; | How many employees are living in Canada? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many employees live in Canada?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM employees WHERE country = "Canada";</SQL_QUERY> | store_1 | SELECT count(*) FROM employees WHERE country = "Canada"; | How many employees live in Canada? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is employee Nancy Edwards's phone number?</question>
[SQL]:
| <SQL_QUERY>SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";</SQL_QUERY> | store_1 | SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | What is employee Nancy Edwards's phone number? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the the phone number of Nancy Edwards?</question>
[SQL]:
| <SQL_QUERY>SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";</SQL_QUERY> | store_1 | SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | What is the the phone number of Nancy Edwards? | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number);</schema>"
<primary_keys>[Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id</primary_keys>"
<foreign_keys>[Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who is the youngest employee in the company? List employee's first and last name.</question>
[SQL]:
| <SQL_QUERY>SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1;</SQL_QUERY> | store_1 | SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1; | Who is the youngest employee in the company? List employee's first and last name. | [Schema (values) (types)]: | store_1 | artists : id (text) , name (number) | sqlite_sequence : name (text) , seq (number) | albums : id (text) , title (number) , artist_id (text) | employees : id (text) , last_name (number) , first_name (text) , title (text) , reports_to (text) , birth_date (number) , hire_date (text) , address (number) , city (number) , state (text) , country (text) , postal_code (text) , phone (number) , fax (time) , email (time) | customers : id (text) , first_name (number) , last_name (text) , company (text) , address (text) , city (number) , state (text) , country (number) , postal_code (number) , phone (text) , fax (text) , email (text) , support_rep_id (number) | genres : id (text) , name (number) | invoices : id (text) , customer_id (number) , invoice_date (text) , billing_address (text) , billing_city (text) , billing_state (number) , billing_country (text) , billing_postal_code (number) , total (number) | media_types : id (text) , name (number) | tracks : id (text) , name (number) , album_id (text) , media_type_id (text) , genre_id (text) , composer (number) , milliseconds (text) , bytes (number) , unit_price (number) | invoice_lines : id (text) , invoice_id (number) , track_id (text) , unit_price (text) , quantity (text) | playlists : id (text) , name (number) | playlist_tracks : playlist_id (text) , track_id (number); | [Primary Keys]: artists : id, sqlite_sequence : id, albums : id, employees : id, customers : id, genres : id, invoices : id, media_types : id, tracks : id, invoice_lines : id, playlists : playlist_id | [Foreign Keys]: albums : artist_id = artists : id | employees : reports_to = employees : id | customers : support_rep_id = employees : id | invoices : customer_id = customers : id | tracks : media_type_id = media_types : id | tracks : genre_id = genres : id | tracks : album_id = albums : id | invoice_lines : track_id = tracks : id | invoice_lines : invoice_id = invoices : id | playlist_tracks : track_id = tracks : id | playlist_tracks : playlist_id = playlists : id |