db_id
stringclasses 146
values | question_en
stringlengths 3
224
| hardness
stringclasses 4
values | schema_llm
stringclasses 146
values | query_llm
stringlengths 18
631
| schema_llm_min
stringclasses 147
values | schema_dict
stringclasses 146
values | tables_and_columns
stringlengths 18
266
| schema_reduzido
stringlengths 25
718
| schema_reduzido_only_tables
stringlengths 80
2.27k
|
---|---|---|---|---|---|---|---|---|---|
allergy_1 | How many students does each advisor have? | medium | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT advisor , count(*) FROM Student GROUP BY advisor | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'advisor']
} | TABLE Student (
Student.StuID (INTEGER),
Student.Advisor (INTEGER),
)
Possible JOINs:
| TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
|
allergy_1 | Which advisor has most number of students? | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1 | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'advisor']
} | TABLE Student (
Student.StuID (INTEGER),
Student.Advisor (INTEGER),
)
Possible JOINs:
| TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
|
allergy_1 | Give the advisor with the most students. | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1 | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'advisor']
} | TABLE Student (
Student.StuID (INTEGER),
Student.Advisor (INTEGER),
)
Possible JOINs:
| TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
|
allergy_1 | How many students have cat allergies? | easy | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT count(*) FROM Has_allergy WHERE Allergy = "Cat" | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['allergy']
} | TABLE Has_Allergy (
Has_Allergy.Allergy (VARCHAR(20)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | How many students are affected by cat allergies? | easy | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT count(*) FROM Has_allergy WHERE Allergy = "Cat" | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['allergy']
} | TABLE Has_Allergy (
Has_Allergy.Allergy (VARCHAR(20)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Show all student IDs who have at least two allergies. | easy | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2 | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['stuid']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | What are the students ids of students who have more than one allergy? | easy | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2 | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['stuid']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | What are the student ids of students who don't have any allergies? | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid'],
'has_allergy': ['stuid']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
)
TABLE Student (
Student.StuID (INTEGER),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Which students are unaffected by allergies? | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid'],
'has_allergy': ['stuid']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
)
TABLE Student (
Student.StuID (INTEGER),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | How many female students have milk or egg allergies? | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT count(*) FROM has_allergy JOIN Student ON has_allergy.StuID = Student.StuID WHERE Student.sex = "F" AND has_allergy.allergy = "Milk" OR has_allergy.allergy = "Eggs" | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'sex']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Sex (VARCHAR(1)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | How many students who are female are allergic to milk or eggs? | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT count(*) FROM has_allergy JOIN Student ON has_allergy.StuID = Student.StuID WHERE Student.sex = "F" AND has_allergy.allergy = "Milk" OR has_allergy.allergy = "Eggs" | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'sex']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Sex (VARCHAR(1)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | How many students have a food allergy? | medium | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT count(*) FROM Has_allergy JOIN Allergy_type ON Has_allergy.allergy = Allergy_type.allergy WHERE Allergy_type.allergytype = "food" | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.Allergy (VARCHAR(20)),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | How many students are affected by food related allergies? | medium | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT count(*) FROM Has_allergy JOIN Allergy_type ON Has_allergy.allergy = Allergy_type.allergy WHERE Allergy_type.allergytype = "food" | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.Allergy (VARCHAR(20)),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Which allergy has most number of students affected? | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1 | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['allergy']
} | TABLE Has_Allergy (
Has_Allergy.Allergy (VARCHAR(20)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Which allergy is the most common? | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1 | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['allergy']
} | TABLE Has_Allergy (
Has_Allergy.Allergy (VARCHAR(20)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Show all allergies with number of students affected. | medium | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['allergy']
} | TABLE Has_Allergy (
Has_Allergy.Allergy (VARCHAR(20)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | How many students have each different allergy? | medium | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['allergy']
} | TABLE Has_Allergy (
Has_Allergy.Allergy (VARCHAR(20)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Show all allergy type with number of students affected. | medium | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT Allergy_type.allergytype , count(*) FROM Has_allergy JOIN Allergy_type ON Has_allergy.allergy = Allergy_type.allergy GROUP BY Allergy_type.allergytype | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.Allergy (VARCHAR(20)),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | How many students are affected by each allergy type? | medium | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT Allergy_type.allergytype , count(*) FROM Has_allergy JOIN Allergy_type ON Has_allergy.allergy = Allergy_type.allergy GROUP BY Allergy_type.allergytype | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'has_allergy': ['allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.Allergy (VARCHAR(20)),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Find the last name and age of the student who has allergy to both milk and cat. | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| 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") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'lname', 'age'],
'has_allergy': ['stuid', 'allergy']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Age (INTEGER),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | What are the last names and ages of the students who are allergic to milk and cat? | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| 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") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'lname', 'age'],
'has_allergy': ['stuid', 'allergy']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Age (INTEGER),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | What are the allergies and their types that the student with first name Lisa has? And order the result by name of allergies. | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT Allergy_type.Allergy , Allergy_type.AllergyType FROM Allergy_type JOIN Has_allergy ON Allergy_type.Allergy = Has_allergy.Allergy JOIN Student ON Student.StuID = Has_allergy.StuID WHERE Student.Fname = "Lisa" ORDER BY Allergy_type.Allergy | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'fname']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Fname (VARCHAR(12)),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | What are the allergies the girl named Lisa has? And what are the types of them? Order the result by allergy names. | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT Allergy_type.Allergy , Allergy_type.AllergyType FROM Allergy_type JOIN Has_allergy ON Allergy_type.Allergy = Has_allergy.Allergy JOIN Student ON Student.StuID = Has_allergy.StuID WHERE Student.Fname = "Lisa" ORDER BY Allergy_type.Allergy | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'fname']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Fname (VARCHAR(12)),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Find the first name and gender of the student who has allergy to milk but not cat. | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| 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") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'fname', 'sex'],
'has_allergy': ['stuid', 'allergy']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Fname (VARCHAR(12)),
Student.Sex (VARCHAR(1)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | What are the first name and gender of the students who have allergy to milk but can put up with cats? | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| 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") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'fname', 'sex'],
'has_allergy': ['stuid', 'allergy']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Fname (VARCHAR(12)),
Student.Sex (VARCHAR(1)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Find the average age of the students who have allergies with food and animal types. | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT avg(age) FROM Student WHERE StuID IN ( SELECT Has_allergy.StuID FROM Has_allergy JOIN Allergy_Type ON Has_allergy.Allergy = Allergy_Type.Allergy WHERE Allergy_Type.allergytype = "food" INTERSECT SELECT Has_allergy.StuID FROM Has_allergy JOIN Allergy_Type ON Has_allergy.Allergy = Allergy_Type.Allergy WHERE Allergy_Type.allergytype = "animal") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'age'],
'has_allergy': ['stuid', 'allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Age (INTEGER),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | How old are the students with allergies to food and animal types on average? | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT avg(age) FROM Student WHERE StuID IN ( SELECT Has_allergy.StuID FROM Has_allergy JOIN Allergy_Type ON Has_allergy.Allergy = Allergy_Type.Allergy WHERE Allergy_Type.allergytype = "food" INTERSECT SELECT Has_allergy.StuID FROM Has_allergy JOIN Allergy_Type ON Has_allergy.Allergy = Allergy_Type.Allergy WHERE Allergy_Type.allergytype = "animal") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'age'],
'has_allergy': ['stuid', 'allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Age (INTEGER),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | List the first and last name of the students who do not have any food type allergy. | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT Has_allergy.StuID FROM Has_allergy JOIN Allergy_Type ON Has_allergy.Allergy = Allergy_Type.Allergy WHERE Allergy_Type.allergytype = "food") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'lname', 'fname'],
'has_allergy': ['stuid', 'allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | What is the full name of each student who is not allergic to any type of food. | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT Has_allergy.StuID FROM Has_allergy JOIN Allergy_Type ON Has_allergy.Allergy = Allergy_Type.Allergy WHERE Allergy_Type.allergytype = "food") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'lname', 'fname'],
'has_allergy': ['stuid', 'allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Find the number of male (sex is 'M') students who have some food type allery. | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy JOIN Allergy_Type ON Has_allergy.Allergy = Allergy_Type.Allergy WHERE Allergy_Type.allergytype = "food") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'sex'],
'has_allergy': ['stuid', 'allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Sex (VARCHAR(1)),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | How many male students (sex is 'M') are allergic to any type of food? | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy JOIN Allergy_Type ON Has_allergy.Allergy = Allergy_Type.Allergy WHERE Allergy_Type.allergytype = "food") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'sex'],
'has_allergy': ['stuid', 'allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Sex (VARCHAR(1)),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Find the different first names and cities of the students who have allergy to milk or cat. | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT DISTINCT Student.fname , Student.city_code FROM Student JOIN Has_Allergy ON Student.stuid = Has_Allergy.stuid WHERE Has_Allergy.Allergy = "Milk" OR Has_Allergy.Allergy = "Cat" | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'fname', 'city_code'],
'has_allergy': ['stuid', 'allergy']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Fname (VARCHAR(12)),
Student.city_code (VARCHAR(3)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | What are the distinct first names and cities of the students who have allergy either to milk or to cat? | hard | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT DISTINCT Student.fname , Student.city_code FROM Student JOIN Has_Allergy ON Student.stuid = Has_Allergy.stuid WHERE Has_Allergy.Allergy = "Milk" OR Has_Allergy.Allergy = "Cat" | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'fname', 'city_code'],
'has_allergy': ['stuid', 'allergy']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Fname (VARCHAR(12)),
Student.city_code (VARCHAR(3)),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Find the number of students who are older than 18 and do not have allergy to either food or animal. | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy JOIN Allergy_Type ON Has_allergy.Allergy = Allergy_Type.Allergy WHERE Allergy_Type.allergytype = "food" OR Allergy_Type.allergytype = "animal") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'age'],
'has_allergy': ['stuid', 'allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Age (INTEGER),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | How many students are over 18 and do not have allergy to food type or animal type? | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy JOIN Allergy_Type ON Has_allergy.Allergy = Allergy_Type.Allergy WHERE Allergy_Type.allergytype = "food" OR Allergy_Type.allergytype = "animal") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'age'],
'has_allergy': ['stuid', 'allergy'],
'allergy_type': ['allergy', 'allergytype']
} | TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Age (INTEGER),
)
| TABLE Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | Find the first name and major of the students who are not allegry to soy. | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'fname', 'major'],
'has_allergy': ['stuid', 'allergy']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Fname (VARCHAR(12)),
Student.Major (INTEGER),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
allergy_1 | What are the first name and major of the students who are able to consume soy? | extra | Table Allergy_Type (
Allergy_Type.Allergy (VARCHAR(20)),
Allergy_Type.AllergyType (VARCHAR(20)),
)
Table Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
Table Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
| SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy") | Table allergy_type (
allergy_type.allergy (VARCHAR(20)),
allergy_type.allergytype (VARCHAR(20)),
)
Table has_allergy (
has_allergy.stuid (INTEGER),
has_allergy.allergy (VARCHAR(20)),
)
Table student (
student.stuid (INTEGER),
student.lname (VARCHAR(12)),
student.fname (VARCHAR(12)),
student.age (INTEGER),
student.sex (VARCHAR(1)),
student.major (INTEGER),
student.advisor (INTEGER),
student.city_code (VARCHAR(3)),
)
Possible JOINs:
has_allergy.stuid = student.stuid
has_allergy.allergy = allergy_type.allergy
| {
'allergy_type': ['allergy', 'allergytype'],
'has_allergy': ['stuid', 'allergy'],
'student': ['stuid', 'lname', 'fname', 'age', 'sex', 'major', 'advisor', 'city_code']
} | {
'student': ['stuid', 'fname', 'major'],
'has_allergy': ['stuid', 'allergy']
} | TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.Fname (VARCHAR(12)),
Student.Major (INTEGER),
)
| TABLE Has_Allergy (
Has_Allergy.StuID (INTEGER),
Has_Allergy.Allergy (VARCHAR(20)),
)
TABLE Student (
Student.StuID (INTEGER),
Student.LName (VARCHAR(12)),
Student.Fname (VARCHAR(12)),
Student.Age (INTEGER),
Student.Sex (VARCHAR(1)),
Student.Major (INTEGER),
Student.Advisor (INTEGER),
Student.city_code (VARCHAR(3)),
)
Possible JOINs:
Has_Allergy.StuID = Student.StuID
Has_Allergy.Allergy = Allergy_Type.Allergy
|
store_1 | A list of the top 5 countries by number of invoices. List country name and number of invoices. | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_country']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_country (VARCHAR(40)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | What are the top 5 countries by number of invoices and how many do they have? | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_country']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_country (VARCHAR(40)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size. | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_country', 'total']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_country (VARCHAR(40)),
invoices.total (NUMERIC(10,2)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | What are the names of the top 8 countries by total invoice size and what are those sizes? | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_country', 'total']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_country (VARCHAR(40)),
invoices.total (NUMERIC(10,2)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | A list of the top 10 countries by average invoice size. List country name and average invoice size. | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_country', 'total']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_country (VARCHAR(40)),
invoices.total (NUMERIC(10,2)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | What are the names of the countries and average invoice size of the top countries by size? | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_country', 'total']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_country (VARCHAR(40)),
invoices.total (NUMERIC(10,2)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | Find out 5 customers who most recently purchased something. List customers' first and last name. | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT customers.first_name , customers.last_name FROM customers JOIN invoices ON invoices.customer_id = customers.id ORDER BY invoices.invoice_date DESC LIMIT 5; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name'],
'invoices': ['id', 'customer_id', 'invoice_date']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
)
Possible JOINs:
invoices.customer_id = customers.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
customers.support_rep_id = employees.id
invoices.customer_id = customers.id
|
store_1 | What are the first and last names of the 5 customers who purchased something most recently? | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT customers.first_name , customers.last_name FROM customers JOIN invoices ON invoices.customer_id = customers.id ORDER BY invoices.invoice_date DESC LIMIT 5; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name'],
'invoices': ['id', 'customer_id', 'invoice_date']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
)
Possible JOINs:
invoices.customer_id = customers.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
customers.support_rep_id = employees.id
invoices.customer_id = customers.id
|
store_1 | Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders. | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT customers.first_name , customers.last_name , COUNT(*) FROM customers JOIN invoices ON invoices.customer_id = customers.id GROUP BY customers.id ORDER BY COUNT(*) DESC LIMIT 10; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name'],
'invoices': ['id', 'customer_id']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
)
Possible JOINs:
invoices.customer_id = customers.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
customers.support_rep_id = employees.id
invoices.customer_id = customers.id
|
store_1 | What are the top 10 customers' first and last names by total number of orders and how many orders did they make? | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT customers.first_name , customers.last_name , COUNT(*) FROM customers JOIN invoices ON invoices.customer_id = customers.id GROUP BY customers.id ORDER BY COUNT(*) DESC LIMIT 10; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name'],
'invoices': ['id', 'customer_id']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
)
Possible JOINs:
invoices.customer_id = customers.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
customers.support_rep_id = employees.id
invoices.customer_id = customers.id
|
store_1 | List the top 10 customers by total gross sales. List customers' first and last name and total gross sales. | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT customers.first_name , customers.last_name , SUM(invoices.total) FROM customers JOIN invoices ON invoices.customer_id = customers.id GROUP BY customers.id ORDER BY SUM(invoices.total) DESC LIMIT 10; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name'],
'invoices': ['id', 'customer_id', 'total']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
customers.support_rep_id = employees.id
invoices.customer_id = customers.id
|
store_1 | What are the top 10 customers' first and last names with the highest gross sales, and also what are the sales? | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT customers.first_name , customers.last_name , SUM(invoices.total) FROM customers JOIN invoices ON invoices.customer_id = customers.id GROUP BY customers.id ORDER BY SUM(invoices.total) DESC LIMIT 10; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name'],
'invoices': ['id', 'customer_id', 'total']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
customers.support_rep_id = employees.id
invoices.customer_id = customers.id
|
store_1 | List the top 5 genres by number of tracks. List genres name and total tracks. | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT genres.name , COUNT(*) FROM genres JOIN tracks ON tracks.genre_id = genres.id GROUP BY genres.id ORDER BY count(*) DESC LIMIT 5; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'genres': ['id', 'name'],
'tracks': ['id', 'genre_id']
} | TABLE genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
TABLE tracks (
tracks.id (INTEGER),
tracks.genre_id (INTEGER),
)
Possible JOINs:
tracks.genre_id = genres.id
| TABLE genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
TABLE tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
|
store_1 | How many tracks does each genre have and what are the names of the top 5? | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT genres.name , COUNT(*) FROM genres JOIN tracks ON tracks.genre_id = genres.id GROUP BY genres.id ORDER BY count(*) DESC LIMIT 5; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'genres': ['id', 'name'],
'tracks': ['id', 'genre_id']
} | TABLE genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
TABLE tracks (
tracks.id (INTEGER),
tracks.genre_id (INTEGER),
)
Possible JOINs:
tracks.genre_id = genres.id
| TABLE genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
TABLE tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
|
store_1 | List every album's title. | easy | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT title FROM albums; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'albums': ['id', 'title']
} | TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
)
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | What are the titles of all the albums? | easy | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT title FROM albums; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'albums': ['id', 'title']
} | TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
)
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | List every album ordered by album title in ascending order. | easy | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT title FROM albums ORDER BY title; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'albums': ['id', 'title']
} | TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
)
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | What are the titles of all the albums alphabetically ascending? | easy | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT title FROM albums ORDER BY title; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'albums': ['id', 'title']
} | TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
)
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | List every album whose title starts with A in alphabetical order. | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'albums': ['id', 'title']
} | TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
)
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | What are the titles of all albums that start with A in alphabetical order? | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'albums': ['id', 'title']
} | TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
)
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | List the customers first and last name of 10 least expensive invoices. | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT customers.first_name , customers.last_name FROM customers JOIN invoices ON invoices.customer_id = customers.id ORDER BY total LIMIT 10; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name'],
'invoices': ['id', 'customer_id', 'total']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
customers.support_rep_id = employees.id
invoices.customer_id = customers.id
|
store_1 | What are the first and last names of the customers with the 10 cheapest invoices? | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT customers.first_name , customers.last_name FROM customers JOIN invoices ON invoices.customer_id = customers.id ORDER BY total LIMIT 10; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name'],
'invoices': ['id', 'customer_id', 'total']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
customers.support_rep_id = employees.id
invoices.customer_id = customers.id
|
store_1 | List total amount of invoice from Chicago, IL. | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT sum(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_city', 'billing_state', 'total']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.total (NUMERIC(10,2)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | What are the total amount of money in the invoices billed from Chicago, Illinois? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT sum(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_city', 'billing_state', 'total']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.total (NUMERIC(10,2)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | List the number of invoices from Chicago, IL. | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_city', 'billing_state']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | How many invoices were billed from Chicago, IL? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_city', 'billing_state']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | List the number of invoices from the US, grouped by state. | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_state', 'billing_country']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | How many invoices were billed from each state? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_state', 'billing_country']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | List the state in the US with the most invoices. | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_state', 'billing_country']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | What are the states with the most invoices? | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_state', 'billing_country']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | List the number of invoices and the invoice total from California. | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = "CA"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_state', 'total']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_state (VARCHAR(40)),
invoices.total (NUMERIC(10,2)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | What is the number of invoices and total money billed in them from CA? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = "CA"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'invoices': ['id', 'billing_state', 'total']
} | TABLE invoices (
invoices.id (INTEGER),
invoices.billing_state (VARCHAR(40)),
invoices.total (NUMERIC(10,2)),
)
| TABLE invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Possible JOINs:
invoices.customer_id = customers.id
|
store_1 | List Aerosmith's albums. | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT albums.title FROM albums JOIN artists ON albums.artist_id = artists.id WHERE artists.name = "Aerosmith"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'albums': ['id', 'title', 'artist_id'],
'artists': ['id', 'name']
} | TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | What are the titles of all the Aerosmith albums? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT albums.title FROM albums JOIN artists ON albums.artist_id = artists.id WHERE artists.name = "Aerosmith"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'albums': ['id', 'title', 'artist_id'],
'artists': ['id', 'name']
} | TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | How many albums does Billy Cobham has? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT count(*) FROM albums JOIN artists ON albums.artist_id = artists.id WHERE artists.name = "Billy Cobham"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'albums': ['id', 'artist_id'],
'artists': ['id', 'name']
} | TABLE albums (
albums.id (INTEGER),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | How many albums has Billy Cobam released? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT count(*) FROM albums JOIN artists ON albums.artist_id = artists.id WHERE artists.name = "Billy Cobham"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'albums': ['id', 'artist_id'],
'artists': ['id', 'name']
} | TABLE albums (
albums.id (INTEGER),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | Eduardo Martins is a customer at which company? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name', 'company']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
)
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Possible JOINs:
customers.support_rep_id = employees.id
|
store_1 | What is the company where Eduardo Martins is a customer? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name', 'company']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
)
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Possible JOINs:
customers.support_rep_id = employees.id
|
store_1 | What is Astrid Gruber's email and phone number? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name', 'phone', 'email']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.phone (VARCHAR(24)),
customers.email (VARCHAR(60)),
)
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Possible JOINs:
customers.support_rep_id = employees.id
|
store_1 | What is the email and phone number of Astrid Gruber the customer? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name', 'phone', 'email']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.phone (VARCHAR(24)),
customers.email (VARCHAR(60)),
)
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Possible JOINs:
customers.support_rep_id = employees.id
|
store_1 | How many customers live in Prague city? | easy | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT count(*) FROM customers WHERE city = "Prague"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'city']
} | TABLE customers (
customers.id (INTEGER),
customers.city (VARCHAR(40)),
)
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Possible JOINs:
customers.support_rep_id = employees.id
|
store_1 | How many customers live in the city of Prague? | easy | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT count(*) FROM customers WHERE city = "Prague"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'city']
} | TABLE customers (
customers.id (INTEGER),
customers.city (VARCHAR(40)),
)
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Possible JOINs:
customers.support_rep_id = employees.id
|
store_1 | How many customers in state of CA? | easy | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT count(*) FROM customers WHERE state = "CA"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'state']
} | TABLE customers (
customers.id (INTEGER),
customers.state (VARCHAR(40)),
)
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Possible JOINs:
customers.support_rep_id = employees.id
|
store_1 | How many customers are from California? | easy | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT count(*) FROM customers WHERE state = "CA"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'state']
} | TABLE customers (
customers.id (INTEGER),
customers.state (VARCHAR(40)),
)
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Possible JOINs:
customers.support_rep_id = employees.id
|
store_1 | What country does Roberto Almeida live? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name', 'country']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.country (VARCHAR(40)),
)
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Possible JOINs:
customers.support_rep_id = employees.id
|
store_1 | In which country does Roberto Almeida? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'customers': ['id', 'first_name', 'last_name', 'country']
} | TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.country (VARCHAR(40)),
)
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Possible JOINs:
customers.support_rep_id = employees.id
|
store_1 | List the name of albums that are released by aritist whose name has 'Led' | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT albums.title FROM artists JOIN albums ON artists.id = albums.artist_id WHERE artists.name LIKE '%Led%' | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'artists': ['id', 'name'],
'albums': ['id', 'title', 'artist_id']
} | TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | What is the title of the album that was released by the artist whose name has the phrase 'Led'? | hard | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT albums.title FROM artists JOIN albums ON artists.id = albums.artist_id WHERE artists.name LIKE '%Led%' | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'artists': ['id', 'name'],
'albums': ['id', 'title', 'artist_id']
} | TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
| TABLE albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
TABLE artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Possible JOINs:
albums.artist_id = artists.id
|
store_1 | How many customers does Steve Johnson support? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT count(*) FROM employees JOIN customers ON customers.support_rep_id = employees.id WHERE employees.first_name = "Steve" AND employees.last_name = "Johnson"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name'],
'customers': ['id', 'support_rep_id']
} | TABLE customers (
customers.id (INTEGER),
customers.support_rep_id (INTEGER),
)
TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
)
Possible JOINs:
customers.support_rep_id = employees.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
customers.support_rep_id = employees.id
employees.reports_to = employees.id
|
store_1 | What is the count of customers that Steve Johnson supports? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT count(*) FROM employees JOIN customers ON customers.support_rep_id = employees.id WHERE employees.first_name = "Steve" AND employees.last_name = "Johnson"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name'],
'customers': ['id', 'support_rep_id']
} | TABLE customers (
customers.id (INTEGER),
customers.support_rep_id (INTEGER),
)
TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
)
Possible JOINs:
customers.support_rep_id = employees.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
customers.support_rep_id = employees.id
employees.reports_to = employees.id
|
store_1 | What is the title, phone and hire date of Nancy Edwards? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name', 'title', 'hire_date', 'phone']
} | TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.hire_date (TIMESTAMP),
employees.phone (VARCHAR(24)),
)
| TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
employees.reports_to = employees.id
|
store_1 | What is the title, phone number and hire date for the employee named Nancy Edwards? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name', 'title', 'hire_date', 'phone']
} | TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.hire_date (TIMESTAMP),
employees.phone (VARCHAR(24)),
)
| TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
employees.reports_to = employees.id
|
store_1 | find the full name of employees who report to Nancy Edwards? | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT employees.first_name , employees.last_name FROM employees JOIN employees ON employees.id = employees.reports_to WHERE employees.first_name = "Nancy" AND employees.last_name = "Edwards"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name', 'reports_to']
} | TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.reports_to (INTEGER),
)
Possible JOINs:
employees.reports_to = employees.id
| TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
employees.reports_to = employees.id
|
store_1 | What is the first and last name of the employee who reports to Nancy Edwards? | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT employees.first_name , employees.last_name FROM employees JOIN employees ON employees.id = employees.reports_to WHERE employees.first_name = "Nancy" AND employees.last_name = "Edwards"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name', 'reports_to']
} | TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.reports_to (INTEGER),
)
Possible JOINs:
employees.reports_to = employees.id
| TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
employees.reports_to = employees.id
|
store_1 | What is the address of employee Nancy Edwards? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name', 'address']
} | TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.address (VARCHAR(70)),
)
| TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
employees.reports_to = employees.id
|
store_1 | What is Nancy Edwards's address? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name', 'address']
} | TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.address (VARCHAR(70)),
)
| TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
employees.reports_to = employees.id
|
store_1 | Find the full name of employee who supported the most number of customers. | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT employees.first_name , employees.last_name FROM employees JOIN customers ON employees.id = customers.support_rep_id GROUP BY employees.id ORDER BY count(*) DESC LIMIT 1 | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name'],
'customers': ['id', 'support_rep_id']
} | TABLE customers (
customers.id (INTEGER),
customers.support_rep_id (INTEGER),
)
TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
)
Possible JOINs:
customers.support_rep_id = employees.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
customers.support_rep_id = employees.id
employees.reports_to = employees.id
|
store_1 | What is the full name of the employee who has the most customers? | extra | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT employees.first_name , employees.last_name FROM employees JOIN customers ON employees.id = customers.support_rep_id GROUP BY employees.id ORDER BY count(*) DESC LIMIT 1 | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name'],
'customers': ['id', 'support_rep_id']
} | TABLE customers (
customers.id (INTEGER),
customers.support_rep_id (INTEGER),
)
TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
)
Possible JOINs:
customers.support_rep_id = employees.id
| TABLE customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
customers.support_rep_id = employees.id
employees.reports_to = employees.id
|
store_1 | How many employees are living in Canada? | easy | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT count(*) FROM employees WHERE country = "Canada"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'country']
} | TABLE employees (
employees.id (INTEGER),
employees.country (VARCHAR(40)),
)
| TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
employees.reports_to = employees.id
|
store_1 | How many employees live in Canada? | easy | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT count(*) FROM employees WHERE country = "Canada"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'country']
} | TABLE employees (
employees.id (INTEGER),
employees.country (VARCHAR(40)),
)
| TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
employees.reports_to = employees.id
|
store_1 | What is employee Nancy Edwards's phone number? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name', 'phone']
} | TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.phone (VARCHAR(24)),
)
| TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
employees.reports_to = employees.id
|
store_1 | What is the the phone number of Nancy Edwards? | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name', 'phone']
} | TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.phone (VARCHAR(24)),
)
| TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
employees.reports_to = employees.id
|
store_1 | Who is the youngest employee in the company? List employee's first and last name. | medium | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1; | Table albums (
albums.id (INTEGER),
albums.title (VARCHAR(160)),
albums.artist_id (INTEGER),
)
Table artists (
artists.id (INTEGER),
artists.name (VARCHAR(120)),
)
Table customers (
customers.id (INTEGER),
customers.first_name (VARCHAR(40)),
customers.last_name (VARCHAR(20)),
customers.company (VARCHAR(80)),
customers.address (VARCHAR(70)),
customers.city (VARCHAR(40)),
customers.state (VARCHAR(40)),
customers.country (VARCHAR(40)),
customers.postal_code (VARCHAR(10)),
customers.phone (VARCHAR(24)),
customers.fax (VARCHAR(24)),
customers.email (VARCHAR(60)),
customers.support_rep_id (INTEGER),
)
Table employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Table genres (
genres.id (INTEGER),
genres.name (VARCHAR(120)),
)
Table invoice_lines (
invoice_lines.id (INTEGER),
invoice_lines.invoice_id (INTEGER),
invoice_lines.track_id (INTEGER),
invoice_lines.unit_price (NUMERIC(10,2)),
invoice_lines.quantity (INTEGER),
)
Table invoices (
invoices.id (INTEGER),
invoices.customer_id (INTEGER),
invoices.invoice_date (TIMESTAMP),
invoices.billing_address (VARCHAR(70)),
invoices.billing_city (VARCHAR(40)),
invoices.billing_state (VARCHAR(40)),
invoices.billing_country (VARCHAR(40)),
invoices.billing_postal_code (VARCHAR(10)),
invoices.total (NUMERIC(10,2)),
)
Table media_types (
media_types.id (INTEGER),
media_types.name (VARCHAR(120)),
)
Table playlist_tracks (
playlist_tracks.playlist_id (INTEGER),
playlist_tracks.track_id (INTEGER),
)
Table playlists (
playlists.id (INTEGER),
playlists.name (VARCHAR(120)),
)
Table tracks (
tracks.id (INTEGER),
tracks.name (VARCHAR(200)),
tracks.album_id (INTEGER),
tracks.media_type_id (INTEGER),
tracks.genre_id (INTEGER),
tracks.composer (VARCHAR(220)),
tracks.milliseconds (INTEGER),
tracks.bytes (INTEGER),
tracks.unit_price (NUMERIC(10,2)),
)
Possible JOINs:
albums.artist_id = artists.id
customers.support_rep_id = employees.id
employees.reports_to = employees.id
invoice_lines.invoice_id = invoices.id
invoice_lines.track_id = tracks.id
invoices.customer_id = customers.id
playlist_tracks.playlist_id = playlists.id
playlist_tracks.track_id = tracks.id
tracks.album_id = albums.id
tracks.media_type_id = media_types.id
tracks.genre_id = genres.id
| {
'artists': ['id', 'name'],
'sqlite_sequence': ['name', 'seq'],
'albums': ['id', 'title', 'artist_id'],
'employees': ['id', 'last_name', 'first_name', 'title', 'reports_to', 'birth_date', 'hire_date', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email'],
'customers': ['id', 'first_name', 'last_name', 'company', 'address', 'city', 'state', 'country', 'postal_code', 'phone', 'fax', 'email', 'support_rep_id'],
'genres': ['id', 'name'],
'invoices': ['id', 'customer_id', 'invoice_date', 'billing_address', 'billing_city', 'billing_state', 'billing_country', 'billing_postal_code', 'total'],
'media_types': ['id', 'name'],
'tracks': ['id', 'name', 'album_id', 'media_type_id', 'genre_id', 'composer', 'milliseconds', 'bytes', 'unit_price'],
'invoice_lines': ['id', 'invoice_id', 'track_id', 'unit_price', 'quantity'],
'playlists': ['id', 'name'],
'playlist_tracks': ['playlist_id', 'track_id']
} | {
'employees': ['id', 'last_name', 'first_name', 'birth_date']
} | TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.birth_date (TIMESTAMP),
)
| TABLE employees (
employees.id (INTEGER),
employees.last_name (VARCHAR(20)),
employees.first_name (VARCHAR(20)),
employees.title (VARCHAR(30)),
employees.reports_to (INTEGER),
employees.birth_date (TIMESTAMP),
employees.hire_date (TIMESTAMP),
employees.address (VARCHAR(70)),
employees.city (VARCHAR(40)),
employees.state (VARCHAR(40)),
employees.country (VARCHAR(40)),
employees.postal_code (VARCHAR(10)),
employees.phone (VARCHAR(24)),
employees.fax (VARCHAR(24)),
employees.email (VARCHAR(60)),
)
Possible JOINs:
employees.reports_to = employees.id
|