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.