Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    CastError
Message:      Couldn't cast
id: string
db_id: string
question: string
gold_sql: string
gold_result_hash: string
difficulty: string
source: string
sql: string
schema_text: string
to
{'id': Value('string'), 'db_id': Value('string'), 'schema_text': Value('string'), 'question': Value('string'), 'sql': Value('string'), 'source': Value('string'), 'difficulty': Value('string')}
because column names don't match
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1827, in _prepare_split_single
                  for key, table in generator:
                                    ^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 613, in wrapped
                  for item in generator(*args, **kwargs):
                              ~~~~~~~~~^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
                  raise CastError(
                  ...<3 lines>...
                  )
              datasets.table.CastError: Couldn't cast
              id: string
              db_id: string
              question: string
              gold_sql: string
              gold_result_hash: string
              difficulty: string
              source: string
              sql: string
              schema_text: string
              to
              {'id': Value('string'), 'db_id': Value('string'), 'schema_text': Value('string'), 'question': Value('string'), 'sql': Value('string'), 'source': Value('string'), 'difficulty': Value('string')}
              because column names don't match
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~^
                      builder, max_dataset_size_bytes=max_dataset_size_bytes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
                      gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  ):
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1880, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

id
string
db_id
string
schema_text
string
question
string
sql
string
source
string
difficulty
string
spider_train_00000
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
How many heads of the departments are older than 56 ?
SELECT COUNT(*) FROM head WHERE age > 56;
spider
easy
spider_train_00001
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
List the name, born state and age of the heads of departments ordered by age.
SELECT name, born_state, age FROM head ORDER BY age;
spider
medium
spider_train_00002
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
List the creation year, name and budget of each department.
SELECT creation, name, budget_in_billions FROM department;
spider
medium
spider_train_00003
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
What are the maximum and minimum budget of the departments?
SELECT MAX(budget_in_billions), MIN(budget_in_billions) FROM department;
spider
medium
spider_train_00004
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
What is the average number of employees of the departments whose rank is between 10 and 15?
SELECT AVG(num_employees) FROM department WHERE ranking BETWEEN 10 AND 15;
spider
easy
spider_train_00005
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
What are the names of the heads who are born outside the California state?
SELECT name FROM head WHERE born_state <> 'California';
spider
easy
spider_train_00006
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?
SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T3.born_state = 'Alabama';
spider
hard
spider_train_00007
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
What are the names of the states where at least 3 heads were born?
SELECT born_state FROM head GROUP BY born_state HAVING COUNT(*) >= 3;
spider
easy
spider_train_00008
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
In which year were most departments established?
SELECT creation FROM department GROUP BY creation ORDER BY COUNT(*) DESC LIMIT 1;
spider
hard
spider_train_00009
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?
SELECT T1.name, T1.num_employees FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id WHERE T2.temporary_acting = 'Yes';
spider
medium
spider_train_00010
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
How many acting statuses are there?
SELECT COUNT(DISTINCT temporary_acting) FROM management;
spider
easy
spider_train_00011
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
How many departments are led by heads who are not mentioned?
SELECT COUNT(*) FROM department WHERE department_id NOT IN (SELECT department_id FROM management);
spider
extra
spider_train_00012
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
What are the distinct ages of the heads who are acting?
SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id = T2.head_id WHERE T2.temporary_acting = 'Yes';
spider
medium
spider_train_00013
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.
SELECT T3.born_state FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T1.name = 'Treasury' INTERSECT SELECT T3.born_state FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = ...
spider
extra
spider_train_00014
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
Which department has more than 1 head at a time? List the id, name and the number of heads.
SELECT T1.department_id, T1.name, COUNT(*) FROM management AS T2 JOIN department AS T1 ON T1.department_id = T2.department_id GROUP BY T1.department_id, T1.name HAVING COUNT(*) > 1;
spider
medium
spider_train_00015
department_management
CREATE TABLE department (Department_ID BIGINT, Name VARCHAR /* e.g. 'Agriculture', 'Commerce' */, Creation BIGINT, Ranking BIGINT, Budget_in_Billions DOUBLE, Num_Employees DOUBLE); CREATE TABLE head (head_ID BIGINT, name VARCHAR /* e.g. 'Billy Mayfair', 'Dudley Hart' */, born_state VARCHAR /* e.g. 'California', 'Alabam...
Which head's name has the substring 'Ha'? List the id and name.
SELECT head_id, name FROM head WHERE name ILIKE '%Ha%';
spider
medium
spider_train_00056
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
which course has most number of registered students?
SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id, T1.course_name ORDER BY COUNT(*) DESC LIMIT 1;
spider
extra
spider_train_00057
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What is the name of the course with the most registered students?
SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id, T1.course_name ORDER BY COUNT(*) DESC LIMIT 1;
spider
extra
spider_train_00058
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
what is id of students who registered some courses but the least number of courses in these students?
SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY COUNT(*) LIMIT 1;
spider
hard
spider_train_00059
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the ids of the students who registered for some courses but had the least number of courses for all students?
SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY COUNT(*) LIMIT 1;
spider
hard
spider_train_00060
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
what are the first name and last name of all candidates?
SELECT T2.first_name, T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id;
spider
medium
spider_train_00061
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the first and last names of all the candidates?
SELECT T2.first_name, T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id;
spider
medium
spider_train_00062
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
List the id of students who never attends courses?
SELECT student_id FROM students WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance);
spider
hard
spider_train_00063
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the ids of every student who has never attended a course?
SELECT student_id FROM students WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance);
spider
hard
spider_train_00064
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
List the id of students who attended some courses?
SELECT student_id FROM student_course_attendance;
spider
easy
spider_train_00065
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the ids of all students who have attended at least one course?
SELECT student_id FROM student_course_attendance;
spider
easy
spider_train_00066
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the ids of all students for courses and what are the names of those courses?
SELECT T1.student_id, T2.course_name FROM student_course_registrations AS T1 JOIN courses AS T2 ON T1.course_id = T2.course_id;
spider
medium
spider_train_00067
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What is detail of the student who most recently registered course?
SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1;
spider
hard
spider_train_00068
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What details do we have on the students who registered for courses most recently?
SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1;
spider
hard
spider_train_00069
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
How many students attend course English?
SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'English';
spider
medium
spider_train_00070
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
How many students are attending English courses?
SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'English';
spider
medium
spider_train_00071
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
How many courses do the student whose id is 171 attend?
SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171;
spider
medium
spider_train_00072
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
How many courses does the student with id 171 actually attend?
SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171;
spider
medium
spider_train_00073
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
Find id of the candidate whose email is stanley.monahan@example.org?
SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = 'stanley.monahan@example.org';
spider
medium
spider_train_00074
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What is the id of the candidate whose email is stanley.monahan@example.org?
SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = 'stanley.monahan@example.org';
spider
medium
spider_train_00075
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
Find id of the candidate who most recently accessed the course?
SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1;
spider
medium
spider_train_00076
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What is the id of the candidate who most recently accessed the course?
SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1;
spider
medium
spider_train_00077
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What is detail of the student who registered the most number of courses?
SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id, T1.student_details ORDER BY COUNT(*) DESC LIMIT 1;
spider
extra
spider_train_00078
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the details of the student who registered for the most number of courses?
SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id, T1.student_details ORDER BY COUNT(*) DESC LIMIT 1;
spider
extra
spider_train_00079
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
List the id of students who registered some courses and the number of their registered courses?
SELECT T1.student_id, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id;
spider
medium
spider_train_00080
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
For every student who is registered for some course, how many courses are they registered for?
SELECT T1.student_id, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id;
spider
medium
spider_train_00081
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
How many registed students do each course have? List course name and the number of their registered students?
SELECT T3.course_name, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id, T3.course_name;
spider
hard
spider_train_00082
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
For each course id, how many students are registered and what are the course names?
SELECT T3.course_name, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id, T3.course_name;
spider
hard
spider_train_00083
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
Find id of candidates whose assessment code is "Pass"?
SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = 'Pass';
spider
easy
spider_train_00084
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the ids of the candidates that have an outcome code of Pass?
SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = 'Pass';
spider
easy
spider_train_00085
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
Find the cell mobile number of the candidates whose assessment code is "Fail"?
SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = 'Fail';
spider
hard
spider_train_00086
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the cell phone numbers of the candidates that received an assessment code of "Fail"?
SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = 'Fail';
spider
hard
spider_train_00087
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the id of students who registered course 301?
SELECT student_id FROM student_course_attendance WHERE course_id = 301;
spider
easy
spider_train_00088
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the ids of the students who registered for course 301?
SELECT student_id FROM student_course_attendance WHERE course_id = 301;
spider
easy
spider_train_00089
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What is the id of the student who most recently registered course 301?
SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1;
spider
hard
spider_train_00090
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the ids of the students who registered for course 301 most recently?
SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1;
spider
hard
spider_train_00091
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
Find distinct cities of addresses of people?
SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id;
spider
easy
spider_train_00092
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the different cities where people live?
SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id;
spider
easy
spider_train_00093
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
Find distinct cities of address of students?
SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id;
spider
medium
spider_train_00094
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the different cities where students live?
SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id;
spider
medium
spider_train_00095
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
List the names of courses in alphabetical order?
SELECT course_name FROM courses ORDER BY course_name;
spider
easy
spider_train_00096
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the names of the courses in alphabetical order?
SELECT course_name FROM courses ORDER BY course_name;
spider
easy
spider_train_00097
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
List the first names of people in alphabetical order?
SELECT first_name FROM people ORDER BY first_name;
spider
easy
spider_train_00098
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the first names of the people in alphabetical order?
SELECT first_name FROM people ORDER BY first_name;
spider
easy
spider_train_00099
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the id of students who registered courses or attended courses?
SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance;
spider
hard
spider_train_00100
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the ids of the students who either registered or attended a course?
SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance;
spider
hard
spider_train_00101
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
Find the id of courses which are registered or attended by student whose id is 121?
SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121;
spider
hard
spider_train_00102
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the ids of the courses that are registered or attended by the student whose id is 121?
SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121;
spider
hard
spider_train_00103
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are all info of students who registered courses but not attended courses?
SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance);
spider
hard
spider_train_00104
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are all details of the students who registered but did not attend any course?
SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance);
spider
hard
spider_train_00105
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
List the id of students who registered course statistics in the order of registration date.
SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'statistics' ORDER BY T2.registration_date;
spider
hard
spider_train_00106
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the ids of the students who registered course statistics by order of registration date?
SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'statistics' ORDER BY T2.registration_date;
spider
hard
spider_train_00107
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
List the id of students who attended statistics courses in the order of attendance date.
SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'statistics' ORDER BY T2.date_of_attendance;
spider
hard
spider_train_00108
student_assessment
CREATE TABLE Addresses (address_id BIGINT, line_1 VARCHAR, line_2 VARCHAR /* e.g. 'Apt. 163', 'Apt. 419' */, city VARCHAR /* e.g. 'Alizeshire', 'Boyleshire' */, zip_postcode VARCHAR /* e.g. '079', '112' */, state_province_county VARCHAR /* e.g. 'Michigan', 'NewMexico' */, country VARCHAR /* e.g. 'USA' */); CREATE TABLE...
What are the ids of the students who attended courses in the statistics department in order of attendance date.
SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = 'statistics' ORDER BY T2.date_of_attendance;
spider
hard
spider_train_00213
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
How many books are there?
SELECT COUNT(*) FROM book;
spider
easy
spider_train_00214
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
List the writers of the books in ascending alphabetical order.
SELECT Writer FROM book ORDER BY Writer ASC;
spider
easy
spider_train_00215
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
List the titles of the books in ascending order of issues.
SELECT Title FROM book ORDER BY Issues ASC;
spider
easy
spider_train_00216
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
What are the titles of the books whose writer is not "Elaine Lee"?
SELECT Title FROM book WHERE Writer <> 'Elaine Lee';
spider
easy
spider_train_00217
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
What are the title and issues of the books?
SELECT Title, Issues FROM book;
spider
medium
spider_train_00218
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
What are the dates of publications in descending order of price?
SELECT Publication_Date FROM publication ORDER BY Price DESC;
spider
easy
spider_train_00219
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
What are the distinct publishers of publications with price higher than 5000000?
SELECT DISTINCT Publisher FROM publication WHERE Price > 5000000;
spider
easy
spider_train_00220
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
List the publisher of the publication with the highest price.
SELECT Publisher FROM publication ORDER BY Price DESC LIMIT 1;
spider
medium
spider_train_00222
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
Show the title and publication dates of books.
SELECT T1.Title, T2.Publication_Date FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID;
spider
medium
spider_train_00223
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
Show writers who have published a book with price more than 4000000.
SELECT T1.Writer FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID WHERE T2.Price > 4000000;
spider
medium
spider_train_00224
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
Show the titles of books in descending order of publication price.
SELECT T1.Title FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID ORDER BY T2.Price DESC;
spider
medium
spider_train_00225
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
Show publishers that have more than one publication.
SELECT Publisher FROM publication GROUP BY Publisher HAVING COUNT(*) > 1;
spider
easy
spider_train_00226
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
Show different publishers together with the number of publications they have.
SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher;
spider
medium
spider_train_00227
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
Please show the most common publication date.
SELECT Publication_Date FROM publication GROUP BY Publication_Date ORDER BY COUNT(*) DESC LIMIT 1;
spider
hard
spider_train_00228
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
List the writers who have written more than one book.
SELECT Writer FROM book GROUP BY Writer HAVING COUNT(*) > 1;
spider
easy
spider_train_00229
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
List the titles of books that are not published.
SELECT Title FROM book WHERE Book_ID NOT IN (SELECT Book_ID FROM publication);
spider
hard
spider_train_00230
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
Show the publishers that have publications with price higher than 10000000 and publications with price lower than 5000000.
SELECT Publisher FROM publication WHERE Price > 10000000 INTERSECT SELECT Publisher FROM publication WHERE Price < 5000000;
spider
hard
spider_train_00231
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
What is the number of distinct publication dates?
SELECT COUNT(DISTINCT Publication_Date) FROM publication;
spider
easy
spider_train_00232
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
How many distinct publication dates are there in our record?
SELECT COUNT(DISTINCT Publication_Date) FROM publication;
spider
easy
spider_train_00233
book_2
CREATE TABLE book (Book_ID BIGINT, Title VARCHAR /* e.g. 'Bloody Mary', 'Bloody Mary : Lady Liberty' */, Issues DOUBLE, Writer VARCHAR /* e.g. 'Christopher Hinz', 'Garth Ennis' */); CREATE TABLE publication (Publication_ID BIGINT, Book_ID BIGINT, Publisher VARCHAR /* e.g. 'Pearson', 'Wiley' */, Publication_Date VARCHAR...
Show the prices of publications whose publisher is either "Person" or "Wiley"
SELECT Price FROM publication WHERE Publisher = 'Person' OR Publisher = 'Wiley';
spider
medium
spider_train_00234
musical
CREATE TABLE actor (Actor_ID BIGINT, Name VARCHAR /* e.g. 'Alan Fletcher', 'Ian Smith' */, Musical_ID BIGINT, Character VARCHAR /* e.g. 'Alf Stewart', 'Harold Bishop' */, Duration VARCHAR /* e.g. '1994—', '1985–1992, 1993, 2004—' */, age BIGINT); CREATE TABLE musical (Musical_ID BIGINT, Name VARCHAR /* e.g. 'Chicago', ...
How many actors are there?
SELECT COUNT(*) FROM actor;
spider
easy
spider_train_00235
musical
CREATE TABLE actor (Actor_ID BIGINT, Name VARCHAR /* e.g. 'Alan Fletcher', 'Ian Smith' */, Musical_ID BIGINT, Character VARCHAR /* e.g. 'Alf Stewart', 'Harold Bishop' */, Duration VARCHAR /* e.g. '1994—', '1985–1992, 1993, 2004—' */, age BIGINT); CREATE TABLE musical (Musical_ID BIGINT, Name VARCHAR /* e.g. 'Chicago', ...
Count the number of actors.
SELECT COUNT(*) FROM actor;
spider
easy
spider_train_00236
musical
CREATE TABLE actor (Actor_ID BIGINT, Name VARCHAR /* e.g. 'Alan Fletcher', 'Ian Smith' */, Musical_ID BIGINT, Character VARCHAR /* e.g. 'Alf Stewart', 'Harold Bishop' */, Duration VARCHAR /* e.g. '1994—', '1985–1992, 1993, 2004—' */, age BIGINT); CREATE TABLE musical (Musical_ID BIGINT, Name VARCHAR /* e.g. 'Chicago', ...
List the name of actors in ascending alphabetical order.
SELECT Name FROM actor ORDER BY Name ASC;
spider
easy
spider_train_00237
musical
CREATE TABLE actor (Actor_ID BIGINT, Name VARCHAR /* e.g. 'Alan Fletcher', 'Ian Smith' */, Musical_ID BIGINT, Character VARCHAR /* e.g. 'Alf Stewart', 'Harold Bishop' */, Duration VARCHAR /* e.g. '1994—', '1985–1992, 1993, 2004—' */, age BIGINT); CREATE TABLE musical (Musical_ID BIGINT, Name VARCHAR /* e.g. 'Chicago', ...
What are the names of actors, ordered alphabetically?
SELECT Name FROM actor ORDER BY Name ASC;
spider
easy
spider_train_00238
musical
CREATE TABLE actor (Actor_ID BIGINT, Name VARCHAR /* e.g. 'Alan Fletcher', 'Ian Smith' */, Musical_ID BIGINT, Character VARCHAR /* e.g. 'Alf Stewart', 'Harold Bishop' */, Duration VARCHAR /* e.g. '1994—', '1985–1992, 1993, 2004—' */, age BIGINT); CREATE TABLE musical (Musical_ID BIGINT, Name VARCHAR /* e.g. 'Chicago', ...
What are the characters and duration of actors?
SELECT Character, Duration FROM actor;
spider
medium
spider_train_00239
musical
CREATE TABLE actor (Actor_ID BIGINT, Name VARCHAR /* e.g. 'Alan Fletcher', 'Ian Smith' */, Musical_ID BIGINT, Character VARCHAR /* e.g. 'Alf Stewart', 'Harold Bishop' */, Duration VARCHAR /* e.g. '1994—', '1985–1992, 1993, 2004—' */, age BIGINT); CREATE TABLE musical (Musical_ID BIGINT, Name VARCHAR /* e.g. 'Chicago', ...
Return the characters and durations for each actor.
SELECT Character, Duration FROM actor;
spider
medium
spider_train_00240
musical
CREATE TABLE actor (Actor_ID BIGINT, Name VARCHAR /* e.g. 'Alan Fletcher', 'Ian Smith' */, Musical_ID BIGINT, Character VARCHAR /* e.g. 'Alf Stewart', 'Harold Bishop' */, Duration VARCHAR /* e.g. '1994—', '1985–1992, 1993, 2004—' */, age BIGINT); CREATE TABLE musical (Musical_ID BIGINT, Name VARCHAR /* e.g. 'Chicago', ...
List the name of actors whose age is not 20.
SELECT Name FROM actor WHERE Age <> 20;
spider
easy
spider_train_00241
musical
CREATE TABLE actor (Actor_ID BIGINT, Name VARCHAR /* e.g. 'Alan Fletcher', 'Ian Smith' */, Musical_ID BIGINT, Character VARCHAR /* e.g. 'Alf Stewart', 'Harold Bishop' */, Duration VARCHAR /* e.g. '1994—', '1985–1992, 1993, 2004—' */, age BIGINT); CREATE TABLE musical (Musical_ID BIGINT, Name VARCHAR /* e.g. 'Chicago', ...
What are the names of actors who are not 20 years old?
SELECT Name FROM actor WHERE Age <> 20;
spider
easy
spider_train_00242
musical
CREATE TABLE actor (Actor_ID BIGINT, Name VARCHAR /* e.g. 'Alan Fletcher', 'Ian Smith' */, Musical_ID BIGINT, Character VARCHAR /* e.g. 'Alf Stewart', 'Harold Bishop' */, Duration VARCHAR /* e.g. '1994—', '1985–1992, 1993, 2004—' */, age BIGINT); CREATE TABLE musical (Musical_ID BIGINT, Name VARCHAR /* e.g. 'Chicago', ...
What are the characters of actors in descending order of age?
SELECT Character FROM actor ORDER BY age DESC;
spider
easy
spider_train_00243
musical
CREATE TABLE actor (Actor_ID BIGINT, Name VARCHAR /* e.g. 'Alan Fletcher', 'Ian Smith' */, Musical_ID BIGINT, Character VARCHAR /* e.g. 'Alf Stewart', 'Harold Bishop' */, Duration VARCHAR /* e.g. '1994—', '1985–1992, 1993, 2004—' */, age BIGINT); CREATE TABLE musical (Musical_ID BIGINT, Name VARCHAR /* e.g. 'Chicago', ...
Return the characters for actors, ordered by age descending.
SELECT Character FROM actor ORDER BY age DESC;
spider
easy
spider_train_00244
musical
CREATE TABLE actor (Actor_ID BIGINT, Name VARCHAR /* e.g. 'Alan Fletcher', 'Ian Smith' */, Musical_ID BIGINT, Character VARCHAR /* e.g. 'Alf Stewart', 'Harold Bishop' */, Duration VARCHAR /* e.g. '1994—', '1985–1992, 1993, 2004—' */, age BIGINT); CREATE TABLE musical (Musical_ID BIGINT, Name VARCHAR /* e.g. 'Chicago', ...
What is the duration of the oldest actor?
SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1;
spider
medium
End of preview.

PocketSQL data

Question → DuckDB SQL pairs used to fine-tune PocketSQL, a sub-1B model that writes DuckDB SQL in the browser. Every pair was checked by running it: the DuckDB query must return the same result as Spider's original SQLite query on the same data.

Version: v1 (milestone M3): Spider-derived pairs plus 591 synthetic pairs for the app's three demo schemas, filtered by 3-model self-consistency and spot-reviewed (88% acceptance). v0 (Spider only) is the previous revision.

Files

File Rows What
train.jsonl 7,967 7,376 Spider train pairs (130 databases) + 591 synthetic pairs for the demo schemas (source: synthetic)
val.jsonl 858 Spider train pairs from 16 held-out databases (no database is in both train and val)
spider_dev_duckdb.jsonl 981 Spider dev pairs, 20 databases: the test set. Never used for training.
databases.zip 36 files DuckDB files for the val and test databases, for execution scoring
synth_review.jsonl 50 The reviewed sample of synthetic pairs, with each verdict (accept, review_note)

Train/val row: {id, db_id, schema_text, question, sql, source, difficulty}. Test row: {id, db_id, question, gold_sql, gold_result_hash, difficulty}. difficulty is Spider's official hardness (easy, medium, hard, extra), computed from Spider's parsed SQL.

schema_text is the prompt's schema: one CREATE TABLE t (col TYPE, …); line per table, with up to 2 example values for text columns that have at most 20 distinct values. The full prompt is the base model's chat template (thinking disabled) with the system message "Write one DuckDB SQL query that answers the question. Output only SQL." and the user message schema_text + "\n\nQuestion: " + question. The target is the SQL alone, ending with ;.

How it was built

Code: training/src/pocketsql/data/ in the GitHub repo (python -m pocketsql.data.prepare).

  1. Source. Spider 1.0 spider_data.zip from the official release, sha256 00636695dabed6b5f4b8328a16b13e069a2f16591d5efcce57660669c85b121b.
  2. SQLite → DuckDB. Each database is copied with DuckDB's SQLite scanner using the declared column types. Where SQLite's loose typing breaks that, columns are loaded as text and cast back when every value allows it. Empty strings in numeric columns are read as NULL (114 columns). Text columns whose values are all canonical numbers become BIGINT or DOUBLE (165 columns); codes with leading zeros stay text.
  3. Gold SQL → DuckDB with sqlglot 30.19.0, plus four rewrites that keep SQLite's meaning: double-quoted strings become string literals, LIKE becomes ILIKE (SQLite's LIKE ignores case), bare columns next to GROUP BY are added to the GROUP BY list, and sqlglot's NULLIF / NULLS FIRST guards are dropped.
  4. Execution filter. A pair is kept only if the DuckDB result equals the SQLite result: order matters only when the query has a top-level ORDER BY, floats match within 1e-6, and ints, floats, and numeric strings compare as numbers.
  5. Dedupe and split. 42 exact duplicates (same database, question, and SQL) were removed from train. Val is a seeded set of Spider train databases (about 10% of pairs).
  6. Leakage check. No train or val item shares a database and a normalized question or SQL with a test item, or has question token-Jaccard ≥ 0.9 with one (python -m pocketsql.data.leakage, run in CI against this dataset).

Synthetic pairs (demo schemas)

The web app queries three small databases: Chinook (music store), Palmer penguins, and a World Bank indicators snapshot. Spider has nothing like them, so the model also trains on synthetic questions over these exact schemas. Code: training/src/pocketsql/synth/ (python -m pocketsql.synth --n 200).

  1. Questions. gpt-oss-120b (temperature 1.0) writes batches of 20 difficulty-tagged questions with SQL for one of 11 topics (filters, aggregates, grouping, joins, subqueries, windows, time, conditional, multistep, sets, text), shown the schema, a few data notes, and the questions already asked on that topic.
  2. Two more answers. gpt-oss-20b and Qwen3.8-27B (temperature 0) answer the same questions independently from the schema alone.
  3. Self-consistency filter. A question is kept only when at least 2 of the 3 SQL candidates run and return the same result, and that result is non-empty, not all NULL, and deterministic: the same on a copy of the database with rows in reverse order, and unchanged when ties in a top-level ORDER BY are broken either way. The shortest agreeing SQL becomes the target.
  4. Dedupe and leakage. Repeated questions or SQL (normalized) and near-duplicate questions (token-Jaccard ≥ 0.9) on the same database are dropped (4 repeated SQL; no repeated questions), and so is anything close to a test item on the same database: the same normalized question or SQL, the same result as a test item's gold query, or question token-Jaccard ≥ 0.9.
  5. Cap. At most 200 pairs per schema, in generation order.
Schema Questions Agreed (≥ 2 of 3) Dropped: leakage Dropped: duplicate Kept Kept / questions
chinook 478 218 11 2 200 41.8%
penguins 409 287 13 2 200 48.9%
world_bank 241 196 5 0 191 79.3%
total 1,128 701 29 4 591 52.4%

Chinook and penguins reached the 200 cap (77 more agreed pairs were left over); world_bank stopped at 191 when the Groq free-tier daily token quota ran out, and the set was finalized from the cached calls. Of the questions that were not kept, 344 had fewer than 2 valid candidates (errors, empty or order-dependent results) and 83 had candidates that disagreed. Difficulty of the kept pairs: 180 easy, 199 medium, 167 hard, 45 extra. Per-model candidate validity and every decision are in training/data/cards/synth_stats.json and processed/synth_candidates.jsonl in the GitHub repo.

Review. 50 kept pairs (17 chinook, 17 penguins, 16 world_bank, seeded random sample) were checked by running each SQL and reading its result next to the question. A pair is accepted when the SQL returns what a reasonable analyst would read the question as asking on this data; ambiguous questions, wrong NULL handling, off-by-one periods, and answers that would change on other data are rejected. 44/50 accepted (88%): chinook 14/17, penguins 15/17, world_bank 15/16. The rejections: an average that skips empty playlists, a NULL billing state ranked as a state, "last 30 days" coded as a 31-day month, an ambiguous nested penguin question, penguins with no bill depth bucketed as 'large' through ELSE, and a question that calls population ÷ GDP "population density". The review was done by Claude (claude-opus-5-5) on the project owner's instruction; verdicts are in synth_review.jsonl.

Retention

Split Spider pairs Kept Retention DuckDB error Result mismatch SQLite error
train 7,733 7,417 95.9% 66 247 3
val 926 859 92.8% 14 53 0
test (dev) 1,034 981 94.9% 11 42 0

Most mismatches are ORDER BY ties that SQLite and DuckDB break differently (gold queries whose answer depends on tie order). Per-database retention and every conversion note are in stats.json in the GitHub repo (training/data/cards/stats.json).

Difficulty easy medium hard extra
train 1,741 2,518 1,614 1,503
val 203 355 200 100
test 236 433 164 148

Prompt + SQL length with the Qwen3 tokenizer: median 297 tokens, p95 701, max 2,249.

Limitations

  • 1,580 train/val pairs (19%) and 49 test pairs return an empty result on Spider's sample data, which makes their execution match weaker evidence.
  • Spider's known annotation issues remain where the query still runs; only execution equivalence between engines is checked, not the question-to-SQL meaning.

License and attribution

Derived from Spider (Yu et al., 2018), licensed CC BY-SA 4.0; this dataset keeps the same license.

Synthetic pairs: generated with gpt-oss-120b, gpt-oss-20b (OpenAI, Apache-2.0), and Qwen3.8-27B (Qwen team, Apache-2.0) through the Groq API, whose terms leave outputs to the customer. The demo databases they are written against are Chinook (MIT), Palmer penguins (CC0 1.0), and World Bank World Development Indicators (CC BY 4.0).

@inproceedings{yu-etal-2018-spider,
  title     = {{Spider}: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-{SQL} Task},
  author    = {Yu, Tao and Zhang, Rui and Yang, Kai and Yasunaga, Michihiro and Wang, Dongxu and Li, Zifan and Ma, James and Li, Irene and Yao, Qingning and Roman, Shanelle and Zhang, Zilin and Radev, Dragomir},
  booktitle = {Proceedings of EMNLP},
  year      = {2018}
}
Downloads last month
82

Models trained or fine-tuned on MidlightDDK/pocketsql-data