question
string
answer
string
context
string
dialect
string
spider_hardness
string
extended_hardness
string
classification_status
string
syntax_status
string
ddl_syntax_status
string
schema_status
string
syntax_errors
list
ddl_syntax_errors
list
schema_errors
list
classification_errors
list
status_history
list
correction_status
string
component1
int64
component2
int64
others
int64
validation_source
dict
Which city does has most number of customers?
SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Customers (customer_address_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Addresses (city VARCHAR(255), address_id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3795 }
How much in total does customer with first name as Carole and last name as Bernhard paid?
SELECT SUM(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Carole' AND T2.last_name = 'Bernhard'
CREATE TABLE Customers (customer_id VARCHAR(255), first_name VARCHAR(255), last_name VARCHAR(255)); CREATE TABLE Customer_Payments (amount_payment INTEGER, customer_id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3796 }
List the number of customers that did not have any payment history.
SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments)
CREATE TABLE Customers (customer_id VARCHAR(255), name VARCHAR(255)); CREATE TABLE Customer_Payments (customer_id VARCHAR(255), amount_payment INTEGER)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 3797 }
List first name and last name of customers that have more than 2 payments.
SELECT T2.first_name, T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2
CREATE TABLE Customers (first_name VARCHAR(255), last_name VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE Customer_Payments (customer_id VARCHAR(255), amount_payment INTEGER)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3798 }
List all payment methods and number of payments using each payment methods.
SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code
CREATE TABLE Customer_Payments (payment_method_code VARCHAR(255), amount INTEGER)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3799 }
How many lessons were in cancelled state?
SELECT COUNT(*) FROM Lessons WHERE lesson_status_code = 'Cancelled'
CREATE TABLE Lessons (lesson_status_code VARCHAR(255), lesson_id VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3800 }
How many lessons taught by staff whose first name has letter 'a' in it?
SELECT COUNT(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE '%a%'
CREATE TABLE Lessons (staff_id VARCHAR(255), lesson_id VARCHAR(255)); CREATE TABLE Staff (staff_id VARCHAR(255), first_name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3802 }
How many lesson does customer with first name Ray took?
SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Ray'
CREATE TABLE Customers (customer_id VARCHAR(255), first_name VARCHAR(255)); CREATE TABLE Lessons (customer_id VARCHAR(255), lesson_id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3805 }
Which last names are both used by customers and by staff?
SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff
CREATE TABLE Customers (last_name VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE Staff (last_name VARCHAR(255), staff_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
1
0
{ "split": "train", "row_index": 3806 }
What is the id and detail of the vehicle used in lessons for most of the times?
SELECT T1.vehicle_id, T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Lessons (vehicle_id VARCHAR(255), lesson_id VARCHAR(255)); CREATE TABLE Vehicles (vehicle_id VARCHAR(255), vehicle_details VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
1
{ "split": "train", "row_index": 3808 }
How many faculty do we have?
SELECT COUNT(*) FROM Faculty
CREATE TABLE Faculty (Id VARCHAR(255), name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3809 }
What ranks do we have for faculty?
SELECT DISTINCT rank FROM Faculty
CREATE TABLE Faculty (rank VARCHAR(255), faculty_id VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3810 }
Show all the distinct buildings that have faculty rooms.
SELECT DISTINCT building FROM Faculty
CREATE TABLE Faculty (building VARCHAR(255), faculty_id VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3811 }
Show the rank, first name, and last name for all the faculty.
SELECT rank, Fname, Lname FROM Faculty
CREATE TABLE Faculty (rank VARCHAR(255), Fname VARCHAR(255), Lname VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
1
{ "split": "train", "row_index": 3812 }
Show the first name, last name, and phone number for all female faculty members.
SELECT Fname, Lname, phone FROM Faculty WHERE Sex = 'F'
CREATE TABLE Faculty (Fname VARCHAR(255), Lname VARCHAR(255), phone VARCHAR(255), Sex VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3813 }
Show ids for all the male faculty.
SELECT FacID FROM Faculty WHERE Sex = 'M'
CREATE TABLE Faculty (FacID VARCHAR(255), Sex VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3814 }
How many female Professors do we have?
SELECT COUNT(*) FROM Faculty WHERE Sex = 'F' AND Rank = 'Professor'
CREATE TABLE Faculty (Sex VARCHAR(255), Rank VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3815 }
Show the phone, room, and building for the faculty named Jerry Prince.
SELECT phone, room, building FROM Faculty WHERE Fname = 'Jerry' AND Lname = 'Prince'
CREATE TABLE Faculty (phone VARCHAR(255), room VARCHAR(255), building VARCHAR(255), Fname VARCHAR(255), Lname VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
2
{ "split": "train", "row_index": 3816 }
How many Professors are in building NEB?
SELECT COUNT(*) FROM Faculty WHERE Rank = 'Professor' AND building = 'NEB'
CREATE TABLE Faculty (Rank VARCHAR(255), building VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3817 }
Show the first name and last name for all the instructors.
SELECT fname, lname FROM Faculty WHERE Rank = 'Instructor'
CREATE TABLE Faculty (fname VARCHAR(255), lname VARCHAR(255), Rank VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3818 }
Show all the buildings along with the number of faculty members the buildings have.
SELECT building, COUNT(*) FROM Faculty GROUP BY building
CREATE TABLE Faculty (building VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3819 }
Which building has most faculty members?
SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Faculty (building VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3820 }
Show all the buildings that have at least 10 professors.
SELECT building FROM Faculty WHERE rank = 'Professor' GROUP BY building HAVING COUNT(*) >= 10
CREATE TABLE Faculty (building VARCHAR(255), rank VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3821 }
For each faculty rank, show the number of faculty members who have it.
SELECT rank, COUNT(*) FROM Faculty GROUP BY rank
CREATE TABLE Faculty (rank VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3822 }
Show all the ranks and the number of male and female faculty for each rank.
SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex
CREATE TABLE Faculty (rank VARCHAR(255), sex VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
2
{ "split": "train", "row_index": 3823 }
Which rank has the smallest number of faculty members?
SELECT rank FROM Faculty GROUP BY rank ORDER BY COUNT(*) LIMIT 1
CREATE TABLE Faculty (rank VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3824 }
Show the number of male and female assistant professors.
SELECT sex, COUNT(*) FROM Faculty WHERE rank = 'AsstProf' GROUP BY sex
CREATE TABLE Faculty (sex VARCHAR(255), rank VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3825 }
What are the first name and last name of Linda Smith's advisor?
SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = 'Linda' AND T2.lname = 'Smith'
CREATE TABLE Student (advisor VARCHAR(255), fname VARCHAR(255), lname VARCHAR(255)); CREATE TABLE Faculty (fname VARCHAR(255), lname VARCHAR(255), FacID VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
2
{ "split": "train", "row_index": 3826 }
Show the ids of students whose advisors are professors.
SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = 'Professor'
CREATE TABLE Student (StuID VARCHAR(255), advisor VARCHAR(255)); CREATE TABLE Faculty (FacID VARCHAR(255), rank VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3827 }
Show first name and last name for all the students advised by Michael Goodrich.
SELECT T2.fname, T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = 'Michael' AND T1.lname = 'Goodrich'
CREATE TABLE Faculty (FacID VARCHAR(255), fname VARCHAR(255), lname VARCHAR(255)); CREATE TABLE Student (fname VARCHAR(255), lname VARCHAR(255), advisor VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
2
{ "split": "train", "row_index": 3828 }
Show the faculty id of each faculty member, along with the number of students he or she advises.
SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID
CREATE TABLE Faculty (FacID VARCHAR(255), rank VARCHAR(255)); CREATE TABLE Student (advisor VARCHAR(255), StuID INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3829 }
Show all the faculty ranks and the number of students advised by each rank.
SELECT T1.rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank
CREATE TABLE Student (advisor VARCHAR(255), StuID INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Faculty (rank VARCHAR(255), FacID VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3830 }
What are the first and last name of the faculty who has the most students?
SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Student (advisor VARCHAR(255), StuID INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Faculty (fname VARCHAR(255), lname VARCHAR(255), FacID VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
1
{ "split": "train", "row_index": 3831 }
Show the ids for all the faculty members who have at least 2 students.
SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING COUNT(*) >= 2
CREATE TABLE Faculty (FacID VARCHAR(255), name VARCHAR(255)); CREATE TABLE Student (advisor VARCHAR(255), student_id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3832 }
Show ids for the faculty members who don't advise any student.
SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student
CREATE TABLE Faculty (FacID VARCHAR(255), advisor VARCHAR(255)); CREATE TABLE Student (FacID VARCHAR(255), advisor VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
1
0
{ "split": "train", "row_index": 3833 }
What activities do we have?
SELECT activity_name FROM Activity
CREATE TABLE Activity (activity_name VARCHAR(255), Id VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3834 }
How many activities do we have?
SELECT COUNT(*) FROM Activity
CREATE TABLE Activity (Id VARCHAR(255), activity_name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3835 }
How many faculty members participate in an activity?
SELECT COUNT(DISTINCT FacID) FROM Faculty_participates_in
CREATE TABLE Faculty_participates_in (FacID VARCHAR(255), actid VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3836 }
Show the ids of the faculty who don't participate in any activity.
SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in
CREATE TABLE Faculty (FacID VARCHAR(255), name VARCHAR(255)); CREATE TABLE Faculty_participates_in (FacID VARCHAR(255), actid VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
1
0
{ "split": "train", "row_index": 3837 }
Show the ids of all the faculty members who participate in an activity and advise a student.
SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student
CREATE TABLE Student (FacID VARCHAR(255), advisor VARCHAR(255)); CREATE TABLE Faculty_participates_in (FacID VARCHAR(255), advisor VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
1
0
{ "split": "train", "row_index": 3838 }
How many activities does Mark Giuliano participate in?
SELECT COUNT(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = 'Mark' AND T1.lname = 'Giuliano'
CREATE TABLE Faculty_participates_in (facID VARCHAR(255), actID VARCHAR(255)); CREATE TABLE Faculty (facID VARCHAR(255), fname VARCHAR(255), lname VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3839 }
Show all the activity names and the number of faculty involved in each activity.
SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID
CREATE TABLE Faculty_participates_in (actID VARCHAR(255), FacID VARCHAR(255)); CREATE TABLE Activity (activity_name VARCHAR(255), actID VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3842 }
What is the name of the activity that has the most faculty members involved in?
SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Faculty_participates_in (actID VARCHAR(255), FacID VARCHAR(255)); CREATE TABLE Activity (activity_name VARCHAR(255), actID VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3844 }
Show the ids of the students who don't participate in any activity.
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in
CREATE TABLE Participates_in (StuID VARCHAR(255), actid VARCHAR(255)); CREATE TABLE Student (StuID VARCHAR(255), fname VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
1
0
{ "split": "train", "row_index": 3845 }
Show the ids for all the students who participate in an activity and are under 20.
SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20
CREATE TABLE Student (StuID VARCHAR(255), age INTEGER); CREATE TABLE Participates_in (StuID VARCHAR(255), age INTEGER)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
1
0
{ "split": "train", "row_index": 3846 }
What is the first and last name of the student participating in the most activities?
SELECT T1.fname, T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Student (fname VARCHAR(255), lname VARCHAR(255), StuID VARCHAR(255)); CREATE TABLE Participates_in (StuID VARCHAR(255), actid VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
1
{ "split": "train", "row_index": 3847 }
What is the name of the activity with the most students?
SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Activity (activity_name VARCHAR(255), actID VARCHAR(255)); CREATE TABLE Participates_in (actID VARCHAR(255), StuID VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3848 }
Find the first names of the faculty members who are playing Canoeing or Kayaking.
SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'
CREATE TABLE activity (activity_name VARCHAR(255), actid VARCHAR(255)); CREATE TABLE Faculty_participates_in (facID VARCHAR(255), actid VARCHAR(255)); CREATE TABLE Faculty (lname VARCHAR(255), facID VARCHAR(255), fname VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
1
{ "split": "train", "row_index": 3849 }
Find the first names of the faculty members who participate in Canoeing and Kayaking.
SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WH...
CREATE TABLE activity (activity_name VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Faculty_participates_in (facID VARCHAR(255), actid VARCHAR(255)); CREATE TABLE Faculty (lname VARCHAR(255), facID VARCHAR(255), fname VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
1
0
{ "split": "train", "row_index": 3851 }
Find the ids of the students who participate in Canoeing and Kayaking.
SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking'
CREATE TABLE activity (actid VARCHAR(255), activity_name VARCHAR(255)); CREATE TABLE participates_in (stuid VARCHAR(255), actid VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
1
0
{ "split": "train", "row_index": 3852 }
Find the name of the airport in the city of Goroka.
SELECT name FROM airports WHERE city = 'Goroka'
CREATE TABLE airports (name VARCHAR(255), city VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3853 }
Find the name, city, country, and altitude (or elevation) of the airports in the city of New York.
SELECT name, city, country, elevation FROM airports WHERE city = 'New York'
CREATE TABLE airports (name VARCHAR(255), city VARCHAR(255), country VARCHAR(255), elevation VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3854 }
How many airlines are there?
SELECT COUNT(*) FROM airlines
CREATE TABLE airlines (Id VARCHAR(255), name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3855 }
How many airlines does Russia has?
SELECT COUNT(*) FROM airlines WHERE country = 'Russia'
CREATE TABLE airlines (country VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3856 }
What is the maximum elevation of all airports in the country of Iceland?
SELECT MAX(elevation) FROM airports WHERE country = 'Iceland'
CREATE TABLE airports (elevation INTEGER, country VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3857 }
Find the name of the airports located in Cuba or Argentina.
SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'
CREATE TABLE airports (name VARCHAR(255), country VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3858 }
Find the country of the airlines whose name starts with 'Orbit'.
SELECT country FROM airlines WHERE name LIKE 'Orbit%'
CREATE TABLE airlines (country VARCHAR(255), name VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3859 }
Find the name of airports whose altitude is between -50 and 50.
SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50
CREATE TABLE airports (name VARCHAR(255), elevation INTEGER)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3860 }
Which country is the airport that has the highest altitude located in?
SELECT country FROM airports ORDER BY elevation DESC LIMIT 1
CREATE TABLE airports (country VARCHAR(255), elevation VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3861 }
Find the number of airports whose name contain the word 'International'.
SELECT COUNT(*) FROM airports WHERE name LIKE '%International%'
CREATE TABLE airports (name VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3862 }
How many different cities do have some airport in the country of Greenland?
SELECT COUNT(DISTINCT city) FROM airports WHERE country = 'Greenland'
CREATE TABLE airports (city VARCHAR(255), country VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3863 }
Find the number of routes operated by American Airlines.
SELECT COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'
CREATE TABLE routes (alid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE airlines (alid VARCHAR(255), name VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3864 }
Find the name, city, and country of the airport that has the lowest altitude.
SELECT name, city, country FROM airports ORDER BY elevation LIMIT 1
CREATE TABLE airports (name VARCHAR(255), city VARCHAR(255), country VARCHAR(255), elevation VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3866 }
Find the name, city, and country of the airport that has the highest latitude.
SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1
CREATE TABLE airports (name VARCHAR(255), city VARCHAR(255), country VARCHAR(255), elevation VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3867 }
Find the name and city of the airport which is the destination of the most number of routes.
SELECT T1.name, T1.city, T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE airports (name VARCHAR(255), city VARCHAR(255), apid VARCHAR(255)); CREATE TABLE routes (dst_apid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
1
{ "split": "train", "row_index": 3868 }
Find the names of the top 10 airlines that operate the most number of routes.
SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10
CREATE TABLE airlines (name VARCHAR(255), alid VARCHAR(255)); CREATE TABLE routes (alid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
1
{ "split": "train", "row_index": 3869 }
Find the name and city of the airport which is the source for the most number of flight routes.
SELECT T1.name, T1.city, T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE airports (name VARCHAR(255), city VARCHAR(255), apid VARCHAR(255)); CREATE TABLE routes (src_apid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
1
{ "split": "train", "row_index": 3870 }
Which countries has the most number of airlines?
SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE airlines (country VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3872 }
Which countries has the most number of airlines whose active status is 'Y'?
SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE airlines (country VARCHAR(255), active VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3873 }
List all countries and their number of airlines in the descending order of number of airlines.
SELECT country, COUNT(*) FROM airlines GROUP BY country ORDER BY COUNT(*) DESC
CREATE TABLE airlines (country VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
2
{ "split": "train", "row_index": 3874 }
How many airports are there per country? Order the countries by decreasing number of airports.
SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC
CREATE TABLE airports (country VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
2
{ "split": "train", "row_index": 3875 }
How many airports are there per city in the United States? Order the cities by decreasing number of airports.
SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC
CREATE TABLE airports (city VARCHAR(255), country VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
2
{ "split": "train", "row_index": 3876 }
Return the cities with more than 3 airports in the United States.
SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING COUNT(*) > 3
CREATE TABLE airports (city VARCHAR(255), country VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3877 }
How many cities are there that have more than 3 airports?
SELECT COUNT(*) FROM (SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 3)
CREATE TABLE airports (city VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3878 }
List the cities which have more than one airport and number of airports.
SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1
CREATE TABLE airports (city VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3879 }
List the cities which have more than 2 airports sorted by the number of airports.
SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*)
CREATE TABLE airports (city VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3880 }
Find the number of routes for each source airport and the airport name.
SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name
CREATE TABLE airports (name VARCHAR(255), apid VARCHAR(255)); CREATE TABLE routes (src_apid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3881 }
Find the number of routes and airport name for each source airport, order the results by decreasing number of routes.
SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY COUNT(*) DESC
CREATE TABLE airports (name VARCHAR(255), apid VARCHAR(255)); CREATE TABLE routes (src_apid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
2
{ "split": "train", "row_index": 3882 }
Find the average elevation of all airports for each country.
SELECT AVG(elevation), country FROM airports GROUP BY country
CREATE TABLE airports (country VARCHAR(255), elevation INTEGER)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3883 }
Find the cities which have exactly two airports.
SELECT city FROM airports GROUP BY city HAVING COUNT(*) = 2
CREATE TABLE airports (city VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3884 }
For each country and airline name, how many routes are there?
SELECT T1.country, T1.name, COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country, T1.name
CREATE TABLE airlines (country VARCHAR(255), name VARCHAR(255), alid VARCHAR(255)); CREATE TABLE routes (alid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
2
{ "split": "train", "row_index": 3885 }
Find the number of routes with destination airports in Italy.
SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'
CREATE TABLE routes (dst_apid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE airports (apid VARCHAR(255), country VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3886 }
Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'.
SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines'
CREATE TABLE routes (dst_apid VARCHAR(255), alid VARCHAR(255)); CREATE TABLE airports (apid VARCHAR(255), country VARCHAR(255)); CREATE TABLE airlines (alid VARCHAR(255), name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
1
{ "split": "train", "row_index": 3887 }
Find the number of routes that have destination John F Kennedy International Airport.
SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'
CREATE TABLE airports (apid VARCHAR(255), name VARCHAR(255)); CREATE TABLE routes (dst_apid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3888 }
Find the number of routes from the United States to Canada.
SELECT COUNT(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')
CREATE TABLE airports (dst_apid VARCHAR(255), src_apid VARCHAR(255), apid VARCHAR(255), country VARCHAR(255)); CREATE TABLE routes (dst_apid VARCHAR(255), src_apid VARCHAR(255), apid VARCHAR(255), country VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
2
1
{ "split": "train", "row_index": 3889 }
Find the id of routes whose source and destination airports are in the United States.
SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')
CREATE TABLE routes (rid VARCHAR(255), dst_apid VARCHAR(255), src_apid VARCHAR(255), apid VARCHAR(255), country VARCHAR(255)); CREATE TABLE airports (rid VARCHAR(255), dst_apid VARCHAR(255), src_apid VARCHAR(255), apid VARCHAR(255), country VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
2
1
{ "split": "train", "row_index": 3890 }
Find the name of airline which runs the most number of routes.
SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE airlines (name VARCHAR(255), alid VARCHAR(255)); CREATE TABLE routes (alid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3891 }
Find the busiest source airport that runs most number of routes in China.
SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE routes (src_apid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE airports (name VARCHAR(255), apid VARCHAR(255), country VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
5
0
0
{ "split": "train", "row_index": 3892 }
Find the busiest destination airport that runs most number of routes in China.
SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE routes (dst_apid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE airports (name VARCHAR(255), apid VARCHAR(255), country VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
5
0
0
{ "split": "train", "row_index": 3893 }
What is the id of the most recent order?
SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1
CREATE TABLE orders (order_id VARCHAR(255), date_order_placed VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3894 }
what are the order id and customer id of the oldest order?
SELECT order_id, customer_id FROM orders ORDER BY date_order_placed LIMIT 1
CREATE TABLE orders (order_id VARCHAR(255), customer_id VARCHAR(255), date_order_placed VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3895 }
Find the id of the order whose shipment tracking number is "3452".
SELECT order_id FROM shipments WHERE shipment_tracking_number = '3452'
CREATE TABLE shipments (order_id VARCHAR(255), shipment_tracking_number VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3896 }
Find the ids of all the order items whose product id is 11.
SELECT order_item_id FROM order_items WHERE product_id = 11
CREATE TABLE order_items (order_item_id VARCHAR(255), product_id VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3897 }
List the name of all the distinct customers who have orders with status "Packing".
SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Packing'
CREATE TABLE orders (customer_id VARCHAR(255), order_status VARCHAR(255)); CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3898 }
Find the details of all the distinct customers who have orders with status "On Road".
SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road'
CREATE TABLE orders (customer_id VARCHAR(255), order_status VARCHAR(255)); CREATE TABLE customers (customer_details VARCHAR(255), customer_id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3899 }
What is the name of the customer who has the most orders?
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE orders (customer_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3900 }
What is the customer id of the customer who has the most orders?
SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE customers (customer_id VARCHAR(255), name VARCHAR(255)); CREATE TABLE orders (order_id VARCHAR(255), customer_id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3901 }
Give me a list of id and status of orders which belong to the customer named "Jeramie".
SELECT T2.order_id, T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Jeramie'
CREATE TABLE customers (customer_id VARCHAR(255), customer_name VARCHAR(255)); CREATE TABLE orders (order_id VARCHAR(255), order_status VARCHAR(255), customer_id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3902 }
Find the dates of orders which belong to the customer named "Jeramie".
SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Jeramie'
CREATE TABLE customers (customer_id VARCHAR(255), customer_name VARCHAR(255)); CREATE TABLE orders (date_order_placed VARCHAR(255), customer_id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3903 }
Give me the names of customers who have placed orders between 2009-01-01 and 2010-01-01.
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= '2009-01-01' AND T2.date_order_placed <= '2010-01-01'
CREATE TABLE orders (customer_id VARCHAR(255), date_order_placed VARCHAR(255)); CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3904 }