question
stringlengths
1
606
db_id
stringclasses
139 values
external_knowledge
stringclasses
1 value
sql
stringlengths
19
1.35k
data_source
stringclasses
1 value
prompt
listlengths
2
2
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
Which codes and names appear in either the list of products or the list of manufacturers?
manufactory_1
select anon_1.c1, anon_1.c0 from (select code as c1, name as c0 from products union select code, name from manufacturers) as anon_1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "manufactory_1", "sql": "select anon_1.c1, anon_1.c0 from (select code as c1, name as c0 from products union select code, name from manufacturers) as anon_1" }, "style": "rule" }
{ "index": 2029, "split": "train" }
List the IDs and heights of the ten tallest individuals in the database.
body_builder
select people_id, height as c0 from people order by c0 desc limit 10
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "body_builder", "sql": "select people_id, height as c0 from people order by c0 desc limit 10" }, "style": "rule" }
{ "index": 1345, "split": "train" }
Who are the top three directors of movies associated with book clubs whose IDs start with "5" or end with "3," listed in reverse alphabetical order?
culture_company
select t0.director as c0 from movie as t0 join culture_company as t1 on t0.movie_id = t1.movie_id where t1.book_club_id like '5%' or t1.book_club_id like '%3' order by c0 desc limit 3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "culture_company", "sql": "select t0.director as c0 from movie as t0 join culture_company as t1 on t0.movie_id = t1.movie_id where t1.book_club_id like '5%' or t1.book_club_id like '%3' order by c0 desc limit 3" }, "style": "rule" }
{ "index": 1740, "split": "train" }
Can you provide the names and SSNs of all scientists, including those who are assigned to projects with names beginning with "Aerody"?
scientist_1
select anon_1.c1, anon_1.c0 from (select name as c1, ssn as c0 from scientists union select t0.name as c1, t0.ssn as c0 from scientists as t0 join assignedto as t1 on t0.ssn = t1.scientist join projects as t2 on t1.project = t2.code where t2.name like 'Aerody%') as anon_1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "scientist_1", "sql": "select anon_1.c1, anon_1.c0 from (select name as c1, ssn as c0 from scientists union select t0.name as c1, t0.ssn as c0 from scientists as t0 join assignedto as t1 on t0.ssn = t1.scientist join projects as t2 on t1.project = t2.code where t2.name like 'Aerod...
{ "index": 2420, "split": "train" }
Can you tell me the SSNs, positions, employee IDs of the bottom five physicians, along with the block codes of the rooms that start with "Sin", sorted by SSN?
hospital_1
select t0.ssn as c3, t0.position, t0.employeeid, t4.blockcode from physician as t0 join appointment as t1 on t0.employeeid = t1.physician join nurse as t2 on t1.prepnurse = t2.employeeid join on_call as t3 on t2.employeeid = t3.nurse join block as t4 on t3.blockfloor = t4.blockfloor join room as t5 on t4.blockfloor = t...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "hospital_1", "sql": "select t0.ssn as c3, t0.position, t0.employeeid, t4.blockcode from physician as t0 join appointment as t1 on t0.employeeid = t1.physician join nurse as t2 on t1.prepnurse = t2.employeeid join on_call as t3 on t2.employeeid = t3.nurse join block as t4 on t3.bl...
{ "index": 1862, "split": "train" }
What is the percentage change in the smallest number of accounts per customer between October 22, 2010, and July 9, 2012?
customers_and_invoices
select (min(t0.c0) / cast(min(t1.c0) as real) - 1) * 100 from (select count(distinct (t1.account_id)) as c0 from customers as t0 join accounts as t1 on t0.customer_id = t1.customer_id where t1.date_account_opened = '2010-10-22 13:33:45' group by t0.customer_id) as t0, (select t0.customer_id, count(distinct (t1.account_...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "customers_and_invoices", "sql": "select (min(t0.c0) / cast(min(t1.c0) as real) - 1) * 100 from (select count(distinct (t1.account_id)) as c0 from customers as t0 join accounts as t1 on t0.customer_id = t1.customer_id where t1.date_account_opened = '2010-10-22 13:33:45' group by t...
{ "index": 3025, "split": "train" }
What is the percentage change in the number of guests who booked an apartment on February 11, 2017, compared to those who booked on June 7, 2016?
apartment_rentals
select (count(t0.c1) / cast(count(t1.c1) as real) - 1) * 100 from (select min(t1.guest_id) as c1 from guests as t0 join apartment_bookings as t1 on t0.guest_id = t1.guest_id where t1.booking_start_date = '2016-06-07 05:05:18' group by t0.guest_id) as t0, (select t0.guest_id, min(t1.guest_id) as c1 from guests as t0 joi...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "apartment_rentals", "sql": "select (count(t0.c1) / cast(count(t1.c1) as real) - 1) * 100 from (select min(t1.guest_id) as c1 from guests as t0 join apartment_bookings as t1 on t0.guest_id = t1.guest_id where t1.booking_start_date = '2016-06-07 05:05:18' group by t0.guest_id) as t...
{ "index": 3001, "split": "train" }
What are the sales, journal IDs, themes, and publication dates for all journals, including those associated with editors whose names start with "Graż"?
journal_committee
select anon_1.c2, anon_1.c1, anon_1.c3, anon_1.c0 from (select sales as c2, journal_id as c1, theme as c3, date as c0 from journal union select t0.sales as c2, t0.journal_id as c1, t0.theme as c3, t0.date as c0 from journal as t0 join journal_committee as t1 on t0.journal_id = t1.journal_id join editor as t2 on t1.edit...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "journal_committee", "sql": "select anon_1.c2, anon_1.c1, anon_1.c3, anon_1.c0 from (select sales as c2, journal_id as c1, theme as c3, date as c0 from journal union select t0.sales as c2, t0.journal_id as c1, t0.theme as c3, t0.date as c0 from journal as t0 join journal_committee...
{ "index": 2333, "split": "train" }
What is the difference in the 'Y' values between the airports with IDs 11776 and 3700?
flight_4
select t1.c0 - t0.c0 from (select y as c0 from airports where apid = 11776) as t1, (select y as c0 from airports where apid = 3700) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "flight_4", "sql": "select t1.c0 - t0.c0 from (select y as c0 from airports where apid = 11776) as t1, (select y as c0 from airports where apid = 3700) as t0" }, "style": "rule" }
{ "index": 3608, "split": "train" }
Find the locations and festival IDs for the first three festivals where artworks with ID 5 or 9 were nominated, ordered by the festival ID with nulls listed last.
entertainment_awards
select t0.location, t0.festival_id as c0 from festival_detail as t0 join nomination as t1 on t0.festival_id = t1.festival_id join artwork as t2 on t1.artwork_id = t2.artwork_id where t2.artwork_id = 5 or t2.artwork_id = 9 order by c0 asc nulls last limit 3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "entertainment_awards", "sql": "select t0.location, t0.festival_id as c0 from festival_detail as t0 join nomination as t1 on t0.festival_id = t1.festival_id join artwork as t2 on t1.artwork_id = t2.artwork_id where t2.artwork_id = 5 or t2.artwork_id = 9 order by c0 asc nulls last ...
{ "index": 566, "split": "train" }
Who are the owners of channels that either have a rating above 0.2% or have a rating equal to the total combined rating of all channels, listed alphabetically by their channel name, showing only the first ten?
program_share
select t0.owner from channel as t0, (select sum(rating_in_percent) as c0 from channel) as t0 where t0.rating_in_percent > 0.2 or t0.rating_in_percent = t0.c0 order by t0.name asc nulls last limit 10
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "program_share", "sql": "select t0.owner from channel as t0, (select sum(rating_in_percent) as c0 from channel) as t0 where t0.rating_in_percent > 0.2 or t0.rating_in_percent = t0.c0 order by t0.name asc nulls last limit 10" }, "style": "rule" }
{ "index": 301, "split": "train" }
How many records are there for each department with a building starting with "Palm" or containing "c," and what are their budgets and department names?
college_2
select count(*), t0.budget, t0.dept_name as c1 from department as t0 join course as t1 on t0.dept_name = t1.dept_name where t0.building like 'Palm%' or t0.building like '%c%' group by c1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "college_2", "sql": "select count(*), t0.budget, t0.dept_name as c1 from department as t0 join course as t1 on t0.dept_name = t1.dept_name where t0.building like 'Palm%' or t0.building like '%c%' group by c1" }, "style": "rule" }
{ "index": 2176, "split": "train" }
What are the different industries associated with the companies that have the company IDs 19 or 2?
company_office
select distinct t0.industry from companies as t0 join office_locations as t1 on t0.id = t1.company_id where t1.company_id = 19 or t1.company_id = 2
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "company_office", "sql": "select distinct t0.industry from companies as t0 join office_locations as t1 on t0.id = t1.company_id where t1.company_id = 19 or t1.company_id = 2" }, "style": "rule" }
{ "index": 456, "split": "train" }
Is the number of unique Laurel products in the Herbs category less than the total number of products in the Herbs category?
products_gen_characteristics
select t1.c1 < t0.c1 from (select count(distinct (t1.product_id)) as c1 from ref_product_categories as t0 join products as t1 on t0.product_category_code = t1.product_category_code where t0.product_category_code = 'Herbs' and t1.product_name = 'laurel' group by t0.product_category_code) as t1, (select t0.product_catego...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "products_gen_characteristics", "sql": "select t1.c1 < t0.c1 from (select count(distinct (t1.product_id)) as c1 from ref_product_categories as t0 join products as t1 on t0.product_category_code = t1.product_category_code where t0.product_category_code = 'Herbs' and t1.product_name...
{ "index": 3571, "split": "train" }
How much higher is the latest project ID assigned to researchers compared to 15?
tracking_grants_for_research
select t0.c2 - 15 from (select max(t1.project_id) as c2 from staff_roles as t0 join project_staff as t1 on t0.role_code = t1.role_code where t0.role_code = 'researcher' group by t0.role_code) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "tracking_grants_for_research", "sql": "select t0.c2 - 15 from (select max(t1.project_id) as c2 from staff_roles as t0 join project_staff as t1 on t0.role_code = t1.role_code where t0.role_code = 'researcher' group by t0.role_code) as t0" }, "style": "rule" }
{ "index": 3886, "split": "train" }
Who is the top client, in reverse alphabetical order, whose compatible since year is less than or equal to either the total number or the total sum of all compatible since years in the database?
browser_web
select t0.client as c1 from web_client_accelerator as t0 join accelerator_compatible_browser as t1 on t0.id = t1.accelerator_id, (select count(compatible_since_year) as c0 from accelerator_compatible_browser) as t1, (select sum(compatible_since_year) as c2 from accelerator_compatible_browser) as t0 where t1.compatible_...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "browser_web", "sql": "select t0.client as c1 from web_client_accelerator as t0 join accelerator_compatible_browser as t1 on t0.id = t1.accelerator_id, (select count(compatible_since_year) as c0 from accelerator_compatible_browser) as t1, (select sum(compatible_since_year) as c2 f...
{ "index": 122, "split": "train" }
Which roles, including their codes and descriptions, were active on or before December 12, 1973, or during the period between August 28, 2000, and January 13, 2005?
tracking_grants_for_research
select t0.role_code, t0.role_description, t1.role_code from staff_roles as t0 join project_staff as t1 on t0.role_code = t1.role_code where t1.date_from <= '1973-12-12 11:46:28' or t1.date_from between '2000-08-28 11:49:17' and '2005-01-13 11:49:48'
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "tracking_grants_for_research", "sql": "select t0.role_code, t0.role_description, t1.role_code from staff_roles as t0 join project_staff as t1 on t0.role_code = t1.role_code where t1.date_from <= '1973-12-12 11:46:28' or t1.date_from between '2000-08-28 11:49:17' and '2005-01-13 1...
{ "index": 82, "split": "train" }
Which five artists, along with their countries and genders, have songs in genres rated exactly 7 or with ratings ending in 7, sorted by country from Z to A?
music_1
select t0.country as c0, t0.artist_name, t0.gender from artist as t0 join song as t1 on t0.artist_name = t1.artist_name join genre as t2 on t1.genre_is = t2.g_name where t2.rating = 7 or t2.rating like '%7' order by c0 desc limit 5
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "music_1", "sql": "select t0.country as c0, t0.artist_name, t0.gender from artist as t0 join song as t1 on t0.artist_name = t1.artist_name join genre as t2 on t1.genre_is = t2.g_name where t2.rating = 7 or t2.rating like '%7' order by c0 desc limit 5" }, "style": "rule" }
{ "index": 646, "split": "train" }
Which are the top 10 vehicles that have at least one lesson, showing their vehicle IDs and the highest customer ID (for customers with ID less than 9 or less than or equal to 5), ordered by vehicle details from Z to A?
driving_school
select t0.vehicle_id as c0, max(t1.customer_id) from vehicles as t0 join lessons as t1 on t0.vehicle_id = t1.vehicle_id where t1.customer_id < 9 or t1.customer_id <= 5 group by c0 having count(*) >= 1 order by t0.vehicle_details desc limit 10
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "driving_school", "sql": "select t0.vehicle_id as c0, max(t1.customer_id) from vehicles as t0 join lessons as t1 on t0.vehicle_id = t1.vehicle_id where t1.customer_id < 9 or t1.customer_id <= 5 group by c0 having count(*) >= 1 order by t0.vehicle_details desc limit 10" }, "sty...
{ "index": 1276, "split": "train" }
What are the pages per minute color and product details for products that are either not sold in any store within a specific district or not sold in store with ID 1?
store_product
select t0.pages_per_minute_color, t0.product from product as t0 join store_product as t1 on t0.product_id = t1.product_id where (not t1.store_id in (select store_district.store_id as c1 from store_district)) or (not t1.store_id in (select store.store_id as c2 from store where store.store_id = 1))
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "store_product", "sql": "select t0.pages_per_minute_color, t0.product from product as t0 join store_product as t1 on t0.product_id = t1.product_id where (not t1.store_id in (select store_district.store_id as c1 from store_district)) or (not t1.store_id in (select store.store_id as...
{ "index": 1356, "split": "train" }
What are the names of all tracks and media types combined?
chinook_1
select anon_1.c0 from (select name as c0 from track union select name from mediatype) as anon_1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "chinook_1", "sql": "select anon_1.c0 from (select name as c0 from track union select name from mediatype) as anon_1" }, "style": "rule" }
{ "index": 1055, "split": "train" }
Can you show me the claim dates, settlement dates, claimed amounts, and settled amounts for all cases where either the settlement's claimed amount exceeds 30,954 or the claim's settled amount is at least 1,189?
insurance_policies
select anon_1.c4, anon_1.c3, anon_1.c5, anon_1.c7 from (select date_claim_made as c4, date_claim_settled as c3, amount_claimed as c5, amount_settled as c7 from settlements where c5 > 30954 union select date_claim_made, date_claim_settled, amount_claimed, amount_settled as c6 from claims where c6 >= 1189) as anon_1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "insurance_policies", "sql": "select anon_1.c4, anon_1.c3, anon_1.c5, anon_1.c7 from (select date_claim_made as c4, date_claim_settled as c3, amount_claimed as c5, amount_settled as c7 from settlements where c5 > 30954 union select date_claim_made, date_claim_settled, amount_claim...
{ "index": 801, "split": "train" }
Does the percentage change in the minimum investor ID for purchase transactions over 8.9 recorded on June 6, 1982, and October 8, 1985, exceed the highest percentage change observed among all other transaction types?
tracking_share_transactions
select t5.c0 > t2.c1 from (select abs((t3.c2 / cast(t4.c2 as real) - 1) * 100) as c0 from (select min(t1.investor_id) as c2 from ref_transaction_types as t0 join transactions as t1 on t0.transaction_type_code = t1.transaction_type_code where t0.transaction_type_code = 'PUR' and t1.date_of_transaction = '1982-06-06 17:1...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "tracking_share_transactions", "sql": "select t5.c0 > t2.c1 from (select abs((t3.c2 / cast(t4.c2 as real) - 1) * 100) as c0 from (select min(t1.investor_id) as c2 from ref_transaction_types as t0 join transactions as t1 on t0.transaction_type_code = t1.transaction_type_code where ...
{ "index": 3452, "split": "train" }
When was the transaction with a share count of 96,178 and the highest transaction amount made?
tracking_share_transactions
select t0.date_of_transaction, t0.amount_of_transaction as c1 from transactions as t0, (select max(amount_of_transaction) as c3 from transactions where share_count = 96178) as t1 where c1 = t1.c3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "tracking_share_transactions", "sql": "select t0.date_of_transaction, t0.amount_of_transaction as c1 from transactions as t0, (select max(amount_of_transaction) as c3 from transactions where share_count = 96178) as t1 where c1 = t1.c3" }, "style": "rule" }
{ "index": 3803, "split": "train" }
Which camera lens IDs are used in photos with a lens ID greater than 1, and what are these IDs sorted in order?
mountain_photos
select t0.id as c0 from camera_lens as t0 join photos as t1 on t0.id = t1.camera_lens_id where t1.camera_lens_id > 1 order by c0 asc nulls last
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "mountain_photos", "sql": "select t0.id as c0 from camera_lens as t0 join photos as t1 on t0.id = t1.camera_lens_id where t1.camera_lens_id > 1 order by c0 asc nulls last" }, "style": "rule" }
{ "index": 1056, "split": "train" }
What is the formation date, name, and ID of the oldest organization that has contact individuals with first names starting with "Re"? Also, what are the contact dates and individual IDs of those contact individuals?
e_government
select t0.date_formed as c1, t0.organization_name, t0.organization_id, t1.date_contact_to, t1.individual_id from organizations as t0 join organization_contact_individuals as t1 on t0.organization_id = t1.organization_id join individuals as t2 on t1.individual_id = t2.individual_id where t2.individual_first_name like 'R...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "e_government", "sql": "select t0.date_formed as c1, t0.organization_name, t0.organization_id, t1.date_contact_to, t1.individual_id from organizations as t0 join organization_contact_individuals as t1 on t0.organization_id = t1.organization_id join individuals as t2 on t1.individu...
{ "index": 1812, "split": "train" }
Which product code has the fewest manufacturers associated with it?
manufactory_1
select code as c0, count(manufacturer) from products group by c0 order by c0 asc nulls last limit 1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "manufactory_1", "sql": "select code as c0, count(manufacturer) from products group by c0 order by c0 asc nulls last limit 1" }, "style": "rule" }
{ "index": 2009, "split": "train" }
Which schools have drivers aged between 35 and 45, and what are their school IDs and names?
school_bus
select t0.school_id, t0.school from school as t0 join school_bus as t1 on t0.school_id = t1.school_id join driver as t2 on t1.driver_id = t2.driver_id where t2.age between 35 and 45
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "school_bus", "sql": "select t0.school_id, t0.school from school as t0 join school_bus as t1 on t0.school_id = t1.school_id join driver as t2 on t1.driver_id = t2.driver_id where t2.age between 35 and 45" }, "style": "rule" }
{ "index": 2689, "split": "train" }
Which schools have an endowment donor, along with their location, where the total percentage of their budget invested is exactly 2.2?
school_finance
select t0.school_id, t0.donator_name, t1.location from endowment as t0 join school as t1 on t0.school_id = t1.school_id join budget as t2 on t1.school_id = t2.school_id where t2.total_budget_percent_invested between 2.2 and 2.2
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "school_finance", "sql": "select t0.school_id, t0.donator_name, t1.location from endowment as t0 join school as t1 on t0.school_id = t1.school_id join budget as t2 on t1.school_id = t2.school_id where t2.total_budget_percent_invested between 2.2 and 2.2" }, "style": "rule" }
{ "index": 860, "split": "train" }
What is the percentage change in the maximum average grant ID for grants that started before February 25, 2016, comparing the documents sent on June 18, 2001, and January 23, 2004?
tracking_grants_for_research
select (max(t0.c2) / cast(max(t1.c2) as real) - 1) * 100 from (select avg(t1.grant_id) as c2 from grants as t0 join documents as t1 on t0.grant_id = t1.grant_id where t1.sent_date = '2001-06-18 06:35:49' and t0.grant_start_date < '2016-02-25 04:28:44' group by t0.grant_id) as t0, (select t0.grant_id, avg(t1.grant_id) a...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "tracking_grants_for_research", "sql": "select (max(t0.c2) / cast(max(t1.c2) as real) - 1) * 100 from (select avg(t1.grant_id) as c2 from grants as t0 join documents as t1 on t0.grant_id = t1.grant_id where t1.sent_date = '2001-06-18 06:35:49' and t0.grant_start_date < '2016-02-25...
{ "index": 3054, "split": "train" }
Find the model names, ROM sizes in MiB, and launch years of chip models that are used in phones with hardware model names starting with "LG-", excluding those that are associated with the company Huawei Technologies Co. Ltd.
phone_1
select anon_1.c0, anon_1.c2, anon_1.c1 from (select t0.model_name as c0, t0.rom_mib as c2, t0.launch_year as c1 from chip_model as t0 join phone as t1 on t0.model_name = t1.chip_model where t1.hardware_model_name like 'LG-%' except select t0.model_name as c0, t0.rom_mib as c2, t0.launch_year as c1 from chip_model as t0...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "phone_1", "sql": "select anon_1.c0, anon_1.c2, anon_1.c1 from (select t0.model_name as c0, t0.rom_mib as c2, t0.launch_year as c1 from chip_model as t0 join phone as t1 on t0.model_name = t1.chip_model where t1.hardware_model_name like 'LG-%' except select t0.model_name as c0, t0...
{ "index": 520, "split": "train" }
How many days pass between the date and time of each race held after 1964?
formula_1
select julianday(t1.c1) - julianday(t0.c0) from (select date as c1 from races) as t1, (select time as c0 from races where year > 1964 and year > 1964) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "formula_1", "sql": "select julianday(t1.c1) - julianday(t0.c0) from (select date as c1 from races) as t1, (select time as c0 from races where year > 1964 and year > 1964) as t0" }, "style": "rule" }
{ "index": 3716, "split": "train" }
In the ranking of transaction types based on the total sum of investor IDs involved, where does the purchase transactions ('PUR') stand in descending order?
tracking_share_transactions
select t1.c1, t1.c2 as c0 from (select row_number() over (order by t0.c3 desc) as c1, t0.c4 as c2 from (select t0.transaction_type_code as c4, sum(t1.investor_id) as c3 from ref_transaction_types as t0 join transactions as t1 on t0.transaction_type_code = t1.transaction_type_code group by c4) as t0) as t1 where c0 = 'P...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "tracking_share_transactions", "sql": "select t1.c1, t1.c2 as c0 from (select row_number() over (order by t0.c3 desc) as c1, t0.c4 as c2 from (select t0.transaction_type_code as c4, sum(t1.investor_id) as c3 from ref_transaction_types as t0 join transactions as t1 on t0.transactio...
{ "index": 3509, "split": "train" }
When did the staff member with ID 37.0 start working on their most recent project?
tracking_grants_for_research
select t0.date_from, t0.project_id as c1 from project_staff as t0, (select max(project_id) as c3 from project_staff where staff_id = 37.0) as t1 where c1 = t1.c3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "tracking_grants_for_research", "sql": "select t0.date_from, t0.project_id as c1 from project_staff as t0, (select max(project_id) as c3 from project_staff where staff_id = 37.0) as t1 where c1 = t1.c3" }, "style": "rule" }
{ "index": 3835, "split": "train" }
Is the lowest overall rating for player 10795, among ratings less than 62, higher than the lowest overall rating for player 9850 within the same rating range?
soccer_1
select t1.c1 < t0.c1 from (select min(t1.overall_rating) as c1 from player as t0 join player_attributes as t1 on t0.player_api_id = t1.player_api_id where t0.id = 9850 and t1.overall_rating < 62 group by t0.id) as t1, (select t0.id, min(t1.overall_rating) as c1 from player as t0 join player_attributes as t1 on t0.playe...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "soccer_1", "sql": "select t1.c1 < t0.c1 from (select min(t1.overall_rating) as c1 from player as t0 join player_attributes as t1 on t0.player_api_id = t1.player_api_id where t0.id = 9850 and t1.overall_rating < 62 group by t0.id) as t1, (select t0.id, min(t1.overall_rating) as c1...
{ "index": 3574, "split": "train" }
Which are the three courses offered in either Fall or Spring semester, including their Course IDs, credits, and titles, sorted by room number with nulls last?
college_2
select t0.course_id, t0.credits, t0.title from course as t0 join section as t1 on t0.course_id = t1.course_id where t1.semester = 'Fall' or t1.semester = 'Spring' order by t1.room_number asc nulls last limit 3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "college_2", "sql": "select t0.course_id, t0.credits, t0.title from course as t0 join section as t1 on t0.course_id = t1.course_id where t1.semester = 'Fall' or t1.semester = 'Spring' order by t1.room_number asc nulls last limit 3" }, "style": "rule" }
{ "index": 2425, "split": "train" }
Which document structure codes and descriptions are associated with documents in functional area 8, excluding those linked to functional areas ending with "1"?
document_management
select anon_1.c1, anon_1.c0 from (select t0.document_structure_code as c1, t0.document_structure_description as c0 from document_structures as t0 join documents as t1 on t0.document_structure_code = t1.document_structure_code join document_functional_areas as t2 on t1.document_code = t2.document_code join functional_ar...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "document_management", "sql": "select anon_1.c1, anon_1.c0 from (select t0.document_structure_code as c1, t0.document_structure_description as c0 from document_structures as t0 join documents as t1 on t0.document_structure_code = t1.document_structure_code join document_functional...
{ "index": 2108, "split": "train" }
Can you list the ten most recent author IDs, along with their course descriptions and subject IDs, for courses that are categorized under the subject "Arts," sorted by author ID in descending order?
e_learning
select t0.author_id as c2, t0.course_description, t1.subject_id from courses as t0 join subjects as t1 on t0.subject_id = t1.subject_id where t1.subject_name = 'Arts' order by c2 desc limit 10
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "e_learning", "sql": "select t0.author_id as c2, t0.course_description, t1.subject_id from courses as t0 join subjects as t1 on t0.subject_id = t1.subject_id where t1.subject_name = 'Arts' order by c2 desc limit 10" }, "style": "rule" }
{ "index": 1787, "split": "train" }
Which part faults are associated with the skills required to fix them, where the engineer skills have an ID less than 3? For these faults, list the part fault ID, part ID, fault short name, and the skill description, showing only the first 10 results ordered alphabetically by skill description.
assets_maintenance
select t0.part_fault_id, t0.part_id, t0.fault_short_name, t2.skill_description as c0 from part_faults as t0 join skills_required_to_fix as t1 on t0.part_fault_id = t1.part_fault_id join skills as t2 on t1.skill_id = t2.skill_id join engineer_skills as t3 on t2.skill_id = t3.skill_id where t3.skill_id < 3 order by c0 as...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "assets_maintenance", "sql": "select t0.part_fault_id, t0.part_id, t0.fault_short_name, t2.skill_description as c0 from part_faults as t0 join skills_required_to_fix as t1 on t0.part_fault_id = t1.part_fault_id join skills as t2 on t1.skill_id = t2.skill_id join engineer_skills as...
{ "index": 1171, "split": "train" }
Can you list the enrollment numbers, IHSAA football classifications, and counties of schools that have received endowment contributions under 9.51, but excluding those where the donor's name includes the letter "P"?
school_finance
select anon_1.c0, anon_1.c1, anon_1.c2 from (select t0.enrollment as c0, t0.ihsaa_football_class as c1, t0.county as c2 from school as t0 join endowment as t1 on t0.school_id = t1.school_id where t1.amount < 9.51 except select t0.enrollment as c0, t0.ihsaa_football_class as c1, t0.county as c2 from school as t0 join en...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "school_finance", "sql": "select anon_1.c0, anon_1.c1, anon_1.c2 from (select t0.enrollment as c0, t0.ihsaa_football_class as c1, t0.county as c2 from school as t0 join endowment as t1 on t0.school_id = t1.school_id where t1.amount < 9.51 except select t0.enrollment as c0, t0.ihsa...
{ "index": 2181, "split": "train" }
For document structures that are associated with fewer than four documents whose names begin with "Learning Eng" and are of type "Book," what are the descriptions and codes of these structures?
document_management
select t0.document_structure_description, t0.document_structure_code as c1 from document_structures as t0 join documents as t1 on t0.document_structure_code = t1.document_structure_code where t1.document_name like 'Learning Eng%' and t1.document_type_code = 'Book' group by c1 having count(*) < 4
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "document_management", "sql": "select t0.document_structure_description, t0.document_structure_code as c1 from document_structures as t0 join documents as t1 on t0.document_structure_code = t1.document_structure_code where t1.document_name like 'Learning Eng%' and t1.document_type...
{ "index": 2834, "split": "train" }
Which are the top 10 Product Details for the product with ID 2 in order 8, sorted from Z to A?
customers_and_addresses
select t0.product_details as c0 from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_id = 2 and t1.order_id = 8 order by c0 desc limit 10
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "customers_and_addresses", "sql": "select t0.product_details as c0 from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_id = 2 and t1.order_id = 8 order by c0 desc limit 10" }, "style": "rule" }
{ "index": 2592, "split": "train" }
Which are the first 10 parts involved in fault ID 13 with part IDs between 1 and 3, listed along with their names and IDs, ordered by their chargeable amount with nulls appearing last?
assets_maintenance
select t0.part_name, t0.part_id from parts as t0 join part_faults as t1 on t0.part_id = t1.part_id where t1.part_fault_id = 13 and t1.part_id between 1 and 3 order by t0.chargeable_amount asc nulls last limit 10
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "assets_maintenance", "sql": "select t0.part_name, t0.part_id from parts as t0 join part_faults as t1 on t0.part_id = t1.part_id where t1.part_fault_id = 13 and t1.part_id between 1 and 3 order by t0.chargeable_amount asc nulls last limit 10" }, "style": "rule" }
{ "index": 137, "split": "train" }
How many days passed between the start date and the end date of each research grant?
tracking_grants_for_research
select julianday(t1.c2) - julianday(t0.c0) from (select grant_end_date as c2 from grants) as t1, (select grant_start_date as c0 from grants) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "tracking_grants_for_research", "sql": "select julianday(t1.c2) - julianday(t0.c0) from (select grant_end_date as c2 from grants) as t1, (select grant_start_date as c0 from grants) as t0" }, "style": "rule" }
{ "index": 3744, "split": "train" }
How many days passed between the Active From Date and Active To Date for the contact channel with the code 'Handheld'?
customers_and_addresses
select julianday(t1.c2) - julianday(t0.c3) from (select active_from_date as c2 from customer_contact_channels where channel_code = 'Handheld' and channel_code = 'Handheld') as t1, (select active_to_date as c3 from customer_contact_channels) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "customers_and_addresses", "sql": "select julianday(t1.c2) - julianday(t0.c3) from (select active_from_date as c2 from customer_contact_channels where channel_code = 'Handheld' and channel_code = 'Handheld') as t1, (select active_to_date as c3 from customer_contact_channels) as t0...
{ "index": 3691, "split": "train" }
Does teacher 13 have a higher address ID than teacher 12?
behavior_monitoring
select t1.c2 > t0.c2 from (select address_id as c2 from teachers where teacher_id = 13) as t1, (select address_id as c2 from teachers where teacher_id = 12) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "behavior_monitoring", "sql": "select t1.c2 > t0.c2 from (select address_id as c2 from teachers where teacher_id = 13) as t1, (select address_id as c2 from teachers where teacher_id = 12) as t0" }, "style": "rule" }
{ "index": 3885, "split": "train" }
Which products with IDs of 3 or higher have been ordered, and what are their details and IDs?
customers_and_addresses
select t0.product_details from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_id > 3 or t1.product_id >= 3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "customers_and_addresses", "sql": "select t0.product_details from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_id > 3 or t1.product_id >= 3" }, "style": "rule" }
{ "index": 167, "split": "train" }
What are the five campuses with the lowest total enrollments in 1996, based on fee data from that year, and what were their enrollment numbers and enrollment years?
csu_1
select t0.totalenrollment_ay as c1, t0.year from enrollments as t0 join campuses as t1 on t0.campus = t1.id join csu_fees as t2 on t1.id = t2.campus where t2.year = 1996 order by c1 asc nulls last limit 5
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "csu_1", "sql": "select t0.totalenrollment_ay as c1, t0.year from enrollments as t0 join campuses as t1 on t0.campus = t1.id join csu_fees as t2 on t1.id = t2.campus where t2.year = 1996 order by c1 asc nulls last limit 5" }, "style": "rule" }
{ "index": 34, "split": "train" }
Did account 7 open before account 8?
customers_and_invoices
select t1.c0 < t0.c0 from (select date_account_opened as c0 from accounts where account_id = 7) as t1, (select date_account_opened as c0 from accounts where account_id = 8) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "customers_and_invoices", "sql": "select t1.c0 < t0.c0 from (select date_account_opened as c0 from accounts where account_id = 7) as t1, (select date_account_opened as c0 from accounts where account_id = 8) as t0" }, "style": "rule" }
{ "index": 3882, "split": "train" }
Can you tell me the names and states of the top three colleges, along with their tryout decisions, where the players either have the most common Ycard value or a Ycard of 'yes', sorted by decision from Z to A?
soccer_2
select t0.cname, t0.state, t1.decision as c3 from college as t0 join tryout as t1 on t0.cname = t1.cname join player as t2 on t1.pid = t2.pid, (select ycard as c2 from player group by c2 order by count(*) desc limit 1) as t0 where t2.ycard = t0.c2 or t2.ycard = 'yes' order by c3 desc limit 3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "soccer_2", "sql": "select t0.cname, t0.state, t1.decision as c3 from college as t0 join tryout as t1 on t0.cname = t1.cname join player as t2 on t1.pid = t2.pid, (select ycard as c2 from player group by c2 order by count(*) desc limit 1) as t0 where t2.ycard = t0.c2 or t2.ycard =...
{ "index": 2270, "split": "train" }
Which playlist containing track ID 2337 comes first alphabetically, and what is its name?
store_1
select t0.name as c0 from playlists as t0 join playlist_tracks as t1 on t0.id = t1.playlist_id where t1.track_id = 2337 order by c0 asc nulls last limit 1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "store_1", "sql": "select t0.name as c0 from playlists as t0 join playlist_tracks as t1 on t0.id = t1.playlist_id where t1.track_id = 2337 order by c0 asc nulls last limit 1" }, "style": "rule" }
{ "index": 1809, "split": "train" }
For each city that experienced December temperatures of 26.7°C or lower, what are their city IDs and the highest temperature recorded in June?
city_record
select city_id as c1, max(jun) from temperature where dec <= 26.7 group by c1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "city_record", "sql": "select city_id as c1, max(jun) from temperature where dec <= 26.7 group by c1" }, "style": "rule" }
{ "index": 538, "split": "train" }
Can you tell me the name of the first Web Client Accelerator (when sorted alphabetically), which has been compatible with browsers since 1995 or later?
browser_web
select t0.name as c0 from web_client_accelerator as t0 join accelerator_compatible_browser as t1 on t0.id = t1.accelerator_id where t1.compatible_since_year >= 1995 or t1.compatible_since_year = 1995 order by c0 asc nulls last limit 1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "browser_web", "sql": "select t0.name as c0 from web_client_accelerator as t0 join accelerator_compatible_browser as t1 on t0.id = t1.accelerator_id where t1.compatible_since_year >= 1995 or t1.compatible_since_year = 1995 order by c0 asc nulls last limit 1" }, "style": "rule"...
{ "index": 39, "split": "train" }
For each order status code with more than four orders from customers with IDs between 1 and 13, what is the average customer ID and the number of unique orders?
customers_and_products_contacts
select order_status_code as c2, avg(customer_id), count(distinct (order_id)) from customer_orders where customer_id between 1 and 13 group by c2 having count(*) > 4
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "customers_and_products_contacts", "sql": "select order_status_code as c2, avg(customer_id), count(distinct (order_id)) from customer_orders where customer_id between 1 and 13 group by c2 having count(*) > 4" }, "style": "rule" }
{ "index": 284, "split": "train" }
Can you tell me the years and stadium IDs of the three most recent events where swimmers with the slowest 100-meter times (matching the maximum recorded time) took part?
swimming
select t0.year as c0, t0.stadium_id from event as t0 join record as t1 on t0.id = t1.event_id join swimmer as t2 on t1.swimmer_id = t2.id, (select max(meter_100) as c1 from swimmer) as t0 where t2.meter_100 >= t0.c1 order by c0 desc limit 3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "swimming", "sql": "select t0.year as c0, t0.stadium_id from event as t0 join record as t1 on t0.id = t1.event_id join swimmer as t2 on t1.swimmer_id = t2.id, (select max(meter_100) as c1 from swimmer) as t0 where t2.meter_100 >= t0.c1 order by c0 desc limit 3" }, "style": "ru...
{ "index": 2535, "split": "train" }
Is the date of birth of guest 10 earlier than their own date of birth?
apartment_rentals
select date_of_birth < date_of_birth from guests where guest_id = 10
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "apartment_rentals", "sql": "select date_of_birth < date_of_birth from guests where guest_id = 10" }, "style": "rule" }
{ "index": 3115, "split": "train" }
Can you tell me the average invoice ID, the total of track IDs, and the invoice ID for the invoices that have a total of either 18.86 or at least 25.86, focusing on the invoice with the lowest average invoice ID?
store_1
select avg(t0.invoice_id) as c0, sum(t0.track_id), t1.id as c1 from invoice_lines as t0 join invoices as t1 on t0.invoice_id = t1.id where t1.total = 18.86 or t1.total >= 25.86 group by c1 order by c0 asc nulls last limit 1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "store_1", "sql": "select avg(t0.invoice_id) as c0, sum(t0.track_id), t1.id as c1 from invoice_lines as t0 join invoices as t1 on t0.invoice_id = t1.id where t1.total = 18.86 or t1.total >= 25.86 group by c1 order by c0 asc nulls last limit 1" }, "style": "rule" }
{ "index": 558, "split": "train" }
Which are the top three station IDs with the highest average number of bikes available, among those stations where the average bikes available falls between 1 and 2?
bike_1
select station_id as c0, avg(bikes_available) as c1 from status group by c0 having avg(bikes_available) between 1 and 2 order by c1 desc limit 3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "bike_1", "sql": "select station_id as c0, avg(bikes_available) as c1 from status group by c0 having avg(bikes_available) between 1 and 2 order by c1 desc limit 3" }, "style": "rule" }
{ "index": 924, "split": "train" }
What is the percentage change in the number of unique staff members associated with addresses in the USA that had staff leave on March 8, 2018, at 12:31:16?
driving_school
select (count(distinct (t0.c1)) / cast(count(distinct (t0.c1)) as real) - 1) * 100 from (select count(distinct (t1.staff_id)) as c1 from addresses as t0 join staff as t1 on t0.address_id = t1.staff_address_id where t1.date_left_staff = '2018-03-08 12:31:16' and t0.country like 'USA%' group by t0.address_id) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "driving_school", "sql": "select (count(distinct (t0.c1)) / cast(count(distinct (t0.c1)) as real) - 1) * 100 from (select count(distinct (t1.staff_id)) as c1 from addresses as t0 join staff as t1 on t0.address_id = t1.staff_address_id where t1.date_left_staff = '2018-03-08 12:31:1...
{ "index": 3977, "split": "train" }
Looking at the least frequently occurring order, how many distinct order IDs and how many orders are there for each order status code?
customer_deliveries
select t0.order_status_code as c1, count(distinct (t0.actual_order_id)) from actual_orders as t0, (select actual_order_id as c0 from actual_orders group by c0 order by count(*) asc nulls last limit 1) as t0 where t0.actual_order_id = t0.c0 group by c1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "customer_deliveries", "sql": "select t0.order_status_code as c1, count(distinct (t0.actual_order_id)) from actual_orders as t0, (select actual_order_id as c0 from actual_orders group by c0 order by count(*) asc nulls last limit 1) as t0 where t0.actual_order_id = t0.c0 group by c...
{ "index": 1041, "split": "train" }
What are the names and IDs of amenities, along with their corresponding amenity IDs and dorm IDs, for all dorms with students living in them that have dorm IDs of 160 or higher?
dorm_1
select t0.amenity_name, t0.amenid, t1.amenid, t1.dormid from dorm_amenity as t0 join has_amenity as t1 on t0.amenid = t1.amenid join dorm as t2 on t1.dormid = t2.dormid join lives_in as t3 on t2.dormid = t3.dormid where t3.dormid >= 160
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "dorm_1", "sql": "select t0.amenity_name, t0.amenid, t1.amenid, t1.dormid from dorm_amenity as t0 join has_amenity as t1 on t0.amenid = t1.amenid join dorm as t2 on t1.dormid = t2.dormid join lives_in as t3 on t2.dormid = t3.dormid where t3.dormid >= 160" }, "style": "rule" }
{ "index": 1143, "split": "train" }
Which medicine has the smallest medicine ID among all the recorded enzyme interactions?
medicine_enzyme_interaction
select medicine_id as c0 from medicine_enzyme_interaction order by c0 asc nulls last limit 1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "medicine_enzyme_interaction", "sql": "select medicine_id as c0 from medicine_enzyme_interaction order by c0 asc nulls last limit 1" }, "style": "rule" }
{ "index": 539, "split": "train" }
What is the description and code of the functional area with code 1 that comes last alphabetically?
document_management
select t0.functional_area_description as c0, t0.functional_area_code from functional_areas as t0 join document_functional_areas as t1 on t0.functional_area_code = t1.functional_area_code where t1.functional_area_code = 1 order by c0 desc limit 1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "document_management", "sql": "select t0.functional_area_description as c0, t0.functional_area_code from functional_areas as t0 join document_functional_areas as t1 on t0.functional_area_code = t1.functional_area_code where t1.functional_area_code = 1 order by c0 desc limit 1" }...
{ "index": 1542, "split": "train" }
Who are the first ten winning pilots along with the locations and countries of their matches, sorted alphabetically by country?
aircraft
select winning_pilot, location, country as c0 from match order by c0 asc nulls last limit 10
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "aircraft", "sql": "select winning_pilot, location, country as c0 from match order by c0 asc nulls last limit 10" }, "style": "rule" }
{ "index": 614, "split": "train" }
Which five airlines have routes starting from airports whose name contains "i" and city contains "wa," and what are their names, airline IDs, and active status, sorted alphabetically by airline name?
flight_4
select t0.name as c1, t0.alid, t0.active from airlines as t0 join routes as t1 on t0.alid = t1.alid join airports as t2 on t1.src_apid = t2.apid where t2.name like '%i%' and t2.city like '%wa%' order by c1 asc nulls last limit 5
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "flight_4", "sql": "select t0.name as c1, t0.alid, t0.active from airlines as t0 join routes as t1 on t0.alid = t1.alid join airports as t2 on t1.src_apid = t2.apid where t2.name like '%i%' and t2.city like '%wa%' order by c1 asc nulls last limit 5" }, "style": "rule" }
{ "index": 1819, "split": "train" }
How many injuries were recorded for each game, and what are the season and game ID for games played at stadiums with IDs of 2 or higher?
game_injury
select count(t0.game_id), t1.season, t1.id as c1 from injury_accident as t0 join game as t1 on t0.game_id = t1.id where t1.stadium_id >= 7 or t1.stadium_id >= 2 group by c1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "game_injury", "sql": "select count(t0.game_id), t1.season, t1.id as c1 from injury_accident as t0 join game as t1 on t0.game_id = t1.id where t1.stadium_id >= 7 or t1.stadium_id >= 2 group by c1" }, "style": "rule" }
{ "index": 2094, "split": "train" }
What is the highest catalog level number and how many unique attribute IDs are associated with catalog levels at or above the total number of catalogs?
product_catalog
select max(t0.catalog_level_number), count(distinct (t0.attribute_id)) from catalog_contents_additional_attributes as t0 join catalog_structure as t1 on t0.catalog_level_number = t1.catalog_level_number, (select count(catalog_id) as c1 from catalog_structure) as t0 where t1.catalog_id >= t0.c1 group by t1.catalog_level...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "product_catalog", "sql": "select max(t0.catalog_level_number), count(distinct (t0.attribute_id)) from catalog_contents_additional_attributes as t0 join catalog_structure as t1 on t0.catalog_level_number = t1.catalog_level_number, (select count(catalog_id) as c1 from catalog_struc...
{ "index": 1841, "split": "train" }
What is the smallest Asset Part ID for the parts with Part ID 3, and what is the Part ID for those parts?
assets_maintenance
select min(t0.part_id), t1.part_id as c1 from asset_parts as t0 join parts as t1 on t0.part_id = t1.part_id where c1 = 3 group by c1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "assets_maintenance", "sql": "select min(t0.part_id), t1.part_id as c1 from asset_parts as t0 join parts as t1 on t0.part_id = t1.part_id where c1 = 3 group by c1" }, "style": "rule" }
{ "index": 2567, "split": "train" }
Can you tell me the distinct order IDs and product IDs for items in orders whose status codes include the letter "l," along with the corresponding customer order IDs?
department_store
select distinct t0.order_id, t0.product_id, t1.order_id from order_items as t0 join customer_orders as t1 on t0.order_id = t1.order_id where t1.order_status_code like '%l%'
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "department_store", "sql": "select distinct t0.order_id, t0.product_id, t1.order_id from order_items as t0 join customer_orders as t1 on t0.order_id = t1.order_id where t1.order_status_code like '%l%'" }, "style": "rule" }
{ "index": 274, "split": "train" }
Identify the top 3 school bus drivers based on the number of schools they are assigned to, considering only those who have worked with a school for six years or less, or more than ten years. For each of these drivers, include their driver ID, the count of unique schools they’ve served, and the total number of their ass...
school_bus
select driver_id as c0, count(distinct (school_id)), count(driver_id) as c2 from school_bus where years_working <= 6 or years_working > 10 group by c0 order by c2 asc nulls last limit 3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "school_bus", "sql": "select driver_id as c0, count(distinct (school_id)), count(driver_id) as c2 from school_bus where years_working <= 6 or years_working > 10 group by c0 order by c2 asc nulls last limit 3" }, "style": "rule" }
{ "index": 1660, "split": "train" }
Show the order IDs and quantities for orders placed by customers whose addresses are in Maine or in areas whose names start with "Kentu" (such as Kentucky).
customers_and_products_contacts
select t0.order_id, t0.order_quantity from order_items as t0 join customer_orders as t1 on t0.order_id = t1.order_id join customers as t2 on t1.customer_id = t2.customer_id join customer_address_history as t3 on t2.customer_id = t3.customer_id join addresses as t4 on t3.address_id = t4.address_id where t4.state_provinc...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "customers_and_products_contacts", "sql": "select t0.order_id, t0.order_quantity from order_items as t0 join customer_orders as t1 on t0.order_id = t1.order_id join customers as t2 on t1.customer_id = t2.customer_id join customer_address_history as t3 on t2.customer_id = t3.custom...
{ "index": 1579, "split": "train" }
Which individuals serve as contact persons for organizations with IDs 1 or 3, and what are their middle names, last names, and individual IDs?
e_government
select t0.individual_middle_name, t0.individual_last_name from individuals as t0 join organization_contact_individuals as t1 on t0.individual_id = t1.individual_id where t1.organization_id = 1 or t1.organization_id = 3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "e_government", "sql": "select t0.individual_middle_name, t0.individual_last_name from individuals as t0 join organization_contact_individuals as t1 on t0.individual_id = t1.individual_id where t1.organization_id = 1 or t1.organization_id = 3" }, "style": "rule" }
{ "index": 1501, "split": "train" }
What are the customer ID and savings balance for the customer with custid 3?
small_bank_1
select t0.custid, t0.balance, t1.custid as c0 from savings as t0 join accounts as t1 on t0.custid = t1.custid where c0 = 3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "small_bank_1", "sql": "select t0.custid, t0.balance, t1.custid as c0 from savings as t0 join accounts as t1 on t0.custid = t1.custid where c0 = 3" }, "style": "rule" }
{ "index": 493, "split": "train" }
Return the IDs and names of the top three department store chains with the highest chain IDs, specifically the chain for the store with the most locations and the chain that includes store number 12, ordered by chain ID in descending order.
department_store
select t0.dept_store_chain_id as c0, t0.dept_store_chain_name from department_store_chain as t0 join department_stores as t1 on t0.dept_store_chain_id = t1.dept_store_chain_id, (select dept_store_id as c1 from department_stores group by c1 order by count(dept_store_chain_id) desc limit 1) as t0 where t1.dept_store_id =...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "department_store", "sql": "select t0.dept_store_chain_id as c0, t0.dept_store_chain_name from department_store_chain as t0 join department_stores as t1 on t0.dept_store_chain_id = t1.dept_store_chain_id, (select dept_store_id as c1 from department_stores group by c1 order by coun...
{ "index": 1195, "split": "train" }
What is the number of days that passed between the opening date and the closing date of policies that were opened between January 8 and January 9, 2017?
insurance_fnol
select julianday(t1.c0) - julianday(t0.c1) from (select date_closed as c0 from customers_policies) as t1, (select date_opened as c1 from customers_policies where c1 between '2017-01-08 00:00:00' and '2017-01-09 00:00:00' and c1 between '2017-01-08 00:00:00' and '2017-01-09 00:00:00') as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "insurance_fnol", "sql": "select julianday(t1.c0) - julianday(t0.c1) from (select date_closed as c0 from customers_policies) as t1, (select date_opened as c1 from customers_policies where c1 between '2017-01-08 00:00:00' and '2017-01-09 00:00:00' and c1 between '2017-01-08 00:00:0...
{ "index": 3725, "split": "train" }
For each teacher, what is the number of students they teach, listed along with the teacher's last name, ordered from the least to the most students?
student_1
select lastname as c0, count(firstname) from teachers group by c0 order by count(*) asc nulls last
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "student_1", "sql": "select lastname as c0, count(firstname) from teachers group by c0 order by count(*) asc nulls last" }, "style": "rule" }
{ "index": 1456, "split": "train" }
Is the compatible since year for accelerator 2 and browser 3 later than the total number of unique years since 2005 when any accelerators have been compatible?
browser_web
select t2.c3 > t1.c1 from (select compatible_since_year as c3 from accelerator_compatible_browser where accelerator_id = 2 and browser_id = 3) as t2, (select count(distinct (compatible_since_year)) as c1 from accelerator_compatible_browser where compatible_since_year >= 2005) as t1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "browser_web", "sql": "select t2.c3 > t1.c1 from (select compatible_since_year as c3 from accelerator_compatible_browser where accelerator_id = 2 and browser_id = 3) as t2, (select count(distinct (compatible_since_year)) as c1 from accelerator_compatible_browser where compatible_s...
{ "index": 3263, "split": "train" }
How many days apart are the employees' hire dates and their birth dates?
store_1
select julianday(t1.c0) - julianday(t0.c2) from (select hire_date as c0 from employees) as t1, (select birth_date as c2 from employees) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "store_1", "sql": "select julianday(t1.c0) - julianday(t0.c2) from (select hire_date as c0 from employees) as t1, (select birth_date as c2 from employees) as t0" }, "style": "rule" }
{ "index": 3740, "split": "train" }
What are the smallest and largest address IDs for addresses that end with "3"?
customers_and_addresses
select min(t0.c1), max(t0.c1) from (select min(t1.address_id) as c1 from addresses as t0 join customer_addresses as t1 on t0.address_id = t1.address_id where t0.address_content like '%3' group by t0.address_id) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "customers_and_addresses", "sql": "select min(t0.c1), max(t0.c1) from (select min(t1.address_id) as c1 from addresses as t0 join customer_addresses as t1 on t0.address_id = t1.address_id where t0.address_content like '%3' group by t0.address_id) as t0" }, "style": "rule" }
{ "index": 3848, "split": "train" }
What are the destinations, names, and origins of the train that has the most frequent ID or an ID equal to 8?
station_weather
select t0.destination, t0.name, t0.origin from train as t0, (select id as c0 from train group by c0 order by count(*) desc limit 1) as t0 where t0.id = t0.c0 or t0.id = 8
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "station_weather", "sql": "select t0.destination, t0.name, t0.origin from train as t0, (select id as c0 from train group by c0 order by count(*) desc limit 1) as t0 where t0.id = t0.c0 or t0.id = 8" }, "style": "rule" }
{ "index": 1921, "split": "train" }
What are the other details and property IDs for residents when the property's ID is 120, or when there are no customer event notes associated with that property?
local_govt_and_lot
select t0.other_details, t1.property_id as c0 from residents as t0 join properties as t1 on t0.property_id = t1.property_id where c0 = 120 or (not c0 in (select customer_event_notes.property_id as c2 from customer_event_notes))
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "local_govt_and_lot", "sql": "select t0.other_details, t1.property_id as c0 from residents as t0 join properties as t1 on t0.property_id = t1.property_id where c0 = 120 or (not c0 in (select customer_event_notes.property_id as c2 from customer_event_notes))" }, "style": "rule"...
{ "index": 1712, "split": "train" }
What is the percentage change in the highest total number of student enrollments for any course between July 15, 2017, and December 4, 2017?
e_learning
select (max(t0.c2) / cast(max(t1.c2) as real) - 1) * 100 from (select sum(t1.student_id) as c2 from courses as t0 join student_course_enrolment as t1 on t0.course_id = t1.course_id where t1.date_of_enrolment = '2017-12-04 12:16:10' group by t0.course_id) as t0, (select t0.course_id, sum(t1.student_id) as c2 from course...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "e_learning", "sql": "select (max(t0.c2) / cast(max(t1.c2) as real) - 1) * 100 from (select sum(t1.student_id) as c2 from courses as t0 join student_course_enrolment as t1 on t0.course_id = t1.course_id where t1.date_of_enrolment = '2017-12-04 12:16:10' group by t0.course_id) as t...
{ "index": 3033, "split": "train" }
Is the airline ID for the route with ID 19121 less than 3856?
flight_4
select alid < 3856 from routes where rid = 19121
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "flight_4", "sql": "select alid < 3856 from routes where rid = 19121" }, "style": "rule" }
{ "index": 3340, "split": "train" }
Find the division, department name, and room of the department that has the earliest room number among departments with male faculty members.
college_3
select t0.division, t0.dname, t0.room as c2 from department as t0 join member_of as t1 on t0.dno = t1.dno join faculty as t2 on t1.facid = t2.facid where t2.sex like '%M%' order by c2 asc nulls last limit 1
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "college_3", "sql": "select t0.division, t0.dname, t0.room as c2 from department as t0 join member_of as t1 on t0.dno = t1.dno join faculty as t2 on t1.facid = t2.facid where t2.sex like '%M%' order by c2 asc nulls last limit 1" }, "style": "rule" }
{ "index": 2686, "split": "train" }
What are the details of the top 5 screen modes, including used kilobytes, character cells, and pixel count, for phones with chip models that have between 32 and 64 MiB of RAM, ordered by pixel resolution from lowest to highest?
phone_1
select t0.used_kb, t0.char_cells, t0.pixels as c0 from screen_mode as t0 join phone as t1 on t0.graphics_mode = t1.screen_mode join chip_model as t2 on t1.chip_model = t2.model_name where t2.ram_mib between 32.0 and 64.0 order by c0 asc nulls last limit 5
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "phone_1", "sql": "select t0.used_kb, t0.char_cells, t0.pixels as c0 from screen_mode as t0 join phone as t1 on t0.graphics_mode = t1.screen_mode join chip_model as t2 on t1.chip_model = t2.model_name where t2.ram_mib between 32.0 and 64.0 order by c0 asc nulls last limit 5" }, ...
{ "index": 2072, "split": "train" }
How much greater is the total customer ID sum for booking 15 compared to the smallest total customer ID sum among bookings with payments due of 278.6 or less?
products_for_hire
select t2.c1 - t0.c0 from (select min(t1.c0) as c1 from (select sum(t1.customer_id) as c0 from bookings as t0 join payments as t1 on t0.booking_id = t1.booking_id where t1.amount_due <= 278.6 group by t0.booking_id) as t1) as t2, (select t0.booking_id, sum(t1.customer_id) as c0 from bookings as t0 join payments as t1 o...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "products_for_hire", "sql": "select t2.c1 - t0.c0 from (select min(t1.c0) as c1 from (select sum(t1.customer_id) as c0 from bookings as t0 join payments as t1 on t0.booking_id = t1.booking_id where t1.amount_due <= 278.6 group by t0.booking_id) as t1) as t2, (select t0.booking_id,...
{ "index": 3198, "split": "train" }
Can you tell me the number of unique students enrolled with each course author or tutor, along with their personal and login names, for those whose average course ID is between 1 and 11? Please list the three authors or tutors with the fewest students.
e_learning
select count(distinct (t0.student_id)) as c0, t2.personal_name, t2.login_name from student_course_enrolment as t0 join courses as t1 on t0.course_id = t1.course_id join course_authors_and_tutors as t2 on t1.author_id = t2.author_id group by t2.author_id having avg(t0.course_id) between 1 and 11 order by c0 asc nulls la...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "e_learning", "sql": "select count(distinct (t0.student_id)) as c0, t2.personal_name, t2.login_name from student_course_enrolment as t0 join courses as t1 on t0.course_id = t1.course_id join course_authors_and_tutors as t2 on t1.author_id = t2.author_id group by t2.author_id havin...
{ "index": 954, "split": "train" }
How many years before or after five is Zach's friendship year recorded?
network_2
select year - 5 from personfriend where name = 'Zach'
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "network_2", "sql": "select year - 5 from personfriend where name = 'Zach'" }, "style": "rule" }
{ "index": 3245, "split": "train" }
What are the first five actual order IDs and their status codes, listed in order of their IDs?
customer_deliveries
select actual_order_id as c0, order_status_code from actual_orders order by c0 asc nulls last limit 5
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "customer_deliveries", "sql": "select actual_order_id as c0, order_status_code from actual_orders order by c0 asc nulls last limit 5" }, "style": "rule" }
{ "index": 2187, "split": "train" }
When did the policy of the customer with the highest ID among those with a policy type starting with "J" come into effect?
insurance_and_eClaims
select t0.start_date, t0.customer_id as c2 from policies as t0, (select max(customer_id) as c0 from policies where policy_type_code like 'J%') as t1 where c2 = t1.c0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "insurance_and_eClaims", "sql": "select t0.start_date, t0.customer_id as c2 from policies as t0, (select max(customer_id) as c0 from policies where policy_type_code like 'J%') as t1 where c2 = t1.c0" }, "style": "rule" }
{ "index": 3781, "split": "train" }
Which are the ten enzyme IDs involved in interactions that include the letters "r" or "o" in their interaction type, ranked by the medicines’ FDA approval status?
medicine_enzyme_interaction
select t0.enzyme_id from medicine_enzyme_interaction as t0 join medicine as t1 on t0.medicine_id = t1.id where t0.interaction_type like '%r%' or t0.interaction_type like '%o%' order by t1.fda_approved asc nulls last limit 10
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "medicine_enzyme_interaction", "sql": "select t0.enzyme_id from medicine_enzyme_interaction as t0 join medicine as t1 on t0.medicine_id = t1.id where t0.interaction_type like '%r%' or t0.interaction_type like '%o%' order by t1.fda_approved asc nulls last limit 10" }, "style": ...
{ "index": 487, "split": "train" }
How many distinct hotels are rated with 4 stars?
cre_Theme_park
select t0.c1 from (select count(distinct (t1.hotel_id)) as c1 from ref_hotel_star_ratings as t0 join hotels as t1 on t0.star_rating_code = t1.star_rating_code where t0.star_rating_code = 4 group by t0.star_rating_code) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "cre_Theme_park", "sql": "select t0.c1 from (select count(distinct (t1.hotel_id)) as c1 from ref_hotel_star_ratings as t0 join hotels as t1 on t0.star_rating_code = t1.star_rating_code where t0.star_rating_code = 4 group by t0.star_rating_code) as t0" }, "style": "rule" }
{ "index": 3365, "split": "train" }
What are the three most common artwork types, along with the count of unique types and total number of artworks for each?
entertainment_awards
select type as c0, count(distinct (type)), count(*) as c2 from artwork group by c0 order by c2 desc limit 3
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "entertainment_awards", "sql": "select type as c0, count(distinct (type)), count(*) as c2 from artwork group by c0 order by c2 desc limit 3" }, "style": "rule" }
{ "index": 2506, "split": "train" }
Can you list the addresses, customer IDs, and order IDs for all orders with IDs less than 9?
department_store
select t0.address_id, t0.customer_id, t2.order_id from customer_addresses as t0 join customers as t1 on t0.customer_id = t1.customer_id join customer_orders as t2 on t1.customer_id = t2.customer_id join order_items as t3 on t2.order_id = t3.order_id where t3.order_id < 9
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "department_store", "sql": "select t0.address_id, t0.customer_id, t2.order_id from customer_addresses as t0 join customers as t1 on t0.customer_id = t1.customer_id join customer_orders as t2 on t1.customer_id = t2.customer_id join order_items as t3 on t2.order_id = t3.order_id whe...
{ "index": 701, "split": "train" }
Looking at the camera lenses used to photograph the mountain with photo ID 8, what are the first 10 lens IDs along with their highest camera lens ID, sorted by the brand name in alphabetical order?
mountain_photos
select t0.id as c0, max(t1.camera_lens_id) from camera_lens as t0 join photos as t1 on t0.id = t1.camera_lens_id where t1.id = 8 group by c0 order by t0.brand asc nulls last limit 10
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "mountain_photos", "sql": "select t0.id as c0, max(t1.camera_lens_id) from camera_lens as t0 join photos as t1 on t0.id = t1.camera_lens_id where t1.id = 8 group by c0 order by t0.brand asc nulls last limit 10" }, "style": "rule" }
{ "index": 2730, "split": "train" }
What are the rankings and market IDs of all markets, including those that stock phones from the carrier with the highest number of models?
phone_market
select anon_1.c0, anon_1.c2 from (select ranking as c0, market_id as c2 from market union select t0.ranking as c0, t0.market_id as c2 from market as t0 join phone_market as t1 on t0.market_id = t1.market_id join phone as t2 on t1.phone_id = t2.phone_id, (select carrier as c1 from phone group by c1 order by count(*) des...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "phone_market", "sql": "select anon_1.c0, anon_1.c2 from (select ranking as c0, market_id as c2 from market union select t0.ranking as c0, t0.market_id as c2 from market as t0 join phone_market as t1 on t0.market_id = t1.market_id join phone as t2 on t1.phone_id = t2.phone_id, (se...
{ "index": 2941, "split": "train" }
What are the top 10 accounts, along with their associated customer IDs, that have the most transactions involving cards with an ID less than 7?
customers_card_transactions
select t0.customer_id, t0.account_id as c1 from accounts as t0 join financial_transactions as t1 on t0.account_id = t1.account_id where t1.card_id < 7 group by c1 order by count(t1.card_id) desc limit 10
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "customers_card_transactions", "sql": "select t0.customer_id, t0.account_id as c1 from accounts as t0 join financial_transactions as t1 on t0.account_id = t1.account_id where t1.card_id < 7 group by c1 order by count(t1.card_id) desc limit 10" }, "style": "rule" }
{ "index": 494, "split": "train" }
Can you list the address IDs and first names of people whose mobile numbers include "8x314"?
student_assessment
select t0.address_id, t1.first_name from people_addresses as t0 join people as t1 on t0.person_id = t1.person_id where t1.cell_mobile_number like '%8x314%'
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "student_assessment", "sql": "select t0.address_id, t1.first_name from people_addresses as t0 join people as t1 on t0.person_id = t1.person_id where t1.cell_mobile_number like '%8x314%'" }, "style": "rule" }
{ "index": 1098, "split": "train" }
Does the average customer ID for party 4 exceed the total number of parties that have a payment method starting with "Cheque"?
e_government
select t2.c3 > t1.c2 from (select avg(t1.customer_id) as c3 from parties as t0 join party_services as t1 on t0.party_id = t1.customer_id where t0.party_id = 4 group by t0.party_id) as t2, (select count(t0.c3) as c2 from (select avg(t1.customer_id) as c3 from parties as t0 join party_services as t1 on t0.party_id = t1.c...
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "e_government", "sql": "select t2.c3 > t1.c2 from (select avg(t1.customer_id) as c3 from parties as t0 join party_services as t1 on t0.party_id = t1.customer_id where t0.party_id = 4 group by t0.party_id) as t2, (select count(t0.c3) as c2 from (select avg(t1.customer_id) as c3 fro...
{ "index": 3273, "split": "train" }
How many days elapse between the latest revision date of the catalogs and the publication date of catalog ID 8?
product_catalog
select julianday(t1.c0) - julianday(t0.c2) from (select date_of_latest_revision as c0 from catalogs) as t1, (select date_of_publication as c2 from catalogs where catalog_id = 8 and catalog_id = 8) as t0
spider
[ { "content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer...
logic
{ "ground_truth": { "db_id": "product_catalog", "sql": "select julianday(t1.c0) - julianday(t0.c2) from (select date_of_latest_revision as c0 from catalogs) as t1, (select date_of_publication as c2 from catalogs where catalog_id = 8 and catalog_id = 8) as t0" }, "style": "rule" }
{ "index": 3880, "split": "train" }