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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Find the title of course whose prerequisite is course Differential Geometry. | SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id = T2.course_id WHERE T2.title = 'Differential Geometry') | CREATE TABLE prereq (course_id VARCHAR(255), prereq_id VARCHAR(255));
CREATE TABLE course (title VARCHAR(255), course_id VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 0 | {
"split": "train",
"row_index": 817
} |
What is the title of the course that was offered at building Chandler during the fall semester in the year of 2010? | SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE `building` = 'Chandler' AND `semester` = 'Fall' AND `YEAR` = 2010 | CREATE TABLE course (title VARCHAR(255), course_id VARCHAR(255));
CREATE TABLE SECTION (course_id VARCHAR(255), `building` VARCHAR(255), `semester` VARCHAR(255), `YEAR` INTEGER) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 819
} |
What is the course title of the prerequisite of course Mobile Computing? | SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'Mobile Computing') | CREATE TABLE course (title VARCHAR(255), course_id VARCHAR(255));
CREATE TABLE prereq (prereq_id VARCHAR(255), course_id VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 0 | {
"split": "train",
"row_index": 823
} |
Find the names of all instructors who have taught some course and the course_id. | SELECT T1.name, T2.course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID | CREATE TABLE instructor (ID VARCHAR(255), name VARCHAR(255));
CREATE TABLE teaches (ID VARCHAR(255), course_id INTEGER) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 0 | 1 | {
"split": "train",
"row_index": 839
} |
Find the names of all instructors in the Art department who have taught some course and the course_id. | SELECT T1.name, T2.course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art' | CREATE TABLE instructor (ID VARCHAR(255), dept_name VARCHAR(255), name VARCHAR(255));
CREATE TABLE teaches (ID VARCHAR(255), course_id INTEGER) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 840
} |
Find all the policy type codes associated with the customer "Dayana Robel" | SELECT policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t2.customer_details = 'Dayana Robel' | CREATE TABLE customers (customer_id VARCHAR(255), customer_details VARCHAR(255));
CREATE TABLE policies (customer_id VARCHAR(255), policy_type_code VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 867
} |
Find the total amount claimed in the most recently created document. | SELECT SUM(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT created_date FROM claims_documents ORDER BY created_date LIMIT 1) | CREATE TABLE claim_headers (amount_claimed INTEGER, claim_header_id VARCHAR(255));
CREATE TABLE claims_documents (claim_id VARCHAR(255), created_date VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 1 | 0 | {
"split": "train",
"row_index": 871
} |
What is the name of the customer who has made the largest amount of claim in a single claim? | SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_claimed = (SELECT MAX(amount_claimed) FROM claim_headers) | CREATE TABLE customers (customer_details VARCHAR(255), customer_id VARCHAR(255));
CREATE TABLE policies (policy_id VARCHAR(255), customer_id VARCHAR(255));
CREATE TABLE claim_headers (policy_id VARCHAR(255), amount_claimed INTEGER); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 3 | 1 | 0 | {
"split": "train",
"row_index": 872
} |
Find the names of customers who have no policies associated. | SELECT customer_details FROM customers EXCEPT SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id | CREATE TABLE customers (customer_details VARCHAR(255), customer_id VARCHAR(255));
CREATE TABLE policies (customer_id VARCHAR(255), policy_id INTEGER PRIMARY KEY AUTO_INCREMENT) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 874
} |
Which customer is associated with the latest policy? | SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.start_date = (SELECT MAX(start_date) FROM policies) | CREATE TABLE customers (customer_details VARCHAR(255), customer_id VARCHAR(255));
CREATE TABLE policies (customer_id VARCHAR(255), start_date INTEGER); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 1 | 0 | {
"split": "train",
"row_index": 885
} |
Show all product names without an order. | SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id = T2.product_id | CREATE TABLE Products (product_name VARCHAR(255), product_id VARCHAR(255));
CREATE TABLE Order_items (product_id VARCHAR(255), order_item_id INTEGER PRIMARY KEY AUTO_INCREMENT) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 915
} |
What is the theme and artist name for the exhibition with a ticket price higher than the average? | SELECT T1.theme, T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT AVG(ticket_price) FROM exhibition) | CREATE TABLE exhibition (theme VARCHAR(255), artist_id VARCHAR(255), ticket_price INTEGER); CREATE TABLE artist (name VARCHAR(255), artist_id VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 1 | 1 | {
"split": "train",
"row_index": 955
} |
Find each target user's name and average trust score. | SELECT T1.name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id | CREATE TABLE trust (target_u_id VARCHAR(255), trust INTEGER); CREATE TABLE useracct (name VARCHAR(255), u_id VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 987
} |
Find the name of the target user with the lowest trust score. | SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id ORDER BY T2.trust_score LIMIT 1 | CREATE TABLE trust (target_u_id VARCHAR(255), trust_score INTEGER); CREATE TABLE useracct (name VARCHAR(255), u_id VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 3 | 0 | 0 | {
"split": "train",
"row_index": 988
} |
List the distinct hometowns that are not associated with any gymnast. | SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID | CREATE TABLE gymnast (Gymnast_ID VARCHAR(255), name VARCHAR(255)); CREATE TABLE people (Hometown VARCHAR(255), People_ID VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 1024
} |
Show all member names who are not in charge of any event. | SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id | CREATE TABLE member (member_name VARCHAR(255), member_id VARCHAR(255)); CREATE TABLE party_events (member_in_charge_id VARCHAR(255), event_id VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 1230
} |
What are the ids and details of events that have more than one participants? | SELECT T1.event_id, T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.event_id = T2.Event_ID GROUP BY T1.event_id HAVING COUNT(*) > 1 | CREATE TABLE EVENTS (event_id VARCHAR(255), event_details VARCHAR(255)); CREATE TABLE Participants_in_Events (Event_ID VARCHAR(255), participant_id VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 1291
} |
How many drivers participated in the race Australian Grand Prix held in 2009? | SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = 'Australian Grand Prix' AND `year` = 2009 | CREATE TABLE races (raceid VARCHAR(255), name VARCHAR(255), `year` INTEGER); CREATE TABLE results (raceid VARCHAR(255), driver_id VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 1314
} |
How many degrees were conferred in "San Jose State University" in 2000? | SELECT T2.degrees FROM campuses AS T1 JOIN degrees AS T2 ON T1.Id = T2.campus WHERE T1.campus = 'San Jose State University' AND T2.year = 2000 | CREATE TABLE degrees (Id VARCHAR(255), campus VARCHAR(255), year INTEGER, degrees INTEGER); CREATE TABLE campuses (Id VARCHAR(255), campus VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 1421
} |
How many faculty lines are there in the university that conferred the most number of degrees in year 2002? | SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus AND T2.year = 2002 JOIN degrees AS T3 ON T1.id = T3.campus AND T3.year = 2002 WHERE T2.year = 2002 ORDER BY T3.degrees DESC LIMIT 1 | CREATE TABLE campuses (id VARCHAR(255), name VARCHAR(255)); CREATE TABLE faculty (faculty VARCHAR(255), campus VARCHAR(255), year INTEGER); CREATE TABLE degrees (Id VARCHAR(255), campus VARCHAR(255), year INTEGER, degrees INTEGER) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 5 | 0 | 0 | {
"split": "train",
"row_index": 1427
} |
How many faculty lines are there in the university that conferred the least number of degrees in year 2001? | SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus AND T2.year = T3.year JOIN degrees AS T3 ON T1.id = T3.campus AND T2.year = T3.year WHERE T2.year = 2001 ORDER BY T3.degrees LIMIT 1 | CREATE TABLE campuses (id VARCHAR(255), name VARCHAR(255)); CREATE TABLE faculty (faculty VARCHAR(255), campus VARCHAR(255), year INTEGER); CREATE TABLE degrees (id VARCHAR(255), campus VARCHAR(255), year INTEGER, degrees INTEGER) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 5 | 0 | 0 | {
"split": "train",
"row_index": 1428
} |
Find the name of the candidates whose oppose percentage is the lowest for each sex. | SELECT t1.name, t1.sex, MIN(t2.oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex | CREATE TABLE candidate (people_id VARCHAR(255), oppose_rate INTEGER); CREATE TABLE people (name VARCHAR(255), sex VARCHAR(255), people_id VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 1445
} |
Find the names of all reviewers who have ratings with a NULL value for the date. | SELECT DISTINCT `name` FROM `Reviewer` AS T1 JOIN `Rating` AS T2 ON T1.`rID` = T2.`rID` WHERE `ratingDate` IS NULL | CREATE TABLE `Rating` (`rID` VARCHAR(255), `ratingDate` DATE); CREATE TABLE `Reviewer` (`rID` VARCHAR(255), `name` VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 1467
} |
What is the average rating stars and title for the oldest movie? | SELECT AVG(T1.stars), T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MIN(year) FROM Movie) | CREATE TABLE Movie (title VARCHAR(255), mID VARCHAR(255), year INTEGER); CREATE TABLE Rating (stars INTEGER, mID VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 1 | 1 | {
"split": "train",
"row_index": 1468
} |
Show all storm names except for those with at least two affected regions. | SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 | CREATE TABLE storm (name VARCHAR(255), storm_id VARCHAR(255)); CREATE TABLE affected_region (storm_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 1603
} |
How long does student Linda Smith spend on the restaurant in total? | SELECT SUM(Visits_Restaurant.Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = 'Linda' AND Student.Lname = 'Smith' | CREATE TABLE Visits_Restaurant (Spent INTEGER, StuID INTEGER); CREATE TABLE Student (StuID INTEGER, Fname VARCHAR(255), Lname VARCHAR(255), Spent INTEGER) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 1678
} |
At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total. | SELECT Restaurant.ResName, SUM(Visits_Restaurant.Spent) FROM Visits_Restaurant JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID GROUP BY Restaurant.ResID ORDER BY SUM(Visits_Restaurant.Spent) LIMIT 1 | CREATE TABLE Visits_Restaurant (Id VARCHAR(255), ResID VARCHAR(255), Spent INTEGER); CREATE TABLE Restaurant (Id VARCHAR(255), ResID VARCHAR(255), ResName VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 4 | 0 | 2 | {
"split": "train",
"row_index": 1681
} |
Retrieve the title of the paper that has the largest number of authors. | SELECT t2.title FROM authorship AS t1 JOIN papers AS t2 ON t1.paperid = t2.paperid WHERE t1.authorder = (SELECT MAX(authorder) FROM authorship) | CREATE TABLE authorship (paperid VARCHAR(255), authorder INTEGER); CREATE TABLE papers (title VARCHAR(255), paperid VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 1 | 0 | {
"split": "train",
"row_index": 1726
} |
Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id. | SELECT f.title, f.film_id
FROM film AS f
WHERE f.rental_rate = '0.99'
AND (SELECT COUNT(*) FROM inventory i WHERE i.film_id = f.film_id) < 3; | CREATE TABLE film (title VARCHAR(255), film_id VARCHAR(255), rental_rate VARCHAR(255)); CREATE TABLE inventory (film_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); | mysql | null | extreme | extended | valid | valid | valid | [] | [] | [] | [
"Unsupported column expression: (SELECT COUNT(*) FROM inventory AS i WHERE i.film_id = f.film_id)"
] | [
"validation_failed",
"correction_corrected",
"extended",
"extended"
] | corrected | null | null | null | {
"split": "train",
"row_index": 1739
} |
Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa. | SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' | CREATE TABLE payment (payment_date VARCHAR(255), staff_id VARCHAR(255), amount INTEGER); CREATE TABLE staff (staff_id VARCHAR(255), first_name VARCHAR(255)); | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 0 | {
"split": "train",
"row_index": 1742
} |
Which customer, who has made at least one payment, has spent the least money? List his or her first name, last name, and the id. | SELECT T1.first_name, T1.last_name, T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY SUM(T2.amount) LIMIT 1 | CREATE TABLE payment (customer_id VARCHAR(255), amount INTEGER); CREATE TABLE customer (first_name VARCHAR(255), last_name VARCHAR(255), customer_id VARCHAR(255)); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 4 | 0 | 1 | {
"split": "train",
"row_index": 1750
} |
Where is store 1 located? | SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE store_id = 1 | CREATE TABLE store (address_id VARCHAR(255), store_id INTEGER); CREATE TABLE address (address VARCHAR(255), address_id VARCHAR(255)); | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 1757
} |
Find the name of customers who do not have a loan with a type of Mortgages. | SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages' | CREATE TABLE loan (cust_id VARCHAR(255), loan_type VARCHAR(255)); CREATE TABLE customer (cust_name VARCHAR(255), cust_id VARCHAR(255)); | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 1790
} |
Find the name of customers who have loans of both Mortgages and Auto. | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Auto' | CREATE TABLE customer (cust_name VARCHAR(255), cust_id VARCHAR(255)); CREATE TABLE loan (cust_id VARCHAR(255), loan_type VARCHAR(255)); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 1 | 0 | {
"split": "train",
"row_index": 1791
} |
Find the total amount of loans offered by each bank branch. | SELECT SUM(T2.amount) AS total_amount, T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname | CREATE TABLE loan (branch_id VARCHAR(255), amount INTEGER); CREATE TABLE bank (bname VARCHAR(255), branch_id VARCHAR(255)); | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 1800
} |
Find the the name of the customers who have a loan with amount more than 3000. | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.amount > 3000 | CREATE TABLE customer (cust_name VARCHAR(255), cust_id VARCHAR(255)); CREATE TABLE loan (cust_id VARCHAR(255), amount INTEGER); | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 1807
} |
What are the id and first name of the student whose addresses have the highest average monthly rental? | SELECT T1.student_id, T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1 | CREATE TABLE Students (first_name VARCHAR(255), student_id VARCHAR(255)); CREATE TABLE Student_Addresses (student_id VARCHAR(255), monthly_rental INTEGER); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 4 | 0 | 1 | {
"split": "train",
"row_index": 1835
} |
Find the id and city of the student address with the highest average monthly rental. | SELECT T2.address_id, T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1 | CREATE TABLE Student_Addresses (address_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Addresses (city VARCHAR(255), address_id VARCHAR(255), monthly_rental INTEGER); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 4 | 0 | 1 | {
"split": "train",
"row_index": 1836
} |
Find the start and end dates of behavior incidents of students with last name "Fahey". | SELECT T1.date_incident_start, T1.date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.last_name = 'Fahey' | CREATE TABLE Behavior_Incident (date_incident_start VARCHAR(255), date_incident_end VARCHAR(255), student_id VARCHAR(255)); CREATE TABLE Students (student_id VARCHAR(255), last_name VARCHAR(255)); | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 1841
} |
Find the start and end dates of detentions of teachers with last name "Schultz". | SELECT T1.datetime_detention_start, T1.datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = 'Schultz' | CREATE TABLE Detention (datetime_detention_start VARCHAR(255), datetime_detention_end VARCHAR(255), teacher_id VARCHAR(255)); CREATE TABLE Teachers (teacher_id VARCHAR(255), last_name VARCHAR(255)); | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 1842
} |
What are the id and zip code of the address with the highest monthly rental? | SELECT T2.address_id, T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id ORDER BY monthly_rental DESC LIMIT 1 | CREATE TABLE Student_Addresses (address_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Addresses (zip_postcode VARCHAR(255), address_id VARCHAR(255), monthly_rental INTEGER); | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 3 | 0 | 1 | {
"split": "train",
"row_index": 1843
} |
Find the last names of teachers who are not involved in any detention. | SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id | CREATE TABLE Teachers (last_name VARCHAR(255), teacher_id VARCHAR(255)); CREATE TABLE Detention (teacher_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 1851
} |
Find the id and local authority of the station with has the highest average high temperature. | SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id ORDER BY AVG(high_temperature) DESC LIMIT 1 | CREATE TABLE weekly_weather (station_id VARCHAR(255), high_temperature INTEGER); CREATE TABLE station (id VARCHAR(255), local_authority VARCHAR(255)); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 4 | 0 | 1 | {
"split": "train",
"row_index": 1896
} |
Find the number of professors in accounting department. | SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE `DEPT_NAME` = 'Accounting' | CREATE TABLE professor (dept_code VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE department (dept_code VARCHAR(255), `DEPT_NAME` VARCHAR(255)); | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 1900
} |
Find the number of classes in each department. | SELECT COUNT(*), dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code | CREATE TABLE CLASS (crs_code VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE course (crs_code VARCHAR(255), dept_code VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 1916
} |
How many courses are offered by the Computer Info. Systems department? | SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = 'Computer Info. Systems' | CREATE TABLE course (dept_code VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE department (dept_code VARCHAR(255), dept_name VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 1930
} |
What are the first names of the professors who do not teach a class. | SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num | CREATE TABLE employee (emp_fname VARCHAR(255), emp_jobcode VARCHAR(255), emp_num VARCHAR(255)); CREATE TABLE CLASS (prof_num VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 0 | {
"split": "train",
"row_index": 1950
} |
What is the department name of the students with lowest gpa belongs to? | SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1 | CREATE TABLE student (dept_code VARCHAR(255), stu_gpa INTEGER); CREATE TABLE department (dept_name VARCHAR(255), dept_code VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 3 | 0 | 0 | {
"split": "train",
"row_index": 1963
} |
Find the names of furnitures whose prices are lower than the highest price. | SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT MAX(Price_in_Dollar) FROM furniture_manufacte) | CREATE TABLE furniture_manufacte (Furniture_ID VARCHAR(255), Price_in_Dollar INTEGER); CREATE TABLE furniture (name VARCHAR(255), Furniture_ID VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 1 | 0 | {
"split": "train",
"row_index": 2013
} |
display the department name and number of employees in each of the department. | SELECT T2.department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name | CREATE TABLE employees (department_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE departments (department_id VARCHAR(255), department_name VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 2081
} |
Find the names of programs that are never broadcasted in the morning. | SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = 'Morning' | CREATE TABLE broadcast (program_id VARCHAR(255), Time_of_day VARCHAR(255)); CREATE TABLE program (name VARCHAR(255), program_id VARCHAR(255)); | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 2203
} |
Find the personal names of students not enrolled in any course. | SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id | CREATE TABLE Student_Course_Enrolment (student_id VARCHAR(255), enrollment_date DATE); CREATE TABLE Students (personal_name VARCHAR(255), student_id VARCHAR(255)); | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 2248
} |
Which claims caused more than 2 settlements or have the maximum claim value? List the date the claim was made and the claim id. | SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING COUNT(*) > 2 UNION SELECT T1.Date_Claim_Made, T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = (SELECT MAX(Amount_Claimed) F... | CREATE TABLE Settlements (Claim_id VARCHAR(255), amount INTEGER); CREATE TABLE Claims (Date_Claim_Made VARCHAR(255), Claim_id VARCHAR(255), Amount_Claimed INTEGER); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 1 | 1 | {
"split": "train",
"row_index": 2252
} |
Which customer had at least 2 policies but did not file any claims? List the customer details and id. | SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 EXCEPT SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id JOIN Claims ... | CREATE TABLE Customers (customer_details VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE Customer_Policies (customer_id VARCHAR(255), policy_id VARCHAR(255)); CREATE TABLE Claims (policy_id VARCHAR(255), amount INTEGER); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 1 | 1 | {
"split": "train",
"row_index": 2253
} |
How many settlements does each claim correspond to? List the claim id and the number of settlements. | SELECT T1.`Claim_id`, COUNT(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.`Claim_id` = T2.claim_id GROUP BY T1.`Claim_id` | CREATE TABLE Settlements (claim_id VARCHAR(255), settlement_date DATE); CREATE TABLE Claims (`Claim_id` VARCHAR(255), amount INTEGER); | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 2259
} |
Who are the customers that had more than 1 policy? List the customer details and id. | SELECT T1.customer_details, T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 1 | CREATE TABLE Customers (customer_details VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE Customer_Policies (customer_id VARCHAR(255), policy_id VARCHAR(255)); | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 2264
} |
List the details of the customers who do not have any policies. | SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id | CREATE TABLE Customer_Policies (customer_id VARCHAR(255), policy_id VARCHAR(255)); CREATE TABLE Customers (customer_details VARCHAR(255), customer_id VARCHAR(255)); | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 2273
} |
List the date the claim was made, the date it was settled and the amount settled for all the claims which had exactly one settlement. | SELECT T1.claim_id, T1.date_claim_made, T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING COUNT(*) = 1 | CREATE TABLE Claims (claim_id VARCHAR(255), date_claim_made VARCHAR(255), Date_Claim_Settled VARCHAR(255)); CREATE TABLE Settlements (Claim_id VARCHAR(255), settlement_amount INTEGER); | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 2274
} |
what is the name and position of the head whose department has least number of employees? | SELECT T2.name, T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head = T2.EmployeeID GROUP BY `departmentID` ORDER BY COUNT(`departmentID`) LIMIT 1 | CREATE TABLE department (head VARCHAR(255), `departmentID` INTEGER); CREATE TABLE physician (name VARCHAR(255), position VARCHAR(255), EmployeeID VARCHAR(255)); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 4 | 0 | 1 | {
"split": "train",
"row_index": 2278
} |
What are names of patients who made an appointment? | SELECT T2.name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn | CREATE TABLE appointment (patient VARCHAR(255), appointment_date DATE); CREATE TABLE patient (ssn VARCHAR(255), name VARCHAR(255)); | mysql | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 0 | 0 | {
"split": "train",
"row_index": 2279
} |
what are name and phone number of patients who had more than one appointment? | SELECT T2.name, T2.phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING COUNT(*) > 1 | CREATE TABLE appointment (patient VARCHAR(255), appointment_date DATE); CREATE TABLE patient (ssn VARCHAR(255), name VARCHAR(255), phone VARCHAR(255)); | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 2280
} |
List the name of physicians who never took any appointment. | SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID | CREATE TABLE physician (name VARCHAR(255), EmployeeID VARCHAR(255)); CREATE TABLE appointment (Physician VARCHAR(255), appointment_date DATE); | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 2283
} |
Find the name of medication used on the patient who stays in room 111? | SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE `room` = 111 | CREATE TABLE Prescribes (Patient VARCHAR(255), Medication VARCHAR(255)); CREATE TABLE Medication (name VARCHAR(255), Code VARCHAR(255)); CREATE TABLE patient (SSN VARCHAR(255), name VARCHAR(255)); CREATE TABLE stay (Patient VARCHAR(255), `room` INTEGER); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 4 | 0 | 0 | {
"split": "train",
"row_index": 2288
} |
List the names of departments where some physicians are primarily affiliated with. | SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1 | CREATE TABLE affiliated_with (department VARCHAR(255), PrimaryAffiliation INTEGER); CREATE TABLE department (name VARCHAR(255), departmentid VARCHAR(255)); | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 2308
} |
Find the names of all procedures which cost more than 1000 but which physician John Wen was not trained in? | SELECT name FROM procedures WHERE cost > 1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen' | CREATE TABLE trained_in (physician VARCHAR(255), treatment VARCHAR(255)); CREATE TABLE procedures (name VARCHAR(255), cost INTEGER, code VARCHAR(255)); CREATE TABLE physician (employeeid VARCHAR(255), name VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 0 | {
"split": "train",
"row_index": 2318
} |
Find the names of all procedures such that the cost is less than 5000 and physician John Wen was trained in. | SELECT name FROM procedures WHERE cost < 5000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = 'John Wen' | CREATE TABLE trained_in (physician VARCHAR(255), treatment VARCHAR(255)); CREATE TABLE procedures (name VARCHAR(255), cost INTEGER, code VARCHAR(255)); CREATE TABLE physician (employeeid VARCHAR(255), name VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 0 | {
"split": "train",
"row_index": 2319
} |
Find the names of patients who are not using the medication of Procrastin-X. | SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient = T1.SSN JOIN Medication AS T3 ON T2.Medication = T3.Code WHERE T3.name = 'Procrastin-X' | CREATE TABLE Prescribes (Patient VARCHAR(255), Medication VARCHAR(255)); CREATE TABLE Medication (Code VARCHAR(255), name VARCHAR(255)); CREATE TABLE patient (name VARCHAR(255), SSN VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 2322
} |
What is the day Number and date of all the documents? | SELECT T2.day_Number, T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.Date_Stored = T2.calendar_date | CREATE TABLE All_documents (Date_Stored VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Ref_calendar (day_Number VARCHAR(255), calendar_date VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 0 | 1 | {
"split": "train",
"row_index": 2423
} |
What are the distinct grant amount for the grants where the documents were sent before '1986-08-26 20:49:27' and grant were ended after '1989-03-16 18:27:16'? | SELECT DISTINCT T1.grant_amount FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id WHERE T2.sent_date < '1986-08-26 20:49:27' AND T1.grant_end_date > '1989-03-16 18:27:16' | CREATE TABLE Grants (
grant_amount VARCHAR(255),
grant_id VARCHAR(255),
grant_end_date DATETIME
); CREATE TABLE Documents (
grant_id VARCHAR(255),
sent_date DATETIME
) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 2493
} |
Who is the oldest person? | SELECT name FROM Person WHERE age = (SELECT MAX(age) FROM Person) | CREATE TABLE Person (name VARCHAR(255), age INTEGER) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 0 | {
"split": "train",
"row_index": 2537
} |
Who is the oldest person whose job is student? | SELECT name FROM Person WHERE job = 'student' AND age = (SELECT MAX(age) FROM Person WHERE job = 'student') | CREATE TABLE Person (
name VARCHAR(255),
job VARCHAR(255),
age INTEGER
) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 1 | {
"split": "train",
"row_index": 2538
} |
Who is the youngest male? | SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM person WHERE gender = 'male') | CREATE TABLE Person (name VARCHAR(255), gender VARCHAR(255), age INTEGER); CREATE TABLE person (name VARCHAR(255), gender VARCHAR(255), age INTEGER) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 1 | {
"split": "train",
"row_index": 2539
} |
Find the name of people whose age is greater than any engineer sorted by their age. | SELECT name FROM Person WHERE age > (SELECT MIN(age) FROM Person WHERE job = 'engineer') ORDER BY age | CREATE TABLE Person (
name VARCHAR(255),
age INTEGER,
job VARCHAR(255)
) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 1 | 0 | {
"split": "train",
"row_index": 2548
} |
Find the number of people whose age is greater than all engineers. | SELECT COUNT(*) FROM Person WHERE age > (SELECT MAX(age) FROM person WHERE job = 'engineer') | CREATE TABLE Person (age INTEGER, job VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE person (age INTEGER, job VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 0 | {
"split": "train",
"row_index": 2549
} |
Who has friends that are younger than the average age? | SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person) | CREATE TABLE person (age INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT);
CREATE TABLE Person (name VARCHAR(255), age INTEGER);
CREATE TABLE PersonFriend (name VARCHAR(255), friend VARCHAR(255)); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 1 | 0 | {
"split": "train",
"row_index": 2565
} |
Find Alice's friends of friends. | SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name <> 'Alice' | CREATE TABLE PersonFriend (name VARCHAR(255), friend VARCHAR(255)); CREATE TABLE Person (name VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 4 | 0 | 1 | {
"split": "train",
"row_index": 2574
} |
Find names of the document without any images. | SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id | CREATE TABLE document_sections_images (section_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE documents (document_name VARCHAR(255), document_code VARCHAR(255)); CREATE TABLE document_sections (document_code VARCHAR(255), section_id VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 2603
} |
Find the name of the department that has no students minored in? | SELECT DName FROM DEPARTMENT WHERE DNO NOT IN (SELECT DNO FROM MINOR_IN) | CREATE TABLE DEPARTMENT (DName VARCHAR(255), DNO VARCHAR(255)); CREATE TABLE MINOR_IN (DNO VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 0 | {
"split": "train",
"row_index": 2703
} |
Which events have the number of notes between one and three? List the event id and the property id. | SELECT T1.Customer_Event_ID, T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.Customer_Event_ID HAVING COUNT(*) BETWEEN 1 AND 3 | CREATE TABLE Customer_Events (Customer_Event_ID VARCHAR(255), property_id VARCHAR(255)); CREATE TABLE Customer_Event_Notes (Customer_Event_ID VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 2795
} |
Find the states where have some college students in tryout. | SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName | CREATE TABLE college (cName VARCHAR(255), state VARCHAR(255)); CREATE TABLE tryout (cName VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | mysql | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 0 | 0 | {
"split": "train",
"row_index": 2870
} |
Show the names of all the clients with no booking. | SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID | CREATE TABLE Clients (Customer_Name VARCHAR(255), Client_ID VARCHAR(255)); CREATE TABLE Bookings (Customer_ID VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 2954
} |
Find all the stage positions of the musicians with first name "Solveig" | SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE T2.Firstname = 'Solveig' | CREATE TABLE Band (id VARCHAR(255), Firstname VARCHAR(255), lastname VARCHAR(255)); CREATE TABLE Performance (stageposition VARCHAR(255), bandmate VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 2961
} |
What is the last name of the musician that has been at the back position the most? | SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE T1.stageposition = 'back' GROUP BY T2.lastname ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Band (lastname VARCHAR(255), id VARCHAR(255), firstname VARCHAR(255)); CREATE TABLE Performance (bandmate VARCHAR(255), stageposition VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 5 | 0 | 0 | {
"split": "train",
"row_index": 2971
} |
What instrument did the musician with last name "Heilo" use in the song "Le Pop"? | SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.SongId AND T4.bandmateid = T2.id WHERE T2.lastname = 'Heilo' AND T3.title = 'Le Pop' | CREATE TABLE Songs (SongId VARCHAR(255), title VARCHAR(255)); CREATE TABLE Performance (bandmate VARCHAR(255), SongId VARCHAR(255)); CREATE TABLE Band (id VARCHAR(255), lastname VARCHAR(255), firstname VARCHAR(255)); CREATE TABLE Instruments (instrument VARCHAR(255), songid VARCHAR(255), bandmateid VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 4 | 0 | 1 | {
"split": "train",
"row_index": 2974
} |
How many instrument does the musician with last name "Heilo" use? | SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = 'Heilo' | CREATE TABLE instruments (bandmateid VARCHAR(255), instrument VARCHAR(255)); CREATE TABLE Band (id VARCHAR(255), lastname VARCHAR(255), firstname VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 2979
} |
Find all the instruments ever used by the musician with last name "Heilo"? | SELECT T1.instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = 'Heilo' | CREATE TABLE instruments (bandmateid VARCHAR(255), instrument VARCHAR(255)); CREATE TABLE Band (id VARCHAR(255), lastname VARCHAR(255), firstname VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 2980
} |
Which song has the most vocals? | SELECT T2.title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE vocals (songid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE songs (songid VARCHAR(255), title VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 4 | 0 | 0 | {
"split": "train",
"row_index": 2981
} |
Which vocal type has the band mate with last name "Heilo" played the most? | SELECT T1.TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE T2.lastname = 'Heilo' GROUP BY T1.TYPE ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE vocals (bandmate VARCHAR(255), TYPE VARCHAR(255)); CREATE TABLE band (id VARCHAR(255), lastname VARCHAR(255), firstname VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 5 | 0 | 0 | {
"split": "train",
"row_index": 2983
} |
Find the number of vocal types used in song "Demon Kitty Rag"? | SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Demon Kitty Rag' | CREATE TABLE vocals (songid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE songs (songid VARCHAR(255), title VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 2985
} |
Which vocal type did the musician with first name "Solveig" played in the song with title "A Bar in Amsterdam"? | SELECT T1.`type` FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = 'Solveig' AND T2.title = 'A Bar In Amsterdam' | CREATE TABLE vocals (songid VARCHAR(255), bandmate VARCHAR(255), `type` VARCHAR(255)); CREATE TABLE band (id VARCHAR(255), firstname VARCHAR(255), lastname VARCHAR(255)); CREATE TABLE songs (songid VARCHAR(255), title VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 3 | 0 | 1 | {
"split": "train",
"row_index": 2987
} |
Find the number of vocal types used in song "Le Pop" | SELECT COUNT(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Le Pop' | CREATE TABLE vocals (songid VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE songs (songid VARCHAR(255), title VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 2995
} |
Find the first name of the band mate that has performed in most songs. | SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS t3 ON t3.SongId = t1.SongId GROUP BY t2.firstname ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Performance (bandmate VARCHAR(255), SongId VARCHAR(255)); CREATE TABLE Band (firstname VARCHAR(255), id VARCHAR(255)); CREATE TABLE Songs (SongId VARCHAR(255), title VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 5 | 0 | 0 | {
"split": "train",
"row_index": 3000
} |
Find the name of companies that do not make DVD drive. | SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive' | CREATE TABLE manufacturers (name VARCHAR(255), code VARCHAR(255)); CREATE TABLE products (Manufacturer VARCHAR(255), name VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 3029
} |
What are the names, details and data types of the characteristics which are never used by any product? | SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id | CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR(255), other_characteristic_details VARCHAR(255), characteristic_data_type VARCHAR(255), characteristic_id VARCHAR(255)); CREATE TABLE product_characteristics (characteristic_id VARCHAR(255), product_id VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 1 | {
"split": "train",
"row_index": 3167
} |
Find the list of cities that no customer is living in. | SELECT city FROM addresses WHERE NOT city IN (SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id) | CREATE TABLE customers (customer_id VARCHAR(255), customer_name VARCHAR(255)); CREATE TABLE addresses (city VARCHAR(255), address_id VARCHAR(255)); CREATE TABLE customer_addresses (customer_id VARCHAR(255), address_id VARCHAR(255)); | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 1 | 1 | 0 | {
"split": "train",
"row_index": 3461
} |
What is the name of the customer that made the order with the largest quantity? | SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items) | CREATE TABLE order_items (order_id VARCHAR(255), order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customer_orders (customer_id VARCHAR(255), order_id VARCHAR(255)) | mysql | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 3 | 1 | 0 | {
"split": "train",
"row_index": 3472
} |
Find the names of customers who never ordered product Latte. | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' | CREATE TABLE order_items (order_id VARCHAR(255), product_id VARCHAR(255)); CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customer_orders (customer_id VARCHAR(255), order_id VARCHAR(255)); CREATE TABLE products (product_id VARCHAR(255), product_details VARCHAR(255)) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 3487
} |
Find the names of customers who never placed an order. | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id | CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customer_orders (customer_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | mysql | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 0 | 1 | 0 | {
"split": "train",
"row_index": 3488
} |
What are the issue dates of volumes associated with the artist aged 23 or younger? | SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23 | CREATE TABLE volume (Artist_ID VARCHAR(255), Issue_Date DATE); CREATE TABLE artist (Artist_ID VARCHAR(255), age VARCHAR(255)) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 0 | {
"split": "train",
"row_index": 3517
} |
What are the GDP and population of the city that already served as a host more than once? | SELECT t1.gdp, t1.Regional_Population FROM city AS t1 JOIN hosting_city AS t2 ON t1.city_id = t2.host_city GROUP BY t2.host_city HAVING COUNT(*) > 1 | CREATE TABLE city (city_id VARCHAR(255), gdp INTEGER, Regional_Population INTEGER); CREATE TABLE hosting_city (host_city VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | mysql | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validation_failed",
"correction_failed",
"correction_corrected",
"extended",
"classified"
] | corrected | 2 | 0 | 1 | {
"split": "train",
"row_index": 3577
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.