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 buildings which have rooms with capacity more than 50.
SELECT DISTINCT building FROM classroom WHERE capacity > 50
CREATE TABLE classroom (building VARCHAR(255), capacity INTEGER, room_number VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 767 }
Count the number of rooms that are not in the Lamberton building.
SELECT COUNT(*) FROM classroom WHERE building <> 'Lamberton'
CREATE TABLE classroom (building VARCHAR(255), room_number VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 768 }
What is the name and building of the departments whose budget is more than the average budget?
SELECT dept_name, building FROM department WHERE budget > (SELECT AVG(budget) FROM department)
CREATE TABLE department (dept_name VARCHAR(255), building VARCHAR(255), budget INTEGER)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 769 }
Find the room number of the rooms which can sit 50 to 100 students and their buildings.
SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
CREATE TABLE classroom (building VARCHAR(255), room_number VARCHAR(255), capacity INTEGER)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 770 }
Find the name and building of the department with the highest budget.
SELECT dept_name, building FROM department ORDER BY budget DESC LIMIT 1
CREATE TABLE department (dept_name VARCHAR(255), building VARCHAR(255), budget VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 771 }
What is the name of the student who has the highest total credits in the History department.
SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1
CREATE TABLE student (name VARCHAR(255), dept_name VARCHAR(255), tot_cred VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 772 }
How many rooms does the Lamberton building have?
SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton'
CREATE TABLE classroom (building VARCHAR(255), room_number VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 773 }
How many students have advisors?
SELECT COUNT(DISTINCT s_id) FROM advisor
CREATE TABLE advisor (s_id 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": 774 }
How many departments offer courses?
SELECT COUNT(DISTINCT dept_name) FROM course
CREATE TABLE course (dept_name VARCHAR(255), course_id VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 775 }
How many different courses offered by Physics department?
SELECT COUNT(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'
CREATE TABLE course (course_id VARCHAR(255), dept_name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 776 }
Find the title of courses that have two prerequisites?
SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) = 2
CREATE TABLE prereq (course_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE course (title VARCHAR(255), course_id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 777 }
Find the title, credit, and department name of courses that have more than one prerequisites?
SELECT T1.title, T1.credits, T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) > 1
CREATE TABLE prereq (course_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE course (title VARCHAR(255), credits VARCHAR(255), dept_name VARCHAR(255), course_id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 778 }
How many courses that do not have prerequisite?
SELECT COUNT(*) FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)
CREATE TABLE prereq (course_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE course (course_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 779 }
Find the name of the courses that do not have any prerequisite?
SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)
CREATE TABLE prereq (title VARCHAR(255), course_id VARCHAR(255)); CREATE TABLE course (title VARCHAR(255), course_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 780 }
How many different instructors have taught some course?
SELECT COUNT(DISTINCT id) FROM teaches
CREATE TABLE teaches (id VARCHAR(255), course_id VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 781 }
Find the total budgets of the Marketing or Finance department.
SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'
CREATE TABLE department (budget INTEGER, dept_name VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 782 }
Find the department name of the instructor whose name contains 'Soisalon'.
SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'
CREATE TABLE instructor (dept_name VARCHAR(255), name VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 783 }
How many rooms whose capacity is less than 50 does the Lamberton building have?
SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50
CREATE TABLE classroom (building VARCHAR(255), capacity VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 784 }
Find the name and budget of departments whose budgets are more than the average budget.
SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department)
CREATE TABLE department (dept_name VARCHAR(255), budget INTEGER)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 785 }
what is the name of the instructor who is in Statistics department and earns the lowest salary?
SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1
CREATE TABLE instructor (name VARCHAR(255), dept_name VARCHAR(255), salary VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 786 }
Find the title of course that is provided by both Statistics and Psychology departments.
SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'
CREATE TABLE course (title VARCHAR(255), dept_name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 787 }
Find the title of course that is provided by Statistics but not Psychology departments.
SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'
CREATE TABLE course (title VARCHAR(255), dept_name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 788 }
Find the id of instructors who taught a class in Fall 2009 but not in Spring 2010.
SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
CREATE TABLE teaches (id VARCHAR(255), semester VARCHAR(255), YEAR VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 789 }
Find the names of the top 3 departments that provide the largest amount of courses?
SELECT dept_name FROM course GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 3
CREATE TABLE course (dept_name 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": 791 }
Find the name of the department that offers the highest total credits?
SELECT dept_name FROM course GROUP BY dept_name ORDER BY SUM(credits) DESC LIMIT 1
CREATE TABLE course (dept_name VARCHAR(255), credits INTEGER)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 792 }
List the names of all courses ordered by their titles and credits.
SELECT title FROM course ORDER BY title, credits
CREATE TABLE course (title VARCHAR(255), credits VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 793 }
Which department has the lowest budget?
SELECT dept_name FROM department ORDER BY budget LIMIT 1
CREATE TABLE department (dept_name VARCHAR(255), budget VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 794 }
List the names and buildings of all departments sorted by the budget from large to small.
SELECT dept_name, building FROM department ORDER BY budget DESC
CREATE TABLE department (dept_name VARCHAR(255), building VARCHAR(255), budget VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 795 }
Who is the instructor with the highest salary?
SELECT name FROM instructor ORDER BY salary DESC LIMIT 1
CREATE TABLE instructor (name VARCHAR(255), salary 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": 796 }
Find the name of the students and their department names sorted by their total credits in ascending order.
SELECT name, dept_name FROM student ORDER BY tot_cred
CREATE TABLE student (name VARCHAR(255), dept_name VARCHAR(255), tot_cred VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 798 }
Find the name of instructors who are advising more than one student.
SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING COUNT(*) > 1
CREATE TABLE advisor (i_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE instructor (name VARCHAR(255), id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 800 }
Find the name of the students who have more than one advisor?
SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING COUNT(*) > 1
CREATE TABLE student (name VARCHAR(255), id VARCHAR(255)); CREATE TABLE advisor (s_id 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": 801 }
Find the number of rooms with more than 50 capacity for each building.
SELECT COUNT(*), building FROM classroom WHERE capacity > 50 GROUP BY building
CREATE TABLE classroom (building VARCHAR(255), capacity INTEGER)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 802 }
Find the maximum and average capacity among rooms in each building.
SELECT MAX(capacity), AVG(capacity), building FROM classroom GROUP BY building
CREATE TABLE classroom (building VARCHAR(255), capacity INTEGER)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
2
{ "split": "train", "row_index": 803 }
Find the title of the course that is offered by more than one department.
SELECT title FROM course GROUP BY title HAVING COUNT(*) > 1
CREATE TABLE course (title 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": 804 }
Find the total credits of courses provided by different department.
SELECT SUM(credits), dept_name FROM course GROUP BY dept_name
CREATE TABLE course (dept_name VARCHAR(255), credits INTEGER)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 805 }
Find the minimum salary for the departments whose average salary is above the average payment of all instructors.
SELECT MIN(salary), dept_name FROM instructor GROUP BY dept_name HAVING AVG(salary) > (SELECT AVG(salary) FROM instructor)
CREATE TABLE instructor (dept_name VARCHAR(255), salary INTEGER)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 806 }
Find the number of courses provided in each semester and year.
SELECT COUNT(*), semester, YEAR FROM SECTION GROUP BY semester, YEAR
CREATE TABLE SECTION (semester VARCHAR(255), YEAR VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
2
{ "split": "train", "row_index": 807 }
Find the year which offers the largest number of courses.
SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE SECTION (YEAR 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": 808 }
Find the year and semester when offers the largest number of courses.
SELECT semester, YEAR FROM SECTION GROUP BY semester, YEAR ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE SECTION (semester VARCHAR(255), YEAR VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
2
{ "split": "train", "row_index": 809 }
Find the name of department has the highest amount of students?
SELECT dept_name FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE student (dept_name 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": 810 }
Find the total number of students in each department.
SELECT COUNT(*), dept_name FROM student GROUP BY dept_name
CREATE TABLE student (dept_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": 811 }
Find the semester and year which has the least number of student taking any class.
SELECT semester, YEAR FROM takes GROUP BY semester, YEAR ORDER BY COUNT(*) LIMIT 1
CREATE TABLE takes (semester VARCHAR(255), YEAR VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
2
{ "split": "train", "row_index": 812 }
Find the name and salary of the instructors who are advisors of any student from History department?
SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'History'
CREATE TABLE instructor (name VARCHAR(255), salary VARCHAR(255), id VARCHAR(255)); CREATE TABLE advisor (i_id VARCHAR(255), s_id VARCHAR(255)); CREATE TABLE student (id VARCHAR(255), dept_name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
1
{ "split": "train", "row_index": 814 }
Find the id of the courses that do not have any prerequisite?
SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq
CREATE TABLE prereq (course_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE course (course_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
1
0
{ "split": "train", "row_index": 815 }
Find the names of students who have taken any course in the fall semester of year 2003.
SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND YEAR = 2003)
CREATE TABLE student (name VARCHAR(255), id VARCHAR(255), semester VARCHAR(255), YEAR VARCHAR(255)); CREATE TABLE takes (name VARCHAR(255), id VARCHAR(255), semester VARCHAR(255), YEAR VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 818 }
Find the name of the instructors who taught C Programming course before.
SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'
CREATE TABLE teaches (id VARCHAR(255), course_id VARCHAR(255)); CREATE TABLE course (course_id VARCHAR(255), title VARCHAR(255)); CREATE TABLE instructor (name VARCHAR(255), id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 820 }
Find the name and salary of instructors who are advisors of the students from the Math department.
SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math'
CREATE TABLE instructor (name VARCHAR(255), salary VARCHAR(255), id VARCHAR(255)); CREATE TABLE advisor (i_id VARCHAR(255), s_id VARCHAR(255)); CREATE TABLE student (id VARCHAR(255), dept_name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
1
{ "split": "train", "row_index": 821 }
Find the name of instructors who are advisors of the students from the Math department, and sort the results by students' total credit.
SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' ORDER BY T3.tot_cred
CREATE TABLE student (id VARCHAR(255), dept_name VARCHAR(255), tot_cred VARCHAR(255)); CREATE TABLE advisor (i_id VARCHAR(255), s_id VARCHAR(255)); CREATE TABLE instructor (name VARCHAR(255), id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 822 }
Find the name of instructor who is the advisor of the student who has the highest number of total credits.
SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1
CREATE TABLE student (id VARCHAR(255), tot_cred VARCHAR(255)); CREATE TABLE advisor (i_id VARCHAR(255), s_id VARCHAR(255)); CREATE TABLE instructor (name VARCHAR(255), id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 824 }
Find the name of instructors who didn't teach any courses?
SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches)
CREATE TABLE teaches (name VARCHAR(255), id VARCHAR(255)); CREATE TABLE instructor (name VARCHAR(255), id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 825 }
Find the id of instructors who didn't teach any courses?
SELECT id FROM instructor EXCEPT SELECT id FROM teaches
CREATE TABLE teaches (name VARCHAR(255), id VARCHAR(255)); CREATE TABLE instructor (id VARCHAR(255), name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
1
0
{ "split": "train", "row_index": 826 }
Find the names of instructors who didn't each any courses in any Spring semester.
SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches WHERE semester = 'Spring')
CREATE TABLE teaches (name VARCHAR(255), id VARCHAR(255), semester VARCHAR(255)); CREATE TABLE instructor (name VARCHAR(255), id VARCHAR(255), semester VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 827 }
Find the name of the department which has the highest average salary of professors.
SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC LIMIT 1
CREATE TABLE instructor (dept_name VARCHAR(255), salary INTEGER)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 828 }
Find the number and averaged salary of all instructors who are in the department with the highest budget.
SELECT AVG(T1.salary), COUNT(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name ORDER BY T2.budget DESC LIMIT 1
CREATE TABLE department (dept_name VARCHAR(255), budget VARCHAR(255)); CREATE TABLE instructor (salary INTEGER, dept_name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
2
{ "split": "train", "row_index": 829 }
Find the name of students who didn't take any course from Biology department.
SELECT name FROM student WHERE NOT id IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology')
CREATE TABLE student (name VARCHAR(255), id VARCHAR(255)); CREATE TABLE course (course_id VARCHAR(255), dept_name VARCHAR(255)); CREATE TABLE takes (id VARCHAR(255), course_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 831 }
Find the total number of students and total number of instructors for each department.
SELECT COUNT(DISTINCT T2.id), COUNT(DISTINCT T3.id), T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name
CREATE TABLE department (dept_name VARCHAR(255), building VARCHAR(255)); CREATE TABLE student (id VARCHAR(255), dept_name VARCHAR(255)); CREATE TABLE instructor (dept_name VARCHAR(255), id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
2
{ "split": "train", "row_index": 832 }
Find the name of students who have taken the prerequisite course of the course with title International Finance.
SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id = T4.course_id WHERE T3.title = 'International Finance')
CREATE TABLE student (name VARCHAR(255), id VARCHAR(255)); CREATE TABLE course (course_id VARCHAR(255), title VARCHAR(255)); CREATE TABLE prereq (prereq_id VARCHAR(255), course_id VARCHAR(255)); CREATE TABLE takes (id VARCHAR(255), course_id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
1
0
{ "split": "train", "row_index": 833 }
Find the name and salary of instructors whose salary is below the average salary of the instructors in the Physics department.
SELECT name, salary FROM instructor WHERE salary < (SELECT AVG(salary) FROM instructor WHERE dept_name = 'Physics')
CREATE TABLE instructor (name VARCHAR(255), salary INTEGER, dept_name VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 834 }
Find the name of students who took some course offered by Statistics department.
SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'
CREATE TABLE student (name VARCHAR(255), id VARCHAR(255)); CREATE TABLE takes (course_id VARCHAR(255), id VARCHAR(255)); CREATE TABLE course (course_id VARCHAR(255), dept_name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 835 }
Find the building, room number, semester and year of all courses offered by Psychology department sorted by course titles.
SELECT T2.building, T2.room_number, T2.semester, T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title
CREATE TABLE SECTION (building VARCHAR(255), room_number VARCHAR(255), semester VARCHAR(255), year VARCHAR(255), course_id VARCHAR(255)); CREATE TABLE course (course_id VARCHAR(255), dept_name VARCHAR(255), title VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
1
{ "split": "train", "row_index": 836 }
Find the names of all instructors in computer science department
SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.'
CREATE TABLE instructor (name VARCHAR(255), dept_name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 837 }
Find the names of all instructors in Comp. Sci. department with salary > 80000.
SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000
CREATE TABLE instructor (name VARCHAR(255), dept_name VARCHAR(255), salary VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 838 }
Find the names of all instructors whose name includes the substring “dar”.
SELECT name FROM instructor WHERE name LIKE '%dar%'
CREATE TABLE instructor (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": 841 }
List in alphabetic order the names of all distinct instructors.
SELECT DISTINCT name FROM instructor ORDER BY name
CREATE TABLE instructor (name 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": 842 }
Find courses that ran in Fall 2009 or in Spring 2010.
SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 UNION SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
CREATE TABLE SECTION (course_id VARCHAR(255), semester VARCHAR(255), YEAR VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 843 }
Find courses that ran in Fall 2009 and in Spring 2010.
SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 INTERSECT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
CREATE TABLE SECTION (course_id VARCHAR(255), semester VARCHAR(255), YEAR VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 844 }
Find courses that ran in Fall 2009 but not in Spring 2010.
SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
CREATE TABLE SECTION (course_id VARCHAR(255), semester VARCHAR(255), YEAR VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 845 }
Find the salaries of all distinct instructors that are less than the largest salary.
SELECT DISTINCT salary FROM instructor WHERE salary < (SELECT MAX(salary) FROM instructor)
CREATE TABLE instructor (salary INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 846 }
Find the total number of instructors who teach a course in the Spring 2010 semester.
SELECT COUNT(DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
CREATE TABLE teaches (ID VARCHAR(255), semester VARCHAR(255), YEAR VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 847 }
Find the names and average salaries of all departments whose average salary is greater than 42000.
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name HAVING AVG(salary) > 42000
CREATE TABLE instructor (dept_name VARCHAR(255), salary INTEGER)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 848 }
Find names of instructors with salary greater than that of some (at least one) instructor in the Biology department.
SELECT name FROM instructor WHERE salary > (SELECT MIN(salary) FROM instructor WHERE dept_name = 'Biology')
CREATE TABLE instructor (name VARCHAR(255), salary INTEGER, dept_name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 849 }
Find the names of all instructors whose salary is greater than the salary of all instructors in the Biology department.
SELECT name FROM instructor WHERE salary > (SELECT MAX(salary) FROM instructor WHERE dept_name = 'Biology')
CREATE TABLE instructor (name VARCHAR(255), salary INTEGER, dept_name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 850 }
How many debates are there?
SELECT COUNT(*) FROM debate
CREATE TABLE debate (Id VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 851 }
List the venues of debates in ascending order of the number of audience.
SELECT Venue FROM debate ORDER BY Num_of_Audience
CREATE TABLE debate (Venue VARCHAR(255), Num_of_Audience VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 852 }
What are the date and venue of each debate?
SELECT Date, Venue FROM debate
CREATE TABLE debate (Date VARCHAR(255), Venue VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
1
{ "split": "train", "row_index": 853 }
List the dates of debates with number of audience bigger than 150
SELECT Date FROM debate WHERE Num_of_Audience > 150
CREATE TABLE debate (Date VARCHAR(255), Num_of_Audience INTEGER)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 854 }
Show the names of people aged either 35 or 36.
SELECT Name FROM people WHERE Age = 35 OR Age = 36
CREATE TABLE people (Name VARCHAR(255), Age VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 855 }
What is the party of the youngest people?
SELECT Party FROM people ORDER BY Age LIMIT 1
CREATE TABLE people (Party VARCHAR(255), Age VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 856 }
Show different parties of people along with the number of people in each party.
SELECT Party, COUNT(*) FROM people GROUP BY Party
CREATE TABLE people (Party 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": 857 }
Show the party that has the most people.
SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE people (Party 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": 858 }
Show the distinct venues of debates
SELECT DISTINCT Venue FROM debate
CREATE TABLE debate (Venue 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": 859 }
Show the names of people, and dates and venues of debates they are on the affirmative side.
SELECT T3.Name, T2.Date, T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID
CREATE TABLE people (Name VARCHAR(255), People_ID VARCHAR(255)); CREATE TABLE debate (Date VARCHAR(255), Venue VARCHAR(255), Debate_ID VARCHAR(255)); CREATE TABLE debate_people (Debate_ID VARCHAR(255), Affirmative VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 860 }
Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name.
SELECT T3.Name, T2.Date, T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Negative = T3.People_ID ORDER BY T3.Name
CREATE TABLE people (Name VARCHAR(255), People_ID VARCHAR(255)); CREATE TABLE debate (Date VARCHAR(255), Venue VARCHAR(255), Debate_ID VARCHAR(255)); CREATE TABLE debate_people (Debate_ID VARCHAR(255), Negative VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
1
{ "split": "train", "row_index": 861 }
Show the names of people that are on affirmative side of debates with number of audience bigger than 200.
SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID WHERE T2.Num_of_Audience > 200
CREATE TABLE people (Name VARCHAR(255), People_ID VARCHAR(255)); CREATE TABLE debate (Debate_ID VARCHAR(255), Num_of_Audience INTEGER); CREATE TABLE debate_people (Debate_ID VARCHAR(255), Affirmative VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 862 }
Show the names of people and the number of times they have been on the affirmative side of debates.
SELECT T2.Name, COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name
CREATE TABLE people (Name VARCHAR(255), People_ID VARCHAR(255)); CREATE TABLE debate_people (Affirmative 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": 863 }
Show the names of people who have been on the negative side of debates at least twice.
SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID GROUP BY T2.Name HAVING COUNT(*) >= 2
CREATE TABLE debate_people (Negative VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE people (Name VARCHAR(255), People_ID VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 864 }
List the names of people that have not been on the affirmative side of debates.
SELECT Name FROM people WHERE NOT People_id IN (SELECT Affirmative FROM debate_people)
CREATE TABLE debate_people (Name VARCHAR(255), People_id VARCHAR(255), Affirmative VARCHAR(255)); CREATE TABLE people (Name VARCHAR(255), People_id VARCHAR(255), Affirmative VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 865 }
List the names of all the customers in alphabetical order.
SELECT customer_details FROM customers ORDER BY customer_details
CREATE TABLE customers (customer_details 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": 866 }
Which type of policy is most frequently used? Give me the policy type code.
SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE policies (policy_type_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": 868 }
Find all the policy types that are used by more than 2 customers.
SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING COUNT(*) > 2
CREATE TABLE policies (policy_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": 869 }
Find the total and average amount paid in claim headers.
SELECT SUM(amount_piad), AVG(amount_piad) FROM claim_headers
CREATE TABLE claim_headers (amount_piad INTEGER, id INTEGER PRIMARY KEY AUTOINCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
2
{ "split": "train", "row_index": 870 }
How many claim processing stages are there in total?
SELECT COUNT(*) FROM claims_processing_stages
CREATE TABLE claims_processing_stages (Id VARCHAR(255), description VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 875 }
What is the name of the claim processing stage that most of the claims are on?
SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id = t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE claims_processing (claim_stage_id VARCHAR(255), id INTEGER PRIMARY KEY AUTOINCREMENT); CREATE TABLE claims_processing_stages (claim_status_name VARCHAR(255), claim_stage_id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 876 }
Find the names of customers whose name contains "Diana".
SELECT customer_details FROM customers WHERE customer_details LIKE '%Diana%'
CREATE TABLE customers (customer_details VARCHAR(255), id INTEGER PRIMARY KEY AUTOINCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 877 }
Find the names of the customers who have an deputy policy.
SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = 'Deputy'
CREATE TABLE policies (customer_id VARCHAR(255), policy_type_code VARCHAR(255)); CREATE TABLE customers (customer_details VARCHAR(255), customer_id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 878 }
Find the names of customers who either have an deputy policy or uniformed policy.
SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = 'Deputy' OR t1.policy_type_code = 'Uniform'
CREATE TABLE policies (customer_id VARCHAR(255), policy_type_code VARCHAR(255)); CREATE TABLE customers (customer_details VARCHAR(255), customer_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
1
{ "split": "train", "row_index": 879 }
Find the names of all the customers and staff members.
SELECT customer_details FROM customers UNION SELECT staff_details FROM staff
CREATE TABLE staff (customer_details VARCHAR(255), staff_details VARCHAR(255)); CREATE TABLE customers (customer_details VARCHAR(255), staff_details VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
1
0
{ "split": "train", "row_index": 880 }
Find the number of records of each policy type and its type code.
SELECT policy_type_code, COUNT(*) FROM policies GROUP BY policy_type_code
CREATE TABLE policies (policy_type_code VARCHAR(255), id INTEGER PRIMARY KEY AUTOINCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 881 }
Find the name of the customer that has been involved in the most policies.
SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE customers (customer_details VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE policies (customer_id VARCHAR(255), id INTEGER PRIMARY KEY AUTOINCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 882 }