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 code of city where most of students are living in. | SELECT city_code FROM student GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE student (city_code 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": 3257
} |
Find the first and last name of students whose age is younger than the average age. | SELECT fname, lname FROM student WHERE age < (SELECT AVG(age) FROM student) | CREATE TABLE student (fname VARCHAR(255), lname VARCHAR(255), age INTEGER) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 1 | {
"split": "train",
"row_index": 3258
} |
List the first and last name of students who are not living in the city with code HKG, and sorted the results by their ages. | SELECT fname, lname FROM student WHERE city_code <> 'HKG' ORDER BY age | CREATE TABLE student (fname VARCHAR(255), lname VARCHAR(255), city_code VARCHAR(255), age VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 3259
} |
List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order. | SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name | CREATE TABLE has_amenity (amenid VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE dorm_amenity (amenity_name VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE dorm (dormid VARCHAR(255), dorm_name VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 3260
} |
Find the number of dorms and total capacity for each gender. | SELECT COUNT(*), SUM(student_capacity), gender FROM dorm GROUP BY gender | CREATE TABLE dorm (gender VARCHAR(255), student_capacity INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 2 | {
"split": "train",
"row_index": 3261
} |
Find the average and oldest age for students with different sex. | SELECT AVG(age), MAX(age), sex FROM student GROUP BY sex | CREATE TABLE student (sex VARCHAR(255), age INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 2 | {
"split": "train",
"row_index": 3262
} |
Find the number of students in each major. | SELECT COUNT(*), major FROM student GROUP BY major | CREATE TABLE student (major 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": 3263
} |
Find the number and average age of students living in each city. | SELECT COUNT(*), AVG(age), city_code FROM student GROUP BY city_code | CREATE TABLE student (city_code VARCHAR(255), age INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 2 | {
"split": "train",
"row_index": 3264
} |
Find the average age and number of male students (with sex M) from each city. | SELECT COUNT(*), AVG(age), city_code FROM student WHERE sex = 'M' GROUP BY city_code | CREATE TABLE student (city_code VARCHAR(255), age INTEGER, sex VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 2 | {
"split": "train",
"row_index": 3265
} |
Find the number of students for the cities where have more than one student. | SELECT COUNT(*), city_code FROM student GROUP BY city_code HAVING COUNT(*) > 1 | CREATE TABLE student (city_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": 3266
} |
Find the first and last name of students who are not in the largest major. | SELECT fname, lname FROM student WHERE major <> (SELECT major FROM student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1) | CREATE TABLE student (fname VARCHAR(255), lname VARCHAR(255), major VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 1 | {
"split": "train",
"row_index": 3267
} |
Find the number of students whose age is older than the average age for each gender. | SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex | CREATE TABLE student (sex VARCHAR(255), age INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 1 | 1 | {
"split": "train",
"row_index": 3268
} |
Find the average age of students living in each dorm and the name of dorm. | SELECT AVG(T1.age), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name | CREATE TABLE dorm (dorm_name VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE student (age INTEGER, stuid VARCHAR(255)); CREATE TABLE lives_in (stuid VARCHAR(255), dormid VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 1 | {
"split": "train",
"row_index": 3269
} |
Find the number of amenities for each of the dorms that can accommodate more than 100 students. | SELECT COUNT(*), T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid | CREATE TABLE dorm (dormid VARCHAR(255), student_capacity INTEGER); CREATE TABLE has_amenity (dormid VARCHAR(255), amenid VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 1 | {
"split": "train",
"row_index": 3270
} |
Find the number of students who is older than 20 in each dorm. | SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name | CREATE TABLE dorm (dorm_name VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE lives_in (stuid VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE student (stuid VARCHAR(255), age INTEGER) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 3271
} |
Find the first name of students who are living in the Smith Hall. | SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' | CREATE TABLE student (fname VARCHAR(255), stuid VARCHAR(255)); CREATE TABLE lives_in (stuid VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE dorm (dormid VARCHAR(255), dorm_name VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 3272
} |
Find the total number of students living in the male dorm (with gender M). | SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M' | CREATE TABLE dorm (dormid VARCHAR(255), gender VARCHAR(255)); CREATE TABLE lives_in (stuid VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE student (stuid 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": 3274
} |
Find the number of female students (with F sex) living in Smith Hall | SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F' | CREATE TABLE lives_in (stuid VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE student (stuid VARCHAR(255), sex VARCHAR(255)); CREATE TABLE dorm (dormid VARCHAR(255), dorm_name VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 1 | {
"split": "train",
"row_index": 3275
} |
Find the name of amenities Smith Hall dorm have. | SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' | CREATE TABLE has_amenity (dormid VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE dorm_amenity (amenity_name VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE dorm (dormid VARCHAR(255), dorm_name VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 3276
} |
Find the name of amenities Smith Hall dorm have. ordered the results by amenity names. | SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name | CREATE TABLE has_amenity (dormid VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE dorm_amenity (amenity_name VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE dorm (dormid VARCHAR(255), dorm_name VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 3277
} |
Find the name of amenity that is most common in all dorms. | SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE dorm_amenity (amenity_name VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE has_amenity (amenid VARCHAR(255), dormid VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 3278
} |
Find the first name of students who are living in the dorm that has most number of amenities. | SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY COUNT(*) DESC LIMIT 1) | CREATE TABLE dorm_amenity (amenid VARCHAR(255), amenity_name VARCHAR(255)); CREATE TABLE lives_in (stuid VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE dorm (dormid VARCHAR(255), dorm_name VARCHAR(255)); CREATE TABLE student (fname VARCHAR(255), stuid VARCHAR(255)); CREATE TABLE has_amenity (dormid VARCHAR(255), amen... | generic | extra | extreme | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 1 | 0 | {
"split": "train",
"row_index": 3279
} |
Find the name and capacity of the dorm with least number of amenities. | SELECT T1.dorm_name, T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE has_amenity (dormid VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE dorm_amenity (amenid VARCHAR(255)); CREATE TABLE dorm (dorm_name VARCHAR(255), student_capacity VARCHAR(255), dormid VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 5 | 0 | 1 | {
"split": "train",
"row_index": 3280
} |
Find the first and last name of students who are living in the dorms that have amenity TV Lounge. | SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') | CREATE TABLE has_amenity (dormid VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE lives_in (stuid VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE student (fname VARCHAR(255), lname VARCHAR(255), stuid VARCHAR(255)); CREATE TABLE dorm_amenity (amenid VARCHAR(255), amenity_name VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 1 | 1 | {
"split": "train",
"row_index": 3282
} |
Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge. | SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') | CREATE TABLE has_amenity (dormid VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE student (fname VARCHAR(255), age VARCHAR(255), stuid VARCHAR(255)); CREATE TABLE lives_in (stuid VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE dorm_amenity (amenid VARCHAR(255), amenity_name VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 1 | 1 | {
"split": "train",
"row_index": 3283
} |
Find the name of amenities of the dorm where the student with last name Smith is living in. | SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith' | CREATE TABLE student (stuid VARCHAR(255), lname VARCHAR(255)); CREATE TABLE dorm (dormid VARCHAR(255), name VARCHAR(255)); CREATE TABLE lives_in (dormid VARCHAR(255), stuid VARCHAR(255)); CREATE TABLE has_amenity (dormid VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE dorm_amenity (amenity_name VARCHAR(255), amenid VA... | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 5 | 0 | 0 | {
"split": "train",
"row_index": 3284
} |
Find the emails and phone numbers of all the customers, ordered by email address and phone number. | SELECT email_address, phone_number FROM customers ORDER BY email_address, phone_number | CREATE TABLE customers (email_address VARCHAR(255), phone_number VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 3285
} |
Which city has the least number of customers whose type code is "Good Credit Rating"? | SELECT town_city FROM customers WHERE customer_type_code = 'Good Credit Rating' GROUP BY town_city ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE customers (town_city VARCHAR(255), customer_type_code VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 3286
} |
List the name of all products along with the number of complaints that they have received. | SELECT t1.product_name, COUNT(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name | CREATE TABLE products (product_name VARCHAR(255), product_id VARCHAR(255)); CREATE TABLE complaints (product_id VARCHAR(255), complaint_text VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 3287
} |
Find the emails of customers who has filed a complaints of the product with the most complaints. | SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE customers (email_address VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE complaints (customer_id VARCHAR(255), complaint_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 3288
} |
Which products has been complained by the customer who has filed least amount of complaints? | SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE customers (customer_id VARCHAR(255), email_address VARCHAR(255)); CREATE TABLE products (product_name VARCHAR(255), product_id VARCHAR(255)); CREATE TABLE complaints (product_id VARCHAR(255), complaint_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 5 | 0 | 0 | {
"split": "train",
"row_index": 3289
} |
What is the phone number of the customer who has filed the most recent complaint? | SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1 | CREATE TABLE customers (phone_number VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE complaints (customer_id VARCHAR(255), date_complaint_raised VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 3290
} |
Find the email and phone number of the customers who have never filed a complaint before. | SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints) | CREATE TABLE complaints (email_address VARCHAR(255), phone_number VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customers (email_address VARCHAR(255), phone_number VARCHAR(255), customer_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 1 | {
"split": "train",
"row_index": 3291
} |
Find the phone number of all the customers and staff. | SELECT phone_number FROM customers UNION SELECT phone_number FROM staff | CREATE TABLE staff (phone_number VARCHAR(255), staff_name VARCHAR(255)); CREATE TABLE customers (phone_number VARCHAR(255), customer_name VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 1 | 0 | {
"split": "train",
"row_index": 3292
} |
What is the description of the product named "Chocolate"? | SELECT product_description FROM products WHERE product_name = 'Chocolate' | CREATE TABLE products (product_description VARCHAR(255), product_name VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 3293
} |
Find the name and category of the most expensive product. | SELECT product_name, product_category_code FROM products ORDER BY product_price DESC LIMIT 1 | CREATE TABLE products (product_name VARCHAR(255), product_category_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": 3294
} |
Find the prices of products which has never received a single complaint. | SELECT product_price FROM products WHERE NOT product_id IN (SELECT product_id FROM complaints) | CREATE TABLE products (product_price VARCHAR(255), product_id VARCHAR(255)); CREATE TABLE complaints (product_price VARCHAR(255), product_id VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 3295
} |
What is the average price of the products for each category? | SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code | CREATE TABLE products (product_category_code VARCHAR(255), product_price INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 3296
} |
Find the last name of the staff member who processed the complaint of the cheapest product. | SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price LIMIT 1 | CREATE TABLE products (product_id VARCHAR(255), product_price VARCHAR(255)); CREATE TABLE complaints (staff_id VARCHAR(255), product_id VARCHAR(255)); CREATE TABLE staff (last_name VARCHAR(255), staff_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 3297
} |
Which complaint status has more than 3 records on file? | SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING COUNT(*) > 3 | CREATE TABLE complaints (complaint_status_code VARCHAR(255), complaint_id VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 3298
} |
Find the last name of the staff whose email address contains "wrau". | SELECT last_name FROM staff WHERE email_address LIKE '%wrau%' | CREATE TABLE staff (last_name VARCHAR(255), email_address VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 3299
} |
How many customers are there in the customer type with the most customers? | SELECT COUNT(*) FROM customers GROUP BY customer_type_code ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE customers (customer_type_code 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": 3300
} |
What is the last name of the staff who has handled the first ever complaint? | SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1 | CREATE TABLE staff (last_name VARCHAR(255), staff_id VARCHAR(255)); CREATE TABLE complaints (staff_id VARCHAR(255), date_complaint_raised VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 3301
} |
How many distinct complaint type codes are there in the database? | SELECT COUNT(DISTINCT complaint_type_code) FROM complaints | CREATE TABLE complaints (complaint_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": 3302
} |
Find the address line 1 and 2 of the customer with email "vbogisich@example.org". | SELECT address_line_1, address_line_2 FROM customers WHERE email_address = 'vbogisich@example.org' | CREATE TABLE customers (address_line_1 VARCHAR(255), address_line_2 VARCHAR(255), email_address VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 3303
} |
Find the number of complaints with Product Failure type for each complaint status. | SELECT complaint_status_code, COUNT(*) FROM complaints WHERE complaint_type_code = 'Product Failure' GROUP BY complaint_status_code | CREATE TABLE complaints (complaint_status_code VARCHAR(255), complaint_type_code VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 3304
} |
What is first names of the top 5 staff who have handled the greatest number of complaints? | SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY COUNT(*) LIMIT 5 | CREATE TABLE complaints (staff_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE staff (first_name VARCHAR(255), staff_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 3305
} |
Which state has the most customers? | SELECT state FROM customers GROUP BY state ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE customers (state 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": 3306
} |
How many submissions are there? | SELECT COUNT(*) FROM submission | CREATE TABLE submission (Id VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 3307
} |
List the authors of submissions in ascending order of scores. | SELECT Author FROM submission ORDER BY Scores | CREATE TABLE submission (Author VARCHAR(255), Scores VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 3308
} |
What are the authors of submissions and their colleges? | SELECT Author, College FROM submission | CREATE TABLE submission (Author VARCHAR(255), College VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 1 | {
"split": "train",
"row_index": 3309
} |
Show the names of authors from college "Florida" or "Temple" | SELECT Author FROM submission WHERE College = 'Florida' OR College = 'Temple' | CREATE TABLE submission (Author VARCHAR(255), College VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 3310
} |
What is the average score of submissions? | SELECT AVG(Scores) FROM submission | CREATE TABLE submission (Scores INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 3311
} |
What is the author of the submission with the highest score? | SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1 | CREATE TABLE submission (Author VARCHAR(255), Scores VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 3312
} |
Show different colleges along with the number of authors of submission from each college. | SELECT College, COUNT(*) FROM submission GROUP BY College | CREATE TABLE submission (College 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": 3313
} |
Show the most common college of authors of submissions. | SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE submission (College 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": 3314
} |
Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80. | SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80 | CREATE TABLE submission (College VARCHAR(255), Scores INTEGER); | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 3315
} |
Show the authors of submissions and the acceptance results of their submissions. | SELECT T2.Author, T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID | CREATE TABLE acceptance (Result VARCHAR(255), Submission_ID VARCHAR(255)); CREATE TABLE submission (Author VARCHAR(255), Submission_ID VARCHAR(255)); | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 3316
} |
Show the result of the submission with the highest score. | SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1 | CREATE TABLE acceptance (Result VARCHAR(255), Submission_ID VARCHAR(255)); CREATE TABLE submission (Submission_ID VARCHAR(255), Scores VARCHAR(255)); | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 3317
} |
Show each author and the number of workshops they submitted to. | SELECT T2.Author, COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author | CREATE TABLE submission (Author VARCHAR(255), Submission_ID VARCHAR(255)); CREATE TABLE acceptance (workshop_id VARCHAR(255), Submission_ID VARCHAR(255)); | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 3318
} |
Show the authors who have submissions to more than one workshop. | SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1 | CREATE TABLE submission (Author VARCHAR(255), Submission_ID VARCHAR(255)); CREATE TABLE acceptance (Submission_ID VARCHAR(255), workshop_id VARCHAR(255)); | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 3319
} |
Show the date and venue of each workshop in ascending alphabetical order of the venue. | SELECT Date, Venue FROM workshop ORDER BY Venue | CREATE TABLE workshop (Date VARCHAR(255), Venue VARCHAR(255)); | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 3320
} |
List the authors who do not have submission to any workshop. | SELECT Author FROM submission WHERE NOT Submission_ID IN (SELECT Submission_ID FROM acceptance) | CREATE TABLE acceptance (Author VARCHAR(255), Submission_ID VARCHAR(255)); CREATE TABLE submission (Author VARCHAR(255), Submission_ID VARCHAR(255)); | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 3321
} |
Find the number of investors in total. | SELECT COUNT(*) FROM INVESTORS | CREATE TABLE INVESTORS (Id VARCHAR(255), name VARCHAR(255)); | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 3322
} |
Show all investor details. | SELECT Investor_details FROM INVESTORS | CREATE TABLE INVESTORS (Investor_details 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": 3323
} |
Show all distinct lot details. | SELECT DISTINCT lot_details FROM LOTS | CREATE TABLE LOTS (lot_details 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": 3324
} |
Show the maximum amount of transaction. | SELECT MAX(amount_of_transaction) FROM TRANSACTIONS | CREATE TABLE TRANSACTIONS (amount_of_transaction INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT); | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 3325
} |
Show all date and share count of transactions. | SELECT date_of_transaction, share_count FROM TRANSACTIONS | CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR(255), share_count VARCHAR(255)); | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 1 | {
"split": "train",
"row_index": 3326
} |
What is the total share of transactions? | SELECT SUM(share_count) FROM TRANSACTIONS | CREATE TABLE TRANSACTIONS (share_count INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT); | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 3327
} |
Show all transaction ids with transaction code 'PUR'. | SELECT transaction_id FROM TRANSACTIONS WHERE transaction_type_code = 'PUR' | CREATE TABLE TRANSACTIONS (transaction_id VARCHAR(255), transaction_type_code VARCHAR(255)); | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 3328
} |
Show all dates of transactions whose type code is "SALE". | SELECT date_of_transaction FROM TRANSACTIONS WHERE transaction_type_code = 'SALE' | CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR(255), transaction_type_code VARCHAR(255)); | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 3329
} |
Show the average amount of transactions with type code "SALE". | SELECT AVG(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = 'SALE' | CREATE TABLE TRANSACTIONS (amount_of_transaction INTEGER, transaction_type_code VARCHAR(255)); | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 3330
} |
Show the description of transaction type with code "PUR". | SELECT transaction_type_description FROM Ref_Transaction_Types WHERE transaction_type_code = 'PUR' | CREATE TABLE Ref_Transaction_Types (transaction_type_description VARCHAR(255), transaction_type_code VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 3331
} |
Show the minimum amount of transactions whose type code is "PUR" and whose share count is bigger than 50. | SELECT MIN(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = 'PUR' AND share_count > 50 | CREATE TABLE TRANSACTIONS (amount_of_transaction INTEGER, transaction_type_code VARCHAR(255), share_count 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": 3332
} |
Show the maximum share count of transactions where the amount is smaller than 10000 | SELECT MAX(share_count) FROM TRANSACTIONS WHERE amount_of_transaction < 10000 | CREATE TABLE TRANSACTIONS (share_count INTEGER, amount_of_transaction INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 3333
} |
Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000. | SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count > 100 OR amount_of_transaction > 1000 | CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR(255), share_count VARCHAR(255), amount_of_transaction 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": 3334
} |
Show the transaction type descriptions and dates if the share count is smaller than 10. | SELECT T1.transaction_type_description, T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10 | CREATE TABLE Ref_Transaction_Types (transaction_type_description VARCHAR(255), transaction_type_code VARCHAR(255)); CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR(255), transaction_type_code VARCHAR(255), share_count INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 3335
} |
Show details of all investors if they make any transaction with share count greater than 100. | SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100 | CREATE TABLE TRANSACTIONS (investor_id VARCHAR(255), share_count INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE INVESTORS (Investor_details VARCHAR(255), investor_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 3336
} |
How many distinct transaction types are used in the transactions? | SELECT COUNT(DISTINCT transaction_type_code) FROM TRANSACTIONS | CREATE TABLE TRANSACTIONS (transaction_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": 3337
} |
Return the lot details and investor ids. | SELECT lot_details, investor_id FROM LOTS | CREATE TABLE LOTS (lot_details VARCHAR(255), investor_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 1 | {
"split": "train",
"row_index": 3338
} |
Return the lot details of lots that belong to investors with details "l"? | SELECT T2.lot_details FROM INVESTORS AS T1 JOIN LOTS AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = 'l' | CREATE TABLE LOTS (lot_details VARCHAR(255), investor_id VARCHAR(255)); CREATE TABLE INVESTORS (investor_id VARCHAR(255), Investor_details VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 3339
} |
What are the purchase details of transactions with amount bigger than 10000? | SELECT T1.purchase_details FROM PURCHASES AS T1 JOIN TRANSACTIONS AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 | CREATE TABLE PURCHASES (purchase_details VARCHAR(255), purchase_transaction_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE TRANSACTIONS (transaction_id VARCHAR(255), amount_of_transaction INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 3340
} |
What are the sale details and dates of transactions with amount smaller than 3000? | SELECT T1.sales_details, T2.date_of_transaction FROM SALES AS T1 JOIN TRANSACTIONS AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 | CREATE TABLE SALES (sales_details VARCHAR(255), sales_transaction_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR(255), transaction_id VARCHAR(255), amount_of_transaction INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 3341
} |
What are the lot details of lots associated with transactions with share count smaller than 50? | SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50 | CREATE TABLE LOTS (lot_details VARCHAR(255), lot_id VARCHAR(255)); CREATE TABLE TRANSACTIONS_LOTS (transaction_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE TRANSACTIONS (transaction_id VARCHAR(255), share_count INTEGER) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 3342
} |
What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is "PUR"? | SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count > 100 AND T3.transaction_type_code = 'PUR' | CREATE TABLE LOTS (lot_details VARCHAR(255), lot_id VARCHAR(255)); CREATE TABLE TRANSACTIONS_LOTS (transaction_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE TRANSACTIONS (transaction_id VARCHAR(255), share_count VARCHAR(255), transaction_type_code VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 1 | {
"split": "train",
"row_index": 3343
} |
Show the average transaction amount for different transaction types. | SELECT transaction_type_code, AVG(amount_of_transaction) FROM TRANSACTIONS GROUP BY transaction_type_code | CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR(255), amount_of_transaction INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 3344
} |
Show the maximum and minimum share count of different transaction types. | SELECT transaction_type_code, MAX(share_count), MIN(share_count) FROM TRANSACTIONS GROUP BY transaction_type_code | CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR(255), share_count INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 2 | {
"split": "train",
"row_index": 3345
} |
Show the average share count of transactions for different investors. | SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id | CREATE TABLE TRANSACTIONS (investor_id VARCHAR(255), share_count INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 3346
} |
Show the average share count of transactions each each investor, ordered by average share count. | SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER BY AVG(share_count) | CREATE TABLE TRANSACTIONS (investor_id VARCHAR(255), share_count INTEGER) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 2 | {
"split": "train",
"row_index": 3347
} |
Show the average amount of transactions for different investors. | SELECT investor_id, AVG(amount_of_transaction) FROM TRANSACTIONS GROUP BY investor_id | CREATE TABLE TRANSACTIONS (investor_id VARCHAR(255), amount_of_transaction INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 3348
} |
Show the number of transactions with transaction type code "SALE" for different investors if it is larger than 0. | SELECT investor_id, COUNT(*) FROM TRANSACTIONS WHERE transaction_type_code = 'SALE' GROUP BY investor_id | CREATE TABLE TRANSACTIONS (investor_id VARCHAR(255), transaction_type_code VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 3351
} |
Show the number of transactions for different investors. | SELECT investor_id, COUNT(*) FROM TRANSACTIONS GROUP BY investor_id | CREATE TABLE TRANSACTIONS (investor_id VARCHAR(255), share_count INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 3352
} |
Show the transaction type code that occurs the fewest times. | SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR(255), transaction_type_description VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 3353
} |
Show the transaction type code that occurs the most frequently. | SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR(255), transaction_type_description VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 3354
} |
Show the description of the transaction type that occurs most frequently. | SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code GROUP BY T1.transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE TRANSACTIONS (transaction_type_code VARCHAR(255), transaction_id INTEGER); CREATE TABLE Ref_Transaction_Types (transaction_type_description VARCHAR(255), transaction_type_code VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 3355
} |
Show the id and details of the investor that has the largest number of transactions. | SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE TRANSACTIONS (investor_id VARCHAR(255), transaction_id INTEGER); CREATE TABLE INVESTORS (Investor_details VARCHAR(255), investor_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 3356
} |
Show the id and details for the investors who have the top 3 number of transactions. | SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3 | CREATE TABLE TRANSACTIONS (investor_id VARCHAR(255), transaction_id INTEGER); CREATE TABLE INVESTORS (Investor_details VARCHAR(255), investor_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 3357
} |
Show the ids of the investors who have at least two transactions. | SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*) >= 2 | CREATE TABLE TRANSACTIONS (investor_id VARCHAR(255), transaction_id INTEGER); CREATE TABLE INVESTORS (investor_id VARCHAR(255), investor_name VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 3358
} |
Show the ids and details of the investors who have at least two transactions with type code "SALE". | SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = 'SALE' GROUP BY T2.investor_id HAVING COUNT(*) >= 2 | CREATE TABLE TRANSACTIONS (investor_id VARCHAR(255), transaction_type_code VARCHAR(255)); CREATE TABLE INVESTORS (Investor_details VARCHAR(255), investor_id VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 1 | {
"split": "train",
"row_index": 3359
} |
What are the dates of transactions with at least 100 share count or amount bigger than 100? | SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_transaction >= 100 | CREATE TABLE TRANSACTIONS (date_of_transaction VARCHAR(255), share_count VARCHAR(255), amount_of_transaction VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 3360
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.