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 max and min grade point for all letter grade. | SELECT MAX(gradepoint), MIN(gradepoint) FROM GRADECONVERSION | CREATE TABLE GRADECONVERSION (gradepoint INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 2 | {
"split": "train",
"row_index": 2691
} |
Find the first names of students whose first names contain letter "a". | SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%' | CREATE TABLE STUDENT (Fname 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": 2692
} |
Find the first names and last names of male (sex is M) faculties who live in building NEB. | SELECT Fname, Lname FROM FACULTY WHERE sex = 'M' AND Building = 'NEB' | CREATE TABLE FACULTY (Fname VARCHAR(255), Lname VARCHAR(255), sex VARCHAR(255), Building VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 2 | {
"split": "train",
"row_index": 2693
} |
Find the rooms of faculties with rank professor who live in building NEB. | SELECT Room FROM FACULTY WHERE Rank = 'Professor' AND Building = 'NEB' | CREATE TABLE FACULTY (Room VARCHAR(255), Rank VARCHAR(255), Building VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 2694
} |
Find the department name that is in Building "Mergenthaler". | SELECT DName FROM DEPARTMENT WHERE Building = 'Mergenthaler' | CREATE TABLE DEPARTMENT (DName VARCHAR(255), Building VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 2695
} |
List the course name of courses sorted by credits. | SELECT CName FROM COURSE ORDER BY Credits | CREATE TABLE COURSE (CName VARCHAR(255), Credits VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 2697
} |
Find the first name of students in the descending order of age. | SELECT Fname FROM STUDENT ORDER BY Age DESC | CREATE TABLE STUDENT (Fname VARCHAR(255), Age VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 2698
} |
Find the last name of female (sex is F) students in the descending order of age. | SELECT LName FROM STUDENT WHERE Sex = 'F' ORDER BY Age DESC | CREATE TABLE STUDENT (LName VARCHAR(255), Sex VARCHAR(255), Age VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 2699
} |
Find the last names of faculties in building Barton in alphabetic order. | SELECT Lname FROM FACULTY WHERE Building = 'Barton' ORDER BY Lname | CREATE TABLE FACULTY (Lname VARCHAR(255), Building VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 2700
} |
Find the first names of faculties of rank Professor in alphabetic order. | SELECT Fname FROM FACULTY WHERE Rank = 'Professor' ORDER BY Fname | CREATE TABLE FACULTY (Fname VARCHAR(255), Rank VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 2701
} |
Find the name of the department that has the biggest number of students minored in? | SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE DEPARTMENT (DName VARCHAR(255), DNO VARCHAR(255)); CREATE TABLE MINOR_IN (DNO VARCHAR(255), id INTEGER) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 2702
} |
Find the name of the department that has the fewest members. | SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE MEMBER_OF (DNO VARCHAR(255), id INTEGER); CREATE TABLE DEPARTMENT (DName VARCHAR(255), DNO VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 2704
} |
Find the rank of the faculty that the fewest faculties belong to. | SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE FACULTY (Rank VARCHAR(255), id INTEGER) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 2705
} |
What are the first and last names of the instructors who teach the top 3 number of courses? | SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 3 | CREATE TABLE COURSE (Instructor VARCHAR(255), id INTEGER); 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": 2706
} |
Which building does the instructor who teaches the most number of courses live in? | SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE COURSE (Instructor VARCHAR(255), id INTEGER); CREATE TABLE FACULTY (Building VARCHAR(255), FacID VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 2707
} |
What are the name of courses that have at least five enrollments? | SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= 5 | CREATE TABLE ENROLLED_IN (CID VARCHAR(255), id INTEGER); CREATE TABLE COURSE (CName VARCHAR(255), CID VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 2708
} |
Find the first name and last name of the instructor of course that has course name | SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = 'COMPUTER LITERACY' | CREATE TABLE FACULTY (Fname VARCHAR(255), Lname VARCHAR(255), FacID VARCHAR(255)); CREATE TABLE COURSE (Instructor VARCHAR(255), CName VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2709
} |
Find the department name and room of the course INTRODUCTION TO COMPUTER SCIENCE. | SELECT T2.Dname, T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = 'INTRODUCTION TO COMPUTER SCIENCE' | CREATE TABLE COURSE (DNO VARCHAR(255), CName VARCHAR(255)); CREATE TABLE DEPARTMENT (Dname VARCHAR(255), Room VARCHAR(255), DNO VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2710
} |
Find the student first and last names and grade points of all enrollments. | SELECT T3.Fname, T3.LName, T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID | CREATE TABLE ENROLLED_IN (Grade VARCHAR(255), StuID VARCHAR(255)); CREATE TABLE STUDENT (Fname VARCHAR(255), LName VARCHAR(255), StuID VARCHAR(255)); CREATE TABLE GRADECONVERSION (gradepoint VARCHAR(255), lettergrade VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2711
} |
Find the distinct student first names of all students that have grade point at least 3.8 in one course. | SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8 | CREATE TABLE ENROLLED_IN (Grade VARCHAR(255), StuID VARCHAR(255)); CREATE TABLE STUDENT (Fname VARCHAR(255), StuID VARCHAR(255)); CREATE TABLE GRADECONVERSION (gradepoint VARCHAR(255), lettergrade VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 2712
} |
Find the full names of faculties who are members of department with department number 520. | SELECT T1.Fname, T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520 | CREATE TABLE FACULTY (Fname VARCHAR(255), Lname VARCHAR(255), FacID VARCHAR(255)); CREATE TABLE MEMBER_OF (FacID VARCHAR(255), DNO VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2713
} |
What are the first names and last names of the students that minor in the department with DNO 140. | SELECT T2.Fname, T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = T2.StuID WHERE T1.DNO = 140 | CREATE TABLE STUDENT (Fname VARCHAR(255), Lname VARCHAR(255), StuID VARCHAR(255)); CREATE TABLE MINOR_IN (StuID VARCHAR(255), DNO VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2714
} |
Find the last names of faculties who are members of computer science department. | SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = 'Computer Science' | CREATE TABLE DEPARTMENT (DNO VARCHAR(255), DName VARCHAR(255)); CREATE TABLE MEMBER_OF (DNO VARCHAR(255), FacID VARCHAR(255)); CREATE TABLE FACULTY (Lname VARCHAR(255), FacID VARCHAR(255), Fname VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 2715
} |
Find the average grade point of student whose last name is Smith. | SELECT AVG(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.LName = 'Smith' | CREATE TABLE ENROLLED_IN (Grade VARCHAR(255), StuID VARCHAR(255)); CREATE TABLE STUDENT (LName VARCHAR(255), StuID VARCHAR(255)); CREATE TABLE GRADECONVERSION (gradepoint INTEGER, lettergrade VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 2716
} |
What is the maximum and minimum grade point of students who live in NYC? | SELECT MAX(T2.gradepoint), MIN(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = 'NYC' | CREATE TABLE ENROLLED_IN (Grade VARCHAR(255), StuID VARCHAR(255)); CREATE TABLE STUDENT (city_code VARCHAR(255), StuID VARCHAR(255)); CREATE TABLE GRADECONVERSION (gradepoint INTEGER, lettergrade VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 2 | {
"split": "train",
"row_index": 2717
} |
Find the names of courses that have either 3 credits or 1 credit but 4 hours. | SELECT CName FROM COURSE WHERE Credits = 3 UNION SELECT CName FROM COURSE WHERE Credits = 1 AND Hours = 4 | CREATE TABLE COURSE (CName VARCHAR(255), Credits VARCHAR(255), Hours VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 2718
} |
Find the names of departments that are either in division AS or in division EN and in Building NEB. | SELECT DName FROM DEPARTMENT WHERE Division = 'AS' UNION SELECT DName FROM DEPARTMENT WHERE Division = 'EN' AND Building = 'NEB' | CREATE TABLE DEPARTMENT (DName VARCHAR(255), Division VARCHAR(255), Building VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 2719
} |
Find the first name of students not enrolled in any course. | SELECT Fname FROM STUDENT WHERE NOT StuID IN (SELECT StuID FROM ENROLLED_IN) | CREATE TABLE STUDENT (Fname VARCHAR(255), StuID VARCHAR(255)); CREATE TABLE ENROLLED_IN (Fname VARCHAR(255), StuID VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 2720
} |
What are the ids of the top three products that were purchased in the largest amount? | SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3 | CREATE TABLE product_suppliers (product_id VARCHAR(255), total_amount_purchased VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 2721
} |
What are the product id and product type of the cheapest product? | SELECT product_id, product_type_code FROM products ORDER BY product_price LIMIT 1 | CREATE TABLE products (product_id VARCHAR(255), product_type_code VARCHAR(255), product_price VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2722
} |
Find the number of different product types. | SELECT COUNT(DISTINCT product_type_code) FROM products | CREATE TABLE products (product_type_code VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 2723
} |
Return the address of customer 10. | SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id = T2.address_id WHERE T2.customer_id = 10 | CREATE TABLE customer_addresses (address_id VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE addresses (address_details VARCHAR(255), address_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 2724
} |
What are the staff ids and genders of all staffs whose job title is Department Manager? | SELECT T1.staff_id, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Department Manager' | CREATE TABLE staff_department_assignments (staff_id VARCHAR(255), job_title_code VARCHAR(255)); CREATE TABLE staff (staff_id VARCHAR(255), staff_gender VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2725
} |
For each payment method, return how many customers use it. | SELECT payment_method_code, COUNT(*) FROM customers GROUP BY payment_method_code | CREATE TABLE customers (payment_method_code 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": 2726
} |
What is the id of the product that was ordered the most often? | SELECT product_id FROM order_items GROUP BY product_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE order_items (product_id 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": 2727
} |
What are the name, phone number and email address of the customer who made the largest number of orders? | SELECT T1.customer_name, T1.customer_phone, T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE customers (customer_name VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customer_orders (customer_id 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": 2728
} |
What is the average price for each type of product? | SELECT product_type_code, AVG(product_price) FROM products GROUP BY product_type_code | CREATE TABLE products (product_type_code VARCHAR(255), product_price INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 2729
} |
How many department stores does the store chain South have? | SELECT COUNT(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id WHERE T2.dept_store_chain_name = 'South' | CREATE TABLE department_stores (dept_store_chain_id VARCHAR(255), store_name VARCHAR(255)); CREATE TABLE department_store_chain (dept_store_chain_id VARCHAR(255), dept_store_chain_name VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 2730
} |
What is the name and job title of the staff who was assigned the latest? | SELECT T1.staff_name, T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1 | CREATE TABLE staff (staff_name VARCHAR(255), staff_id VARCHAR(255)); CREATE TABLE staff_department_assignments (job_title_code VARCHAR(255), staff_id VARCHAR(255), date_assigned_to VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 1 | {
"split": "train",
"row_index": 2731
} |
Give me the product type, name and price for all the products supplied by supplier id 3. | SELECT T2.product_type_code, T2.product_name, T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 | CREATE TABLE products (product_type_code VARCHAR(255), product_name VARCHAR(255), product_price VARCHAR(255), product_id VARCHAR(255)); CREATE TABLE product_suppliers (product_id VARCHAR(255), supplier_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2732
} |
Return the distinct name of customers whose order status is Pending, in the order of customer id. | SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Pending' ORDER BY T2.customer_id | CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customer_orders (customer_id VARCHAR(255), order_status_code VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 2733
} |
Find the name and address of the customers who have both New and Pending orders. | SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'New' INTERSECT SELECT T1.customer_name, T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_stat... | CREATE TABLE customers (customer_name VARCHAR(255), customer_address VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customer_orders (customer_id VARCHAR(255), order_status_code VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 1 | 1 | {
"split": "train",
"row_index": 2734
} |
What is the id and name of the department store that has both marketing and managing department? | SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = 'marketing' INTERSECT SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.de... | CREATE TABLE department_stores (dept_store_id VARCHAR(255), store_name VARCHAR(255)); CREATE TABLE departments (dept_store_id VARCHAR(255), department_name VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 1 | 1 | {
"split": "train",
"row_index": 2736
} |
What are the ids of the two department store chains with the largest number of department stores? | SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY COUNT(*) DESC LIMIT 2 | CREATE TABLE department_stores (dept_store_chain_id VARCHAR(255), store_name VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 2737
} |
What is the id of the department with the least number of staff? | SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE staff_department_assignments (department_id 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": 2738
} |
For each product type, return the maximum and minimum price. | SELECT product_type_code, MAX(product_price), MIN(product_price) FROM products GROUP BY product_type_code | CREATE TABLE products (product_type_code VARCHAR(255), product_price INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 2 | {
"split": "train",
"row_index": 2739
} |
Find the product type whose average price is higher than the average price of all products. | SELECT product_type_code FROM products GROUP BY product_type_code HAVING AVG(product_price) > (SELECT AVG(product_price) FROM products) | CREATE TABLE products (product_type_code VARCHAR(255), product_price INTEGER) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 2740
} |
Return the names and ids of all products whose price is between 600 and 700. | SELECT product_name, product_id FROM products WHERE product_price BETWEEN 600 AND 700 | CREATE TABLE products (product_name VARCHAR(255), product_id VARCHAR(255), product_price INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 2742
} |
Find the ids of all distinct customers who made order after some orders that were Cancelled. | SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT MIN(order_date) FROM Customer_Orders WHERE order_status_code = 'Cancelled') | CREATE TABLE Customer_Orders (customer_id VARCHAR(255), order_date INTEGER, order_status_code VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 2743
} |
What is id of the staff who had a Staff Department Assignment earlier than any Clerical Staff? | SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < (SELECT MAX(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code = 'Clerical Staff') | CREATE TABLE Staff_Department_Assignments (staff_id VARCHAR(255), date_assigned_to INTEGER, job_title_code VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 2744
} |
What are the names and ids of customers whose address contains TN? | SELECT customer_name, customer_id FROM customers WHERE customer_address LIKE '%TN%' | CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255), customer_address VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2745
} |
Return the name and gender of the staff who was assigned in 2016. | SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.date_assigned_from LIKE '2016%' | CREATE TABLE staff (staff_name VARCHAR(255), staff_gender VARCHAR(255), staff_id VARCHAR(255)); CREATE TABLE staff_department_assignments (staff_id VARCHAR(255), date_assigned_from VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 1 | {
"split": "train",
"row_index": 2746
} |
List the name of staff who has been assigned multiple jobs. | SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id HAVING COUNT(*) > 1 | CREATE TABLE staff (staff_name VARCHAR(255), staff_id VARCHAR(255)); CREATE TABLE staff_department_assignments (staff_id VARCHAR(255), assignment_date DATE) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 2747
} |
List the name and phone number of all suppliers in the alphabetical order of their addresses. | SELECT T1.supplier_name, T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN addresses AS T3 ON T2.address_id = T3.address_id ORDER BY T3.address_details | CREATE TABLE addresses (address_id VARCHAR(255), address_details VARCHAR(255)); CREATE TABLE supplier_addresses (supplier_id VARCHAR(255), address_id VARCHAR(255)); CREATE TABLE Suppliers (supplier_name VARCHAR(255), supplier_phone VARCHAR(255), supplier_id VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 1 | {
"split": "train",
"row_index": 2748
} |
What are the phone numbers of all customers and suppliers. | SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers | CREATE TABLE suppliers (customer_phone VARCHAR(255), supplier_phone VARCHAR(255)); CREATE TABLE customers (customer_phone VARCHAR(255), supplier_phone VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 1 | 0 | {
"split": "train",
"row_index": 2749
} |
Return the ids of all products that were ordered more than three times or supplied more than 80000. | SELECT product_id FROM Order_Items GROUP BY product_id HAVING COUNT(*) > 3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING SUM(total_amount_purchased) > 80000 | CREATE TABLE Order_Items (product_id VARCHAR(255), total_amount_purchased INTEGER); CREATE TABLE Product_Suppliers (product_id VARCHAR(255), total_amount_purchased INTEGER) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 2750
} |
What are id and name of the products whose price is lower than 600 or higher than 900? | SELECT product_id, product_name FROM products WHERE product_price < 600 OR product_price > 900 | CREATE TABLE products (product_id VARCHAR(255), product_name VARCHAR(255), product_price VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 2 | {
"split": "train",
"row_index": 2751
} |
Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000. | SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING AVG(total_amount_purchased) > 50000 OR AVG(total_amount_purchased) < 30000 | CREATE TABLE Product_Suppliers (supplier_id VARCHAR(255), total_amount_purchased INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 2752
} |
What are the average amount purchased and value purchased for the supplier who supplies the most products. | SELECT AVG(total_amount_purchased), AVG(total_value_purchased) FROM Product_Suppliers WHERE supplier_id = (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY COUNT(*) DESC LIMIT 1) | CREATE TABLE Product_Suppliers (total_amount_purchased INTEGER, total_value_purchased INTEGER, supplier_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 2 | {
"split": "train",
"row_index": 2753
} |
What is the largest and smallest customer codes? | SELECT MAX(customer_code), MIN(customer_code) FROM Customers | CREATE TABLE Customers (customer_code INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 2 | {
"split": "train",
"row_index": 2754
} |
List the names of all the distinct customers who bought a keyboard. | SELECT DISTINCT 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_name = 'keyboard' | 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 products (product_id VARCHAR(255), product_name VARCHAR(255)); CREATE TABLE customer_orders (customer_id VARCHAR(255), order_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 2755
} |
List the names and phone numbers of all the distinct suppliers who supply red jeans. | SELECT DISTINCT T1.supplier_name, T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = 'red jeans' | CREATE TABLE product_suppliers (supplier_id VARCHAR(255), product_id VARCHAR(255)); CREATE TABLE suppliers (supplier_name VARCHAR(255), supplier_phone VARCHAR(255), supplier_id VARCHAR(255)); CREATE TABLE products (product_id VARCHAR(255), product_name VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 1 | {
"split": "train",
"row_index": 2756
} |
What are the highest and lowest prices of products, grouped by and alphabetically ordered by product type? | SELECT MAX(product_price), MIN(product_price), product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code | CREATE TABLE products (product_type_code VARCHAR(255), product_price INTEGER) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 2 | {
"split": "train",
"row_index": 2757
} |
List the order id, customer id for orders in Cancelled status, ordered by their order dates. | SELECT order_id, customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' ORDER BY order_date | CREATE TABLE customer_orders (order_id VARCHAR(255), customer_id VARCHAR(255), order_status_code VARCHAR(255), order_date VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2758
} |
Find the names of products that were bought by at least two distinct customers. | SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT(DISTINCT T1.customer_id) >= 2 | CREATE TABLE products (product_name VARCHAR(255), product_id VARCHAR(255)); CREATE TABLE customer_orders (order_id VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE order_items (order_id VARCHAR(255), product_id VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 2759
} |
Find the names of customers who have bought by at least three distinct products. | SELECT DISTINCT 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 GROUP BY T1.customer_id HAVING COUNT(DISTINCT T3.product_id) >= 3 | 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)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 2760
} |
Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff. | SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = 'Sales Person' EXCEPT SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code ... | CREATE TABLE staff (staff_name VARCHAR(255), staff_gender VARCHAR(255), staff_id VARCHAR(255)); CREATE TABLE Staff_Department_Assignments (staff_id VARCHAR(255), job_title_code VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 1 | 1 | {
"split": "train",
"row_index": 2761
} |
Find the id and name of customers whose address contains WY state and do not use credit card for payment. | SELECT customer_id, customer_name FROM customers WHERE customer_address LIKE '%WY%' AND payment_method_code <> 'Credit Card' | CREATE TABLE customers (customer_id VARCHAR(255), customer_name VARCHAR(255), customer_address VARCHAR(255), payment_method_code VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 2 | {
"split": "train",
"row_index": 2762
} |
Find the average price of all product clothes. | SELECT AVG(product_price) FROM products WHERE product_type_code = 'Clothes' | CREATE TABLE products (product_price INTEGER, product_type_code 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": 2763
} |
Find the name of the most expensive hardware product. | SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1 | CREATE TABLE products (product_name VARCHAR(255), product_type_code VARCHAR(255), product_price 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": 2764
} |
How many aircrafts are there? | SELECT COUNT(*) FROM aircraft | CREATE TABLE aircraft (Id VARCHAR(255), model VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 2765
} |
List the description of all aircrafts. | SELECT Description FROM aircraft | CREATE TABLE aircraft (Description VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT, Name VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 2766
} |
What is the average number of international passengers of all airports? | SELECT AVG(International_Passengers) FROM airport | CREATE TABLE airport (International_Passengers INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT, Airport_Name VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 2767
} |
What are the number of international and domestic passengers of the airport named London "Heathrow"? | SELECT International_Passengers, Domestic_Passengers FROM airport WHERE Airport_Name = 'London Heathrow' | CREATE TABLE airport (International_Passengers VARCHAR(255), Domestic_Passengers VARCHAR(255), Airport_Name 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": 2768
} |
What are the total number of Domestic Passengers of airports that contain the word "London". | SELECT SUM(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE '%London%' | CREATE TABLE airport (Domestic_Passengers INTEGER, Airport_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": 2769
} |
What are the maximum and minimum number of transit passengers of all aiports. | SELECT MAX(Transit_Passengers), MIN(Transit_Passengers) FROM airport | CREATE TABLE airport (Transit_Passengers INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT, Airport_Name VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 2 | {
"split": "train",
"row_index": 2770
} |
What are the name of pilots aged 25 or older? | SELECT Name FROM pilot WHERE Age >= 25 | CREATE TABLE pilot (Name VARCHAR(255), Age 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": 2771
} |
List all pilot names in ascending alphabetical order. | SELECT Name FROM pilot ORDER BY Name | CREATE TABLE pilot (Name VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT, Age VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 2772
} |
List names of all pilot aged 30 or younger in descending alphabetical order. | SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC | CREATE TABLE pilot (Name VARCHAR(255), Age 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": 2773
} |
Please show the names of aircrafts associated with airport with name "London Gatwick". | SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Gatwick' | CREATE TABLE airport (Airport_ID VARCHAR(255), Airport_Name VARCHAR(255)); CREATE TABLE aircraft (Aircraft VARCHAR(255), Aircraft_ID VARCHAR(255)); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR(255), Airport_ID VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 2774
} |
Please show the names and descriptions of aircrafts associated with airports that have a total number of passengers bigger than 10000000. | SELECT T1.Aircraft, T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Total_Passengers > 10000000 | CREATE TABLE airport (Airport_ID VARCHAR(255), Total_Passengers INTEGER); CREATE TABLE aircraft (Aircraft VARCHAR(255), Description VARCHAR(255), Aircraft_ID VARCHAR(255)); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR(255), Airport_ID VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 1 | {
"split": "train",
"row_index": 2775
} |
What is the average total number of passengers of airports that are associated with aircraft "Robinson R-22"? | SELECT AVG(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = 'Robinson R-22' | CREATE TABLE airport (Total_Passengers INTEGER, Airport_ID VARCHAR(255)); CREATE TABLE aircraft (Aircraft_ID VARCHAR(255), Aircraft VARCHAR(255)); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR(255), Airport_ID VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 2776
} |
Please list the location and the winning aircraft name. | SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft | CREATE TABLE MATCH (Location VARCHAR(255), Winning_Aircraft VARCHAR(255)); CREATE TABLE aircraft (Aircraft VARCHAR(255), Aircraft_ID VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 2777
} |
List the name of the aircraft that has been named winning aircraft the most number of times. | SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE MATCH (Winning_Aircraft VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT, Location VARCHAR(255)); CREATE TABLE aircraft (Aircraft VARCHAR(255), Aircraft_ID VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 2778
} |
List the names of aircrafts and the number of times it won matches. | SELECT T1.Aircraft, COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft | CREATE TABLE MATCH (Winning_Aircraft VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE aircraft (Aircraft VARCHAR(255), Aircraft_ID VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2779
} |
List names of all pilot in descending order of age. | SELECT Name FROM pilot ORDER BY Age DESC | CREATE TABLE pilot (Name VARCHAR(255), Age VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 2780
} |
List the names of aircrafts and that won matches at least twice. | SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*) >= 2 | CREATE TABLE MATCH (Winning_Aircraft VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE aircraft (Aircraft VARCHAR(255), Aircraft_ID VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 2781
} |
List the names of aircrafts and that did not win any match. | SELECT Aircraft FROM aircraft WHERE NOT Aircraft_ID IN (SELECT Winning_Aircraft FROM MATCH) | CREATE TABLE aircraft (Aircraft VARCHAR(255), Aircraft_ID VARCHAR(255), Winning_Aircraft VARCHAR(255)); CREATE TABLE MATCH (Aircraft VARCHAR(255), Aircraft_ID VARCHAR(255), Winning_Aircraft VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 2782
} |
Show the names of aircrafts that are associated with both an airport named "London Heathrow" and an airport named "London Gatwick" | SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = 'London Heathrow' INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport... | CREATE TABLE airport (Airport_ID VARCHAR(255), Airport_Name VARCHAR(255)); CREATE TABLE aircraft (Aircraft VARCHAR(255), Aircraft_ID VARCHAR(255)); CREATE TABLE airport_aircraft (Aircraft_ID VARCHAR(255), Airport_ID VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 1 | 0 | {
"split": "train",
"row_index": 2783
} |
find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30. | SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE MATCH (winning_pilot VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE pilot (name VARCHAR(255), age INTEGER, pilot_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 5 | 0 | 1 | {
"split": "train",
"row_index": 2785
} |
what is the name and age of the youngest winning pilot? | SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age LIMIT 1 | CREATE TABLE pilot (name VARCHAR(255), age VARCHAR(255), pilot_id VARCHAR(255), Winning_Pilot VARCHAR(255), country VARCHAR(255)); CREATE TABLE MATCH (winning_pilot VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 1 | {
"split": "train",
"row_index": 2786
} |
find the name of pilots who did not win the matches held in the country of Australia. | SELECT name FROM pilot WHERE NOT pilot_id IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia') | CREATE TABLE MATCH (name VARCHAR(255), pilot_id VARCHAR(255), Winning_Pilot VARCHAR(255), country VARCHAR(255)); CREATE TABLE pilot (name VARCHAR(255), pilot_id VARCHAR(255), Winning_Pilot VARCHAR(255), country VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 2787
} |
How many residents does each property have? List property id and resident count. | SELECT T1.property_id, COUNT(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id | CREATE TABLE properties (property_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE residents (property_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 2788
} |
What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'? | SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party' | CREATE TABLE services (service_type_code VARCHAR(255), organization_id VARCHAR(255)); CREATE TABLE organizations (organization_id VARCHAR(255), organization_details VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 2789
} |
How many services has each resident requested? List the resident id, details, and the count in descending order of the count. | SELECT T1.resident_id, T1.other_details, COUNT(*) FROM Residents AS T1 JOIN Residents_Services AS T2 ON T1.resident_id = T2.resident_id GROUP BY T1.resident_id ORDER BY COUNT(*) DESC | CREATE TABLE Residents_Services (resident_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Residents (resident_id VARCHAR(255), other_details VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 2 | {
"split": "train",
"row_index": 2790
} |
What is the maximum number that a certain service is provided? List the service id, details and number. | SELECT T1.service_id, T1.service_details, COUNT(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Services (service_id VARCHAR(255), service_details VARCHAR(255)); CREATE TABLE Residents_Services (service_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 2 | {
"split": "train",
"row_index": 2791
} |
List the id and type of each thing, and the details of the organization that owns it. | SELECT T1.thing_id, T1.type_of_Thing_Code, T2.organization_details FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id | CREATE TABLE Organizations (organization_details VARCHAR(255), organization_id VARCHAR(255)); CREATE TABLE Things (thing_id VARCHAR(255), type_of_Thing_Code VARCHAR(255), organization_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 2792
} |
What are the id and details of the customers who have at least 3 events? | SELECT T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 3 | CREATE TABLE Customers (customer_id VARCHAR(255), customer_details VARCHAR(255)); CREATE TABLE Customer_Events (customer_id 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": 2793
} |
What is each customer's move in date, and the corresponding customer id and details? | SELECT T2.date_moved_in, T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id | CREATE TABLE Customer_Events (date_moved_in VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE Customers (customer_id VARCHAR(255), customer_details VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 2794
} |
What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21' | SELECT DISTINCT T2.thing_id, T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21' | CREATE TABLE Timed_Status_of_Things (thing_id VARCHAR(255), Status_of_Thing_Code VARCHAR(255), Date_and_Date VARCHAR(255)); CREATE TABLE Things (thing_id VARCHAR(255), Type_of_Thing_Code VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 2 | {
"split": "train",
"row_index": 2796
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.