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 |
|---|---|---|---|---|---|---|---|---|
What are the three highest city IDs for cities that have addresses with city IDs either at most 300 or at least 404? Please list the city IDs in descending order. | sakila_1 | select t0.city_id as c0 from city as t0 join address as t1 on t0.city_id = t1.city_id where t1.city_id <= 300 or t1.city_id >= 404 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": "sakila_1",
"sql": "select t0.city_id as c0 from city as t0 join address as t1 on t0.city_id = t1.city_id where t1.city_id <= 300 or t1.city_id >= 404 order by c0 desc limit 3"
},
"style": "rule"
} | {
"index": 796,
"split": "train"
} | |
What is the pages per minute color capability of the product with ID 2? | store_product | select pages_per_minute_color from product where product_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": "store_product",
"sql": "select pages_per_minute_color from product where product_id = 2"
},
"style": "rule"
} | {
"index": 3400,
"split": "train"
} | |
What are the top 10 combinations of Budget Type Code, Budget Type Description, Project ID, and Document ID for expenses linked to either the most frequently used account or account 98, ordered by budget type code from Z to A? | cre_Docs_and_Epenses | select t0.budget_type_code as c4, t0.budget_type_description, t2.project_id, t2.document_id from ref_budget_codes as t0 join documents_with_expenses as t1 on t0.budget_type_code = t1.budget_type_code join documents as t2 on t1.document_id = t2.document_id join statements as t3 on t2.document_id = t3.statement_id join 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": "cre_Docs_and_Epenses",
"sql": "select t0.budget_type_code as c4, t0.budget_type_description, t2.project_id, t2.document_id from ref_budget_codes as t0 join documents_with_expenses as t1 on t0.budget_type_code = t1.budget_type_code join documents as t2 on t1.document_id = t2.docum... | {
"index": 2727,
"split": "train"
} | |
Can you tell me the address details for either the least frequently mailed address overall, or the most frequently mailed address associated with document ID 7 during the period from April 1, 1977, to November 7, 1992? | cre_Doc_Control_Systems | select t0.address_details from addresses as t0 join documents_mailed as t1 on t0.address_id = t1.mailed_to_address_id, (select mailed_to_address_id as c0 from documents_mailed group by c0 order by count(*) asc nulls last limit 1) as t1, (select mailed_to_address_id as c0 from documents_mailed where document_id = 7 and ... | 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_Doc_Control_Systems",
"sql": "select t0.address_details from addresses as t0 join documents_mailed as t1 on t0.address_id = t1.mailed_to_address_id, (select mailed_to_address_id as c0 from documents_mailed group by c0 order by count(*) asc nulls last limit 1) as t1, (select m... | {
"index": 1348,
"split": "train"
} | |
Which are the first three matches hosted in cities where January temperatures are either at least 17.8°C or less than or equal to the total number of January temperature recordings, sorted by Match ID? The details should include Match ID, Year, and Host City. | city_record | select t0.match_id as c2, t0.year, t0.host_city from hosting_city as t0 join city as t1 on t0.host_city = t1.city_id join temperature as t2 on t1.city_id = t2.city_id, (select count(jan) as c1 from temperature) as t0 where t2.jan <= t0.c1 or t2.jan >= 17.8 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": "city_record",
"sql": "select t0.match_id as c2, t0.year, t0.host_city from hosting_city as t0 join city as t1 on t0.host_city = t1.city_id join temperature as t2 on t1.city_id = t2.city_id, (select count(jan) as c1 from temperature) as t0 where t2.jan <= t0.c1 or t2.jan >= 17.8 o... | {
"index": 2911,
"split": "train"
} | |
What are the document codes and their descriptions of the structures labeled as "Header," sorted by document type? | document_management | select t0.document_code, t1.document_structure_description as c0 from documents as t0 join document_structures as t1 on t0.document_structure_code = t1.document_structure_code where c0 = 'Header' order by t0.document_type_code 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": "document_management",
"sql": "select t0.document_code, t1.document_structure_description as c0 from documents as t0 join document_structures as t1 on t0.document_structure_code = t1.document_structure_code where c0 = 'Header' order by t0.document_type_code asc nulls last"
},
... | {
"index": 1155,
"split": "train"
} | |
Is Bob's most recent friendship year later than Alice's? | network_2 | select t1.c0 > t0.c0 from (select year as c0 from personfriend where name = 'Alice') as t1, (select year as c0 from personfriend where name = 'Bob') 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": "network_2",
"sql": "select t1.c0 > t0.c0 from (select year as c0 from personfriend where name = 'Alice') as t1, (select year as c0 from personfriend where name = 'Bob') as t0"
},
"style": "rule"
} | {
"index": 3551,
"split": "train"
} | |
Which students who played the game with ID 4 have their first name, age, and city code listed? | game_1 | select anon_1.c1, anon_1.c2, anon_1.c0 from (select fname as c1, age as c2, city_code as c0 from student union select t0.fname as c1, t0.age as c2, t0.city_code as c0 from student as t0 join plays_games as t1 on t0.stuid = t1.stuid join video_games as t2 on t1.gameid = t2.gameid where t2.gameid = 4) 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": "game_1",
"sql": "select anon_1.c1, anon_1.c2, anon_1.c0 from (select fname as c1, age as c2, city_code as c0 from student union select t0.fname as c1, t0.age as c2, t0.city_code as c0 from student as t0 join plays_games as t1 on t0.stuid = t1.stuid join video_games as t2 on t1.ga... | {
"index": 1602,
"split": "train"
} | |
Which are the most recent five problem logs that have descriptions containing "p", and what is the total sum of their associated problem IDs? | tracking_software_problems | select problem_log_id as c0, sum(problem_id) from problem_log where log_entry_description like '%p%' or log_entry_description like '%p%' group by c0 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": "tracking_software_problems",
"sql": "select problem_log_id as c0, sum(problem_id) from problem_log where log_entry_description like '%p%' or log_entry_description like '%p%' group by c0 order by c0 desc limit 5"
},
"style": "rule"
} | {
"index": 832,
"split": "train"
} | |
Which country has the fewest associated addresses, and what are the country ID and country name along with the total number of related entries? | sakila_1 | select t0.country_id as c1, t0.country, count(*) as c0 from country as t0 join city as t1 on t0.country_id = t1.country_id join address as t2 on t1.city_id = t2.city_id 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": "sakila_1",
"sql": "select t0.country_id as c1, t0.country, count(*) as c0 from country as t0 join city as t1 on t0.country_id = t1.country_id join address as t2 on t1.city_id = t2.city_id group by c1 order by c0 asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 1332,
"split": "train"
} | |
Which genres are associated with track ID 2225, and what are their names and IDs, especially if there are three or fewer tracks with that ID in each genre? | store_1 | select t0.name, t0.id as c0 from genres as t0 join tracks as t1 on t0.id = t1.genre_id where t1.id = 2225 group by c0 having count(*) <= 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": "store_1",
"sql": "select t0.name, t0.id as c0 from genres as t0 join tracks as t1 on t0.id = t1.genre_id where t1.id = 2225 group by c0 having count(*) <= 3"
},
"style": "rule"
} | {
"index": 1453,
"split": "train"
} | |
Show the average invoice number for each account that has "VIP" in its account details, and sort the results by account ID. | customers_and_invoices | select avg(t0.invoice_number) from financial_transactions as t0 join accounts as t1 on t0.account_id = t1.account_id where t1.other_account_details = 'VIP' or t1.other_account_details = 'VIP' group by t1.account_id order by t1.account_id 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": "customers_and_invoices",
"sql": "select avg(t0.invoice_number) from financial_transactions as t0 join accounts as t1 on t0.account_id = t1.account_id where t1.other_account_details = 'VIP' or t1.other_account_details = 'VIP' group by t1.account_id order by t1.account_id asc nulls... | {
"index": 1372,
"split": "train"
} | |
When was the invoice date for the customer associated with invoice 132 when their customer ID was at its highest? | store_1 | select t0.invoice_date, t0.customer_id as c3 from invoices as t0, (select max(customer_id) as c1 from invoices where id = 132) as t1 where c3 = t1.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": "store_1",
"sql": "select t0.invoice_date, t0.customer_id as c3 from invoices as t0, (select max(customer_id) as c1 from invoices where id = 132) as t1 where c3 = t1.c1"
},
"style": "rule"
} | {
"index": 3796,
"split": "train"
} | |
Find the budget type codes and descriptions, along with the project ids and document descriptions, for documents associated with the statement having id 192. List these results sorted alphabetically by the document descriptions. | cre_Docs_and_Epenses | select t0.budget_type_code, t0.budget_type_description, t2.project_id, t2.document_description as c0 from ref_budget_codes as t0 join documents_with_expenses as t1 on t0.budget_type_code = t1.budget_type_code join documents as t2 on t1.document_id = t2.document_id join statements as t3 on t2.document_id = t3.statement_... | 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_Docs_and_Epenses",
"sql": "select t0.budget_type_code, t0.budget_type_description, t2.project_id, t2.document_description as c0 from ref_budget_codes as t0 join documents_with_expenses as t1 on t0.budget_type_code = t1.budget_type_code join documents as t2 on t1.document_id =... | {
"index": 1116,
"split": "train"
} | |
Can you list the IDs, reporting dates, and descriptions of problems related to products whose names end with "ach", as well as problems associated with the most frequently reported product? | tracking_software_problems | select anon_1.c0, anon_1.c2, anon_1.c1 from (select t0.problem_id as c0, t0.date_problem_reported as c2, t0.problem_description as c1 from problems as t0 join product as t1 on t0.product_id = t1.product_id where t1.product_name like '%ach' union select t0.problem_id as c0, t0.date_problem_reported as c2, t0.problem_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": "tracking_software_problems",
"sql": "select anon_1.c0, anon_1.c2, anon_1.c1 from (select t0.problem_id as c0, t0.date_problem_reported as c2, t0.problem_description as c1 from problems as t0 join product as t1 on t0.product_id = t1.product_id where t1.product_name like '%ach' uni... | {
"index": 519,
"split": "train"
} | |
Who are the three customers with the highest custid numbers when sorting all account holders by their names in reverse alphabetical order? | small_bank_1 | select custid from accounts order by name 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": "small_bank_1",
"sql": "select custid from accounts order by name desc limit 3"
},
"style": "rule"
} | {
"index": 2260,
"split": "train"
} | |
Find the 10 most recent invoices involving tracks from albums with IDs less than 154. For each invoice, tell me the customer's country, city, the billing state, and the invoice date. | store_1 | select t0.country, t0.city, t1.billing_state, t1.invoice_date as c3 from customers as t0 join invoices as t1 on t0.id = t1.customer_id join invoice_lines as t2 on t1.id = t2.invoice_id join tracks as t3 on t2.track_id = t3.id where t3.album_id < 154 order by c3 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": "store_1",
"sql": "select t0.country, t0.city, t1.billing_state, t1.invoice_date as c3 from customers as t0 join invoices as t1 on t0.id = t1.customer_id join invoice_lines as t2 on t1.id = t2.invoice_id join tracks as t3 on t2.track_id = t3.id where t3.album_id < 154 order by c3 ... | {
"index": 2659,
"split": "train"
} | |
Which are the three schools with the highest school IDs, along with their total budget percentage invested, that received endowments from the most common donor whose name contains "ó" or ends with "Distrito Nacional" and has donated more than 8.53? | school_finance | select t0.school_id as c1, t0.total_budget_percent_invested from budget as t0 join school as t1 on t0.school_id = t1.school_id join endowment as t2 on t1.school_id = t2.school_id, (select donator_name as c2 from endowment where c2 like '%ó%' or c2 like '%Distrito Nacional' group by c2 order by count(distinct (school_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": "school_finance",
"sql": "select t0.school_id as c1, t0.total_budget_percent_invested from budget as t0 join school as t1 on t0.school_id = t1.school_id join endowment as t2 on t1.school_id = t2.school_id, (select donator_name as c2 from endowment where c2 like '%ó%' or c2 like '%... | {
"index": 1590,
"split": "train"
} | |
What are the allergy names, their types, and related allergy entries for male students? | allergy_1 | select t0.allergy, t0.allergytype, t1.allergy from allergy_type as t0 join has_allergy as t1 on t0.allergy = t1.allergy join student as t2 on t1.stuid = t2.stuid where t2.sex like 'M%' | 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": "allergy_1",
"sql": "select t0.allergy, t0.allergytype, t1.allergy from allergy_type as t0 join has_allergy as t1 on t0.allergy = t1.allergy join student as t2 on t1.stuid = t2.stuid where t2.sex like 'M%'"
},
"style": "rule"
} | {
"index": 2132,
"split": "train"
} | |
Can you provide the product ID, size, color, and name for all products, as well as the details of products included in order number 5? | customers_and_invoices | select anon_1.c2, anon_1.c1, anon_1.c0, anon_1.c3 from (select product_id as c2, product_size as c1, product_color as c0, product_name as c3 from products union select t0.product_id as c2, t0.product_size as c1, t0.product_color as c0, t0.product_name as c3 from products as t0 join order_items as t1 on t0.product_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": "customers_and_invoices",
"sql": "select anon_1.c2, anon_1.c1, anon_1.c0, anon_1.c3 from (select product_id as c2, product_size as c1, product_color as c0, product_name as c3 from products union select t0.product_id as c2, t0.product_size as c1, t0.product_color as c0, t0.product_... | {
"index": 1095,
"split": "train"
} | |
What are the first names, student IDs, and city codes of students who live in dorms that have a kitchen in every room? | dorm_1 | select t0.fname, t0.stuid, t0.city_code from student as t0 join lives_in as t1 on t0.stuid = t1.stuid join dorm as t2 on t1.dormid = t2.dormid join has_amenity as t3 on t2.dormid = t3.dormid join dorm_amenity as t4 on t3.amenid = t4.amenid where t4.amenity_name = 'Kitchen in Every Room' | 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.fname, t0.stuid, t0.city_code from student as t0 join lives_in as t1 on t0.stuid = t1.stuid join dorm as t2 on t1.dormid = t2.dormid join has_amenity as t3 on t2.dormid = t3.dormid join dorm_amenity as t4 on t3.amenid = t4.amenid where t4.amenity_name =... | {
"index": 2790,
"split": "train"
} | |
How many distinct investor IDs and unique investor details are associated with investor ID 19? | tracking_share_transactions | select count(distinct (t0.investor_id)), count(distinct (t1.investor_details)) from transactions as t0 join investors as t1 on t0.investor_id = t1.investor_id where t1.investor_id = 19 | 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 count(distinct (t0.investor_id)), count(distinct (t1.investor_details)) from transactions as t0 join investors as t1 on t0.investor_id = t1.investor_id where t1.investor_id = 19"
},
"style": "rule"
} | {
"index": 761,
"split": "train"
} | |
Which part faults and their corresponding part fault IDs are associated with fault logs that describe the issue as "failed parts"? | assets_maintenance | select t0.part_id, t0.part_fault_id from part_faults as t0 join parts as t1 on t0.part_id = t1.part_id join asset_parts as t2 on t1.part_id = t2.part_id join assets as t3 on t2.asset_id = t3.asset_id join fault_log as t4 on t3.asset_id = t4.asset_id where t4.fault_description = 'failed parts' | 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_id, t0.part_fault_id from part_faults as t0 join parts as t1 on t0.part_id = t1.part_id join asset_parts as t2 on t1.part_id = t2.part_id join assets as t3 on t2.asset_id = t3.asset_id join fault_log as t4 on t3.asset_id = t4.asset_id w... | {
"index": 1415,
"split": "train"
} | |
What are the different names of the representatives? | election_representative | select distinct name from representative | 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": "election_representative",
"sql": "select distinct name from representative"
},
"style": "rule"
} | {
"index": 468,
"split": "train"
} | |
Show the transaction amounts, card IDs, and account IDs for transactions made by accounts with customer IDs less than or equal to 6, or for accounts that are not linked to any customer in the Customers Cards table. | customers_card_transactions | select t0.transaction_amount, t0.card_id, t1.account_id from financial_transactions as t0 join accounts as t1 on t0.account_id = t1.account_id where t1.customer_id <= 6 or (not t1.customer_id in (select customers_cards.customer_id as c3 from customers_cards)) | 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.transaction_amount, t0.card_id, t1.account_id from financial_transactions as t0 join accounts as t1 on t0.account_id = t1.account_id where t1.customer_id <= 6 or (not t1.customer_id in (select customers_cards.customer_id as c3 from ... | {
"index": 1469,
"split": "train"
} | |
List the maximum aperture, name, brand, and ID for all camera lenses, combined with the details of lenses used to photograph mountains located in countries ending with "hiopia". | mountain_photos | select anon_1.c3, anon_1.c1, anon_1.c0, anon_1.c2 from (select max_aperture as c3, name as c1, brand as c0, id as c2 from camera_lens union select t0.max_aperture as c3, t0.name as c1, t0.brand as c0, t0.id as c2 from camera_lens as t0 join photos as t1 on t0.id = t1.camera_lens_id join mountain as t2 on t1.mountain_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": "mountain_photos",
"sql": "select anon_1.c3, anon_1.c1, anon_1.c0, anon_1.c2 from (select max_aperture as c3, name as c1, brand as c0, id as c2 from camera_lens union select t0.max_aperture as c3, t0.name as c1, t0.brand as c0, t0.id as c2 from camera_lens as t0 join photos as t1 ... | {
"index": 1818,
"split": "train"
} | |
Show the rankings, market IDs, number of shops, and districts for all markets, excluding those that sell phones with 128 GB or less of memory. | phone_market | select anon_1.c1, anon_1.c3, anon_1.c0, anon_1.c2 from (select ranking as c1, market_id as c3, num_of_shops as c0, district as c2 from market except select t0.ranking as c1, t0.market_id as c3, t0.num_of_shops as c0, t0.district as c2 from market as t0 join phone_market as t1 on t0.market_id = t1.market_id join phone 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": "phone_market",
"sql": "select anon_1.c1, anon_1.c3, anon_1.c0, anon_1.c2 from (select ranking as c1, market_id as c3, num_of_shops as c0, district as c2 from market except select t0.ranking as c1, t0.market_id as c3, t0.num_of_shops as c0, t0.district as c2 from market as t0 join... | {
"index": 2245,
"split": "train"
} | |
Can you tell me the different low estimate values, film IDs, and types for film market estimations where the low estimate is at most 16.0 and the film ID is less than 3? | film_rank | select distinct low_estimate as c1, film_id as c0, type from film_market_estimation where c1 <= 16.0 and 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": "film_rank",
"sql": "select distinct low_estimate as c1, film_id as c0, type from film_market_estimation where c1 <= 16.0 and c0 < 3"
},
"style": "rule"
} | {
"index": 80,
"split": "train"
} | |
Find the train IDs and the station IDs along their routes where the weekly low temperature at those stations is greater than or equal to 55. | station_weather | select t0.train_id, t0.station_id from route as t0 join station as t1 on t0.station_id = t1.id join weekly_weather as t2 on t1.id = t2.station_id where t2.low_temperature >= 55 | 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.train_id, t0.station_id from route as t0 join station as t1 on t0.station_id = t1.id join weekly_weather as t2 on t1.id = t2.station_id where t2.low_temperature >= 55"
},
"style": "rule"
} | {
"index": 1395,
"split": "train"
} | |
Which account IDs and customer IDs are associated with financial transactions where the account name begins with either "5" or "8"? | customers_card_transactions | select t0.account_id, t1.customer_id from financial_transactions as t0 join accounts as t1 on t0.account_id = t1.account_id where t1.account_name like '5%' or t1.account_name like '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": "customers_card_transactions",
"sql": "select t0.account_id, t1.customer_id from financial_transactions as t0 join accounts as t1 on t0.account_id = t1.account_id where t1.account_name like '5%' or t1.account_name like '8%'"
},
"style": "rule"
} | {
"index": 1529,
"split": "train"
} | |
What are the player IDs and years for all-star players who, through their college affiliations, attended colleges with names that include "mmunit"? | baseball_1 | select anon_1.c1, anon_1.c0 from (select player_id as c1, year as c0 from all_star union select t0.player_id as c1, t0.year as c0 from all_star as t0 join player as t1 on t0.player_id = t1.player_id join player_college as t2 on t1.player_id = t2.player_id join college as t3 on t2.college_id = t3.college_id where t3.nam... | 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": "baseball_1",
"sql": "select anon_1.c1, anon_1.c0 from (select player_id as c1, year as c0 from all_star union select t0.player_id as c1, t0.year as c0 from all_star as t0 join player as t1 on t0.player_id = t1.player_id join player_college as t2 on t1.player_id = t2.player_id joi... | {
"index": 1050,
"split": "train"
} | |
Is the average assigned staff ID for problem 4 higher than that for problem 10? | tracking_software_problems | select t1.c2 > t0.c2 from (select avg(t1.assigned_to_staff_id) as c2 from problems as t0 join problem_log as t1 on t0.problem_id = t1.problem_id where t0.problem_id = 4 group by t0.problem_id) as t1, (select t0.problem_id, avg(t1.assigned_to_staff_id) as c2 from problems as t0 join problem_log as t1 on t0.problem_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": "tracking_software_problems",
"sql": "select t1.c2 > t0.c2 from (select avg(t1.assigned_to_staff_id) as c2 from problems as t0 join problem_log as t1 on t0.problem_id = t1.problem_id where t0.problem_id = 4 group by t0.problem_id) as t1, (select t0.problem_id, avg(t1.assigned_to_s... | {
"index": 3557,
"split": "train"
} | |
What are the titles and IDs of items that are both in the overall item list and have been reviewed by the user(s) with the least common name among user ID 2's associated names? | epinions_1 | select anon_1.c1, anon_1.c2 from (select title as c1, i_id as c2 from item intersect select t0.title as c1, t0.i_id as c2 from item as t0 join review as t1 on t0.i_id = t1.i_id join useracct as t2 on t1.u_id = t2.u_id, (select name as c0 from useracct where u_id = 2 group by c0 order by count(*) 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": "epinions_1",
"sql": "select anon_1.c1, anon_1.c2 from (select title as c1, i_id as c2 from item intersect select t0.title as c1, t0.i_id as c2 from item as t0 join review as t1 on t0.i_id = t1.i_id join useracct as t2 on t1.u_id = t2.u_id, (select name as c0 from useracct where u... | {
"index": 1754,
"split": "train"
} | |
What are the different types of companies among the third-party maintenance providers? | assets_maintenance | select distinct company_type from third_party_companies | 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 distinct company_type from third_party_companies"
},
"style": "rule"
} | {
"index": 439,
"split": "train"
} | |
Is the percentage change in the minimum `product_id` for product 118 between July 11, 1987, and August 6, 1977, greater than the smallest percentage change among all other products with complaints having a status code that includes "e" at those dates? | customer_complaints | select t5.c2 > t2.c4 from (select abs((t3.c0 / cast(t4.c0 as real) - 1) * 100) as c2 from (select min(t1.product_id) as c0 from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t0.product_id = 118 and t1.date_complaint_raised = '1987-07-11 14:40:30' group by t0.product_id) as t3, (select min(... | 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_complaints",
"sql": "select t5.c2 > t2.c4 from (select abs((t3.c0 / cast(t4.c0 as real) - 1) * 100) as c2 from (select min(t1.product_id) as c0 from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t0.product_id = 118 and t1.date_complaint_rais... | {
"index": 3438,
"split": "train"
} | |
What are the titles of albums that include tracks composed by someone whose name contains "/Joh" or ends with "ett," listed in reverse alphabetical order? | store_1 | select t0.title as c0 from albums as t0 join tracks as t1 on t0.id = t1.album_id where t1.composer like '%/Joh%' or t1.composer like '%ett' order by c0 desc | 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.title as c0 from albums as t0 join tracks as t1 on t0.id = t1.album_id where t1.composer like '%/Joh%' or t1.composer like '%ett' order by c0 desc"
},
"style": "rule"
} | {
"index": 931,
"split": "train"
} | |
How much smaller is the number of documents linked to functional area code 9 compared to the largest number of documents associated with any functional area described as "Acknowledgement"? | document_management | select t2.c3 - t0.c2 from (select max(t1.c2) as c3 from (select count(distinct (t1.document_code)) as c2 from functional_areas as t0 join document_functional_areas as t1 on t0.functional_area_code = t1.functional_area_code where t0.functional_area_description = 'Acknowledgement' group by t0.functional_area_code) 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": "document_management",
"sql": "select t2.c3 - t0.c2 from (select max(t1.c2) as c3 from (select count(distinct (t1.document_code)) as c2 from functional_areas as t0 join document_functional_areas as t1 on t0.functional_area_code = t1.functional_area_code where t0.functional_area_de... | {
"index": 3169,
"split": "train"
} | |
Among members who participated in performances with dates ending in "2" and attendance fewer than or equal to 1878, what is the first member's role and name, when listed in alphabetical order? | performance_attendance | select t0.role, t0.name as c1 from member as t0 join member_attendance as t1 on t0.member_id = t1.member_id join performance as t2 on t1.performance_id = t2.performance_id where t2.date like '%2' and t2.attendance <= 1878 order by c1 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": "performance_attendance",
"sql": "select t0.role, t0.name as c1 from member as t0 join member_attendance as t1 on t0.member_id = t1.member_id join performance as t2 on t1.performance_id = t2.performance_id where t2.date like '%2' and t2.attendance <= 1878 order by c1 asc nulls las... | {
"index": 1758,
"split": "train"
} | |
Find the first names, author IDs, and their authorship order for authors affiliated with institutions whose names end with "of Oxford". | icfp_1 | select t0.fname, t0.authid, t1.authorder from authors as t0 join authorship as t1 on t0.authid = t1.authid join inst as t2 on t1.instid = t2.instid where t2.name like '% of Oxford' | 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": "icfp_1",
"sql": "select t0.fname, t0.authid, t1.authorder from authors as t0 join authorship as t1 on t0.authid = t1.authid join inst as t2 on t1.instid = t2.instid where t2.name like '% of Oxford'"
},
"style": "rule"
} | {
"index": 2992,
"split": "train"
} | |
How many unique players are associated with Grove City College? | baseball_1 | select t0.c1 from (select count(distinct (t1.player_id)) as c1 from college as t0 join player_college as t1 on t0.college_id = t1.college_id where t0.college_id = 'grovecity' group by t0.college_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": "baseball_1",
"sql": "select t0.c1 from (select count(distinct (t1.player_id)) as c1 from college as t0 join player_college as t1 on t0.college_id = t1.college_id where t0.college_id = 'grovecity' group by t0.college_id) as t0"
},
"style": "rule"
} | {
"index": 3356,
"split": "train"
} | |
How many entries are there in the Problem Log records? | tracking_software_problems | select count(*) from problem_log | 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_software_problems",
"sql": "select count(*) from problem_log"
},
"style": "rule"
} | {
"index": 2666,
"split": "train"
} | |
What are the names, latitudes, and IDs of stations that are either the station with ID 46 or stations not listed in the station database, and that have at least four status records? Please list the results in reverse alphabetical order by station name. | bike_1 | select t0.name as c2, t0.lat, t0.id as c1 from station as t0 join status as t1 on t0.id = t1.station_id where t1.station_id = 46 or (not t1.station_id in (select c1 as c1 from station)) group by c1 having count(*) >= 4 order by c2 desc | 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 t0.name as c2, t0.lat, t0.id as c1 from station as t0 join status as t1 on t0.id = t1.station_id where t1.station_id = 46 or (not t1.station_id in (select c1 as c1 from station)) group by c1 having count(*) >= 4 order by c2 desc"
},
"style": "rule"
} | {
"index": 1960,
"split": "train"
} | |
Can you show me the five most recent shops, including their open dates, names, and locations, along with the device and shop IDs of stock items where the device's carrier is either MTS Mobility or contains the letter "l," sorted by shop ID from highest to lowest? | device | select t0.open_date, t0.shop_name, t0.location, t1.device_id, t1.shop_id as c3 from shop as t0 join stock as t1 on t0.shop_id = t1.shop_id join device as t2 on t1.device_id = t2.device_id where t2.carrier = 'MTS Mobility' or t2.carrier like '%l%' order by c3 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": "device",
"sql": "select t0.open_date, t0.shop_name, t0.location, t1.device_id, t1.shop_id as c3 from shop as t0 join stock as t1 on t0.shop_id = t1.shop_id join device as t2 on t1.device_id = t2.device_id where t2.carrier = 'MTS Mobility' or t2.carrier like '%l%' order by c3 desc... | {
"index": 436,
"split": "train"
} | |
What are the artist IDs, album IDs, and album titles for albums that have tracks belonging to genres whose names start with "Jaz"? | chinook_1 | select t0.artistid, t0.albumid, t0.title from album as t0 join track as t1 on t0.albumid = t1.albumid join genre as t2 on t1.genreid = t2.genreid where t2.name like 'Jaz%' | 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 t0.artistid, t0.albumid, t0.title from album as t0 join track as t1 on t0.albumid = t1.albumid join genre as t2 on t1.genreid = t2.genreid where t2.name like 'Jaz%'"
},
"style": "rule"
} | {
"index": 114,
"split": "train"
} | |
For students living in dorms that have amenities with IDs from 901 to 932 or above 930, what are their dorm IDs, student IDs, and the names of those dorms? | dorm_1 | select t0.dormid, t0.stuid, t1.dorm_name from lives_in as t0 join dorm as t1 on t0.dormid = t1.dormid join has_amenity as t2 on t1.dormid = t2.dormid where t2.amenid between 901 and 932 or t2.amenid >= 930 | 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.dormid, t0.stuid, t1.dorm_name from lives_in as t0 join dorm as t1 on t0.dormid = t1.dormid join has_amenity as t2 on t1.dormid = t2.dormid where t2.amenid between 901 and 932 or t2.amenid >= 930"
},
"style": "rule"
} | {
"index": 45,
"split": "train"
} | |
Which five mills constructed by female architects or architects sharing the most common gender among those named "Mies Van Der..." are listed along with the architects' names, their built years, and nationalities, ordered by nationality from Z to A? | architecture | select t0.name, t0.built_year, t1.nationality as c3 from mill as t0 join architect as t1 on t0.architect_id = t1.id, (select gender as c1 from architect where name like 'Mies Van Der %' group by c1 order by count(*) desc limit 1) as t0 where t1.gender like 'female%' or t1.gender = t0.c1 order by c3 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": "architecture",
"sql": "select t0.name, t0.built_year, t1.nationality as c3 from mill as t0 join architect as t1 on t0.architect_id = t1.id, (select gender as c1 from architect where name like 'Mies Van Der %' group by c1 order by count(*) desc limit 1) as t0 where t1.gender like ... | {
"index": 1512,
"split": "train"
} | |
Who are the first names of up to 10 staff members whose last names end with "me" or "Lowe," listed in order from Z to A based on their first names? | customer_complaints | select first_name as c0 from staff where last_name like '%me' or last_name like '%Lowe' 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": "customer_complaints",
"sql": "select first_name as c0 from staff where last_name like '%me' or last_name like '%Lowe' order by c0 desc limit 10"
},
"style": "rule"
} | {
"index": 2781,
"split": "train"
} | |
What are the file IDs, file sizes, and durations of files associated with genres that have a rating of 9 or a rating that includes the digit "7"? | music_1 | select t0.f_id, t0.file_size, t0.duration from files as t0 join song as t1 on t0.f_id = t1.f_id join genre as t2 on t1.genre_is = t2.g_name where t2.rating = 9 or t2.rating like '%7%' | 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.f_id, t0.file_size, t0.duration from files as t0 join song as t1 on t0.f_id = t1.f_id join genre as t2 on t1.genre_is = t2.g_name where t2.rating = 9 or t2.rating like '%7%'"
},
"style": "rule"
} | {
"index": 2205,
"split": "train"
} | |
List the first names, last names, and IDs of the three staff members who authorized the closure of problems with the description 'y', sorted by their first names in reverse alphabetical order. | tracking_software_problems | select t0.staff_first_name as c2, t0.staff_last_name, t0.staff_id from staff as t0 join problems as t1 on t0.staff_id = t1.closure_authorised_by_staff_id where t1.problem_description = 'y' 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": "tracking_software_problems",
"sql": "select t0.staff_first_name as c2, t0.staff_last_name, t0.staff_id from staff as t0 join problems as t1 on t0.staff_id = t1.closure_authorised_by_staff_id where t1.problem_description = 'y' order by c2 desc limit 3"
},
"style": "rule"
} | {
"index": 1133,
"split": "train"
} | |
Which destinations have flights with the smallest aircraft IDs of 7 or less, and what is that minimum aircraft ID for each of those destinations? | flight_1 | select destination as c1, min(aid) from flight group by c1 having min(aid) <= 7 | 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_1",
"sql": "select destination as c1, min(aid) from flight group by c1 having min(aid) <= 7"
},
"style": "rule"
} | {
"index": 132,
"split": "train"
} | |
Which venues and dates hosted debates where the most common affirmative side was present, but not those debates where the affirmative side was specifically number 4? | debate | select anon_1.c2, anon_1.c1 from (select t0.venue as c2, t0.date as c1 from debate as t0 join debate_people as t1 on t0.debate_id = t1.debate_id, (select affirmative as c0 from debate_people group by c0 order by count(*) asc nulls last limit 1) as t1 where t1.affirmative = t1.c0 except select t0.venue as c2, t0.date 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": "debate",
"sql": "select anon_1.c2, anon_1.c1 from (select t0.venue as c2, t0.date as c1 from debate as t0 join debate_people as t1 on t0.debate_id = t1.debate_id, (select affirmative as c0 from debate_people group by c0 order by count(*) asc nulls last limit 1) as t1 where t1.aff... | {
"index": 1804,
"split": "train"
} | |
What is the percentage change in the number of assets with fault logs between March 6th, 2018, and March 21st, 2018? | assets_maintenance | select (count(t0.c1) / cast(count(t1.c1) as real) - 1) * 100 from (select max(t1.asset_id) as c1 from assets as t0 join fault_log as t1 on t0.asset_id = t1.asset_id where t1.fault_log_entry_datetime = '2018-03-06 15:52:54' group by t0.asset_id) as t0, (select t0.asset_id, max(t1.asset_id) as c1 from assets as t0 join f... | 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 (count(t0.c1) / cast(count(t1.c1) as real) - 1) * 100 from (select max(t1.asset_id) as c1 from assets as t0 join fault_log as t1 on t0.asset_id = t1.asset_id where t1.fault_log_entry_datetime = '2018-03-06 15:52:54' group by t0.asset_id) as t0,... | {
"index": 3002,
"split": "train"
} | |
What is the participant type code, participant ID, and participant details for participants involved in events that either have event details ending with "Success" or match the event details of the event with the lowest minimum service ID? Also, what is the event ID for these participant-event records? | local_govt_in_alabama | select t0.participant_type_code, t0.participant_id, t0.participant_details, t1.event_id as c3 from participants as t0 join participants_in_events as t1 on t0.participant_id = t1.participant_id join events as t2 on t1.event_id = t2.event_id, (select event_details as c0 from events group by c0 order by min(service_id) 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": "local_govt_in_alabama",
"sql": "select t0.participant_type_code, t0.participant_id, t0.participant_details, t1.event_id as c3 from participants as t0 join participants_in_events as t1 on t0.participant_id = t1.participant_id join events as t2 on t1.event_id = t2.event_id, (select... | {
"index": 2932,
"split": "train"
} | |
What are the first names of students whose last name ends with "Leighton" and who have fewer than 22 distinct ages among those sharing the same first name, limited to the first three such names sorted alphabetically? | activity_1 | select count(distinct (age)) from student where lname like '%Leighton' group by fname having count(distinct (age)) < 22 order by fname 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": "activity_1",
"sql": "select count(distinct (age)) from student where lname like '%Leighton' group by fname having count(distinct (age)) < 22 order by fname asc nulls last limit 3"
},
"style": "rule"
} | {
"index": 407,
"split": "train"
} | |
Which are the most recent five fault log entries where the staff members involved have ID 6 or 7? | assets_maintenance | select t0.fault_log_entry_id as c0 from engineer_visits as t0 join staff as t1 on t0.contact_staff_id = t1.staff_id where t1.staff_id = 6 or t1.staff_id = 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": "assets_maintenance",
"sql": "select t0.fault_log_entry_id as c0 from engineer_visits as t0 join staff as t1 on t0.contact_staff_id = t1.staff_id where t1.staff_id = 6 or t1.staff_id = 7 order by c0 desc limit 5"
},
"style": "rule"
} | {
"index": 782,
"split": "train"
} | |
How many staff members have an address ID of 1? | driving_school | select count(*) from staff where staff_address_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": "driving_school",
"sql": "select count(*) from staff where staff_address_id = 1"
},
"style": "rule"
} | {
"index": 1849,
"split": "train"
} | |
Among the projects, which project detail occurs most frequently? For that project, what is the total number of records in the Project_Staff table, how many staff members are involved, how many date_to entries are recorded, and how many unique project IDs are associated with it? Please provide these counts in a clear an... | tracking_grants_for_research | select count(*) as c4, count(t0.staff_id), count(t0.date_to), count(distinct (t1.project_id)) from project_staff as t0 join projects as t1 on t0.project_id = t1.project_id, (select project_details as c2 from projects group by c2 order by count(*) asc nulls last limit 1) as t0 where t1.project_details = t0.c2 order by 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": "tracking_grants_for_research",
"sql": "select count(*) as c4, count(t0.staff_id), count(t0.date_to), count(distinct (t1.project_id)) from project_staff as t0 join projects as t1 on t0.project_id = t1.project_id, (select project_details as c2 from projects group by c2 order by cou... | {
"index": 394,
"split": "train"
} | |
How many days passed between the start and end dates for each job history entry? | hr_1 | select julianday(t1.c2) - julianday(t0.c3) from (select start_date as c2 from job_history) as t1, (select end_date as c3 from job_history) 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": "hr_1",
"sql": "select julianday(t1.c2) - julianday(t0.c3) from (select start_date as c2 from job_history) as t1, (select end_date as c3 from job_history) as t0"
},
"style": "rule"
} | {
"index": 3718,
"split": "train"
} | |
What is the percentage change in the maximum customer ID associated with product 117, for complaints with status codes containing "e" raised exactly on February 10, 1973 at 22:55:56? | customer_complaints | select (t0.c0 / cast(t0.c0 as real) - 1) * 100 from (select max(t1.customer_id) as c0 from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t0.product_id = 117 and t1.date_complaint_raised = '1973-02-10 22:55:56' and t1.complaint_status_code like '%e%' group by t0.product_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": "customer_complaints",
"sql": "select (t0.c0 / cast(t0.c0 as real) - 1) * 100 from (select max(t1.customer_id) as c0 from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t0.product_id = 117 and t1.date_complaint_raised = '1973-02-10 22:55:56' and t1.com... | {
"index": 3415,
"split": "train"
} | |
Which stores, along with their types and IDs, both exist in the store list and carry at least one scanning device that can print in color at a speed of 4 or more pages per minute? | store_product | select anon_1.c0, anon_1.c2, anon_1.c1 from (select store_name as c0, type as c2, store_id as c1 from store intersect select t0.store_name as c0, t0.type as c2, t0.store_id as c1 from store as t0 join store_product as t1 on t0.store_id = t1.store_id join product as t2 on t1.product_id = t2.product_id where t2.pages_per... | 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 anon_1.c0, anon_1.c2, anon_1.c1 from (select store_name as c0, type as c2, store_id as c1 from store intersect select t0.store_name as c0, t0.type as c2, t0.store_id as c1 from store as t0 join store_product as t1 on t0.store_id = t1.store_id join p... | {
"index": 1981,
"split": "train"
} | |
Which are the last 10 students' last names, first names, advisors, along with their student IDs and the game IDs they played, for games whose names include "pe is the Universe," excluding games with IDs 4 or higher that they played for less than 15 hours, ordered by the highest game ID first? | game_1 | select t0.lname, t0.fname, t0.advisor, t1.stuid, t1.gameid as c1 from student as t0 join plays_games as t1 on t0.stuid = t1.stuid join video_games as t2 on t1.gameid = t2.gameid where (not t2.gameid in (select c1 as c1 from plays_games where c1 >= 4 and t1.hours_played < 15)) and t2.gname like '%pe is the Universe' ord... | 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_1",
"sql": "select t0.lname, t0.fname, t0.advisor, t1.stuid, t1.gameid as c1 from student as t0 join plays_games as t1 on t0.stuid = t1.stuid join video_games as t2 on t1.gameid = t2.gameid where (not t2.gameid in (select c1 as c1 from plays_games where c1 >= 4 and t1.hours_... | {
"index": 654,
"split": "train"
} | |
How many furniture manufacturing records have a price of exactly 1234 dollars? | manufacturer | select count(*) from furniture_manufacte where price_in_dollar = 1234.0 | 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": "manufacturer",
"sql": "select count(*) from furniture_manufacte where price_in_dollar = 1234.0"
},
"style": "rule"
} | {
"index": 1176,
"split": "train"
} | |
Can you identify up to ten counties—showing their zip codes and county IDs—where the associated election parties have a comptroller whose name starts with "Alan Hev"? The list should be sorted alphabetically by party name. | election | select t0.zip_code, t0.county_id, t1.party as c0 from county as t0 join election as t1 on t0.county_id = t1.district join party as t2 on t1.party = t2.party_id where t2.comptroller like 'Alan Hev%' 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": "election",
"sql": "select t0.zip_code, t0.county_id, t1.party as c0 from county as t0 join election as t1 on t0.county_id = t1.district join party as t2 on t1.party = t2.party_id where t2.comptroller like 'Alan Hev%' order by c0 asc nulls last limit 10"
},
"style": "rule"
} | {
"index": 2020,
"split": "train"
} | |
Which are the last names and staff address IDs of up to ten staff members who have lessons linked to customers paying either with a method ending in "t" or by Credit Card, with the lessons ordered by their status code? | driving_school | select t0.last_name, t0.staff_address_id, t1.lesson_status_code as c2 from staff as t0 join lessons as t1 on t0.staff_id = t1.staff_id join customers as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.customer_address_id = t3.address_id join customer_payments as t4 on t2.customer_id = t4.customer_id wh... | 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.last_name, t0.staff_address_id, t1.lesson_status_code as c2 from staff as t0 join lessons as t1 on t0.staff_id = t1.staff_id join customers as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.customer_address_id = t3.address_id j... | {
"index": 725,
"split": "train"
} | |
What is the difference between the height in feet of building 3 and the shortest building that is less than 280 feet tall? | protein_institute | select t2.c2 - t0.c3 from (select min(height_feet) as c2 from building where height_feet < 280) as t2, (select height_feet as c3 from building where building_id = 3) 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": "protein_institute",
"sql": "select t2.c2 - t0.c3 from (select min(height_feet) as c2 from building where height_feet < 280) as t2, (select height_feet as c3 from building where building_id = 3) as t0"
},
"style": "rule"
} | {
"index": 3200,
"split": "train"
} | |
Is the date when order 10 was placed earlier than the date when order 3 was placed? | tracking_orders | select t1.c1 < t0.c1 from (select date_order_placed as c1 from orders where order_id = 10) as t1, (select date_order_placed as c1 from orders where order_id = 3) 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_orders",
"sql": "select t1.c1 < t0.c1 from (select date_order_placed as c1 from orders where order_id = 10) as t1, (select date_order_placed as c1 from orders where order_id = 3) as t0"
},
"style": "rule"
} | {
"index": 3151,
"split": "train"
} | |
For the most common product, how many unique color descriptions does it have, and how many color codes are linked to it? | products_gen_characteristics | select count(distinct (t0.color_description)), count(t0.color_code) from ref_colors as t0 join products as t1 on t0.color_code = t1.color_code, (select product_id as c2 from products group by c2 order by count(*) desc limit 1) as t0 where t1.product_id = t0.c2 | 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 count(distinct (t0.color_description)), count(t0.color_code) from ref_colors as t0 join products as t1 on t0.color_code = t1.color_code, (select product_id as c2 from products group by c2 order by count(*) desc limit 1) as t0 where t1... | {
"index": 2987,
"split": "train"
} | |
Can you find the rank, nationality, and aircraft IDs of pilots whose assigned aircraft are not the ones with ID 6? | pilot_record | select t0.rank, t0.nationality, t1.aircraft_id as c1 from pilot as t0 join pilot_record as t1 on t0.pilot_id = t1.pilot_id join aircraft as t2 on t1.aircraft_id = t2.aircraft_id where (not t2.aircraft_id in (select c1 as c1 from pilot_record where c1 = 6 or c1 = 6)) | 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": "pilot_record",
"sql": "select t0.rank, t0.nationality, t1.aircraft_id as c1 from pilot as t0 join pilot_record as t1 on t0.pilot_id = t1.pilot_id join aircraft as t2 on t1.aircraft_id = t2.aircraft_id where (not t2.aircraft_id in (select c1 as c1 from pilot_record where c1 = 6 or... | {
"index": 2068,
"split": "train"
} | |
Can you list the top 5 characteristics—specifically their type codes, names, and IDs—and the related product IDs and characteristic IDs for products described as 'nisi' or 'blanditiis', ordered by the highest characteristic ID? | products_gen_characteristics | select t0.characteristic_type_code, t0.characteristic_name, t0.characteristic_id, t1.product_id, t1.characteristic_id as c2 from characteristics as t0 join product_characteristics as t1 on t0.characteristic_id = t1.characteristic_id join products as t2 on t1.product_id = t2.product_id where t2.product_description = 'ni... | 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 t0.characteristic_type_code, t0.characteristic_name, t0.characteristic_id, t1.product_id, t1.characteristic_id as c2 from characteristics as t0 join product_characteristics as t1 on t0.characteristic_id = t1.characteristic_id join pro... | {
"index": 325,
"split": "train"
} | |
Who are the top 10 employees and their IDs, along with their company IDs and employee IDs, working at companies whose industry names end with "g," listed in reverse alphabetical order by their names? | company_employee | select t0.name as c3, t0.people_id, t1.company_id, t1.people_id from people as t0 join employment as t1 on t0.people_id = t1.people_id join company as t2 on t1.company_id = t2.company_id where t2.industry like '%g' order by c3 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": "company_employee",
"sql": "select t0.name as c3, t0.people_id, t1.company_id, t1.people_id from people as t0 join employment as t1 on t0.people_id = t1.people_id join company as t2 on t1.company_id = t2.company_id where t2.industry like '%g' order by c3 desc limit 10"
},
"sty... | {
"index": 587,
"split": "train"
} | |
Which unique club IDs are there for the clubs in the Riding Club database? | riding_club | select distinct club_id from club | 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": "riding_club",
"sql": "select distinct club_id from club"
},
"style": "rule"
} | {
"index": 420,
"split": "train"
} | |
How many ages are recorded for each character, displaying the top 5 characters sorted in reverse alphabetical order? | musical | select count(age) from actor group by character order by character 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": "musical",
"sql": "select count(age) from actor group by character order by character desc limit 5"
},
"style": "rule"
} | {
"index": 1780,
"split": "train"
} | |
Who are the top 10 staff members, by the number of complaints they have handled, who dealt with complaints raised before October 29, 2006, or after August 6, 1977? What are their first names, staff IDs, and the total number of complaints each handled, sorted from most to least complaints? | customer_complaints | select t0.first_name, t0.staff_id as c0, count(t1.staff_id) as c2 from staff as t0 join complaints as t1 on t0.staff_id = t1.staff_id where t1.date_complaint_raised > '1977-08-06 00:31:19' or t1.date_complaint_raised < '2006-10-29 07:08:46' group by c0 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": "customer_complaints",
"sql": "select t0.first_name, t0.staff_id as c0, count(t1.staff_id) as c2 from staff as t0 join complaints as t1 on t0.staff_id = t1.staff_id where t1.date_complaint_raised > '1977-08-06 00:31:19' or t1.date_complaint_raised < '2006-10-29 07:08:46' group by ... | {
"index": 101,
"split": "train"
} | |
What are the three highest minimum reviewer IDs from ratings where the reviewer is not someone whose name starts with "Mike Anders" and the movie ID is at least 103, sorted by the minimum reviewer ID in descending order? | movie_1 | select min(rid) as c1 from rating where (not rid in (select rid as c0 from reviewer where name like 'Mike Anders%')) and mid >= 103 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": "movie_1",
"sql": "select min(rid) as c1 from rating where (not rid in (select rid as c0 from reviewer where name like 'Mike Anders%')) and mid >= 103 order by c1 desc limit 3"
},
"style": "rule"
} | {
"index": 854,
"split": "train"
} | |
Which artist with songs in MP-format files has the last name alphabetically, considering only those whose file formats start with "mp"? | music_1 | select t0.artist_name as c0 from song as t0 join files as t1 on t0.f_id = t1.f_id where t1.formats like 'mp%' 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": "music_1",
"sql": "select t0.artist_name as c0 from song as t0 join files as t1 on t0.f_id = t1.f_id where t1.formats like 'mp%' order by c0 desc limit 1"
},
"style": "rule"
} | {
"index": 658,
"split": "train"
} | |
What are the genre IDs, languages, resolutions, and release dates of all songs, including those that belong to genres with ratings starting with '8'? | music_1 | select anon_1.c3, anon_1.c1, anon_1.c0, anon_1.c2 from (select genre_is as c3, languages as c1, resolution as c0, releasedate as c2 from song union select t0.genre_is as c3, t0.languages as c1, t0.resolution as c0, t0.releasedate as c2 from song as t0 join genre as t1 on t0.genre_is = t1.g_name where t1.rating like '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": "music_1",
"sql": "select anon_1.c3, anon_1.c1, anon_1.c0, anon_1.c2 from (select genre_is as c3, languages as c1, resolution as c0, releasedate as c2 from song union select t0.genre_is as c3, t0.languages as c1, t0.resolution as c0, t0.releasedate as c2 from song as t0 join genre... | {
"index": 1518,
"split": "train"
} | |
What are the five stations with the lowest minimum bikes available, along with their latitude and ID, among the stations that share the most common station name? | bike_1 | select t0.lat, t0.id as c1 from station as t0 join status as t1 on t0.id = t1.station_id, (select name as c2 from station group by c2 order by count(*) desc limit 1) as t0 where t0.name = t0.c2 group by c1 order by min(t1.bikes_available) 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": "bike_1",
"sql": "select t0.lat, t0.id as c1 from station as t0 join status as t1 on t0.id = t1.station_id, (select name as c2 from station group by c2 order by count(*) desc limit 1) as t0 where t0.name = t0.c2 group by c1 order by min(t1.bikes_available) asc nulls last limit 5"
... | {
"index": 1500,
"split": "train"
} | |
Could you tell me the name and ID of the genre that has the highest total of genre IDs among genres with IDs from 6 up to 12? | store_1 | select t0.name, t0.id as c0 from genres as t0 join tracks as t1 on t0.id = t1.genre_id where t1.genre_id >= 6 or t1.genre_id < 13 group by c0 order by sum(t1.genre_id) 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": "store_1",
"sql": "select t0.name, t0.id as c0 from genres as t0 join tracks as t1 on t0.id = t1.genre_id where t1.genre_id >= 6 or t1.genre_id < 13 group by c0 order by sum(t1.genre_id) desc limit 1"
},
"style": "rule"
} | {
"index": 1386,
"split": "train"
} | |
Can you list the names of countries and their maximum area, for countries where the largest area recorded is exactly 449,964? | roller_coaster | select name as c1, max(area) from country group by c1 having max(area) between 449964 and 449964 | 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": "roller_coaster",
"sql": "select name as c1, max(area) from country group by c1 having max(area) between 449964 and 449964"
},
"style": "rule"
} | {
"index": 2688,
"split": "train"
} | |
List the preferred foot, crossing, and player ID for the first five players with IDs at least 41468, ordered by their player IDs from smallest to largest. | soccer_1 | select t0.preferred_foot, t0.crossing, t0.player_api_id as c2 from player_attributes as t0 join player as t1 on t0.player_api_id = t1.player_api_id where t1.player_api_id >= 41468 order by c2 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": "soccer_1",
"sql": "select t0.preferred_foot, t0.crossing, t0.player_api_id as c2 from player_attributes as t0 join player as t1 on t0.player_api_id = t1.player_api_id where t1.player_api_id >= 41468 order by c2 asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 635,
"split": "train"
} | |
How many times does the most frequently served station appear in the dataset? | train_station | select count(station_id) as c0 from train_station 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": "train_station",
"sql": "select count(station_id) as c0 from train_station order by c0 desc limit 1"
},
"style": "rule"
} | {
"index": 2449,
"split": "train"
} | |
Show the number of floors in buildings associated with institutions whose IDs end with 7 or are equal to 5. | protein_institute | select t0.floors from building as t0 join institution as t1 on t0.building_id = t1.building_id where t1.institution_id like '%7' or t1.institution_id = 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": "protein_institute",
"sql": "select t0.floors from building as t0 join institution as t1 on t0.building_id = t1.building_id where t1.institution_id like '%7' or t1.institution_id = 5"
},
"style": "rule"
} | {
"index": 2489,
"split": "train"
} | |
Which room is associated with faculty members whose rank ends with "uctor", where the room group has the lowest phone number less than 2032? | activity_1 | select room as c0 from faculty where rank like '%uctor' group by c0 having min(phone) < 2032 order by min(phone) 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": "activity_1",
"sql": "select room as c0 from faculty where rank like '%uctor' group by c0 having min(phone) < 2032 order by min(phone) asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 1674,
"split": "train"
} | |
For the paper with ID 201, can you tell me the institution ID and country of the authorship, as well as the paper ID and author IDs associated with that paper? | icfp_1 | select t0.instid, t0.country, t1.paperid, t1.authid from inst as t0 join authorship as t1 on t0.instid = t1.instid join papers as t2 on t1.paperid = t2.paperid where t2.paperid = 201 | 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": "icfp_1",
"sql": "select t0.instid, t0.country, t1.paperid, t1.authid from inst as t0 join authorship as t1 on t0.instid = t1.instid join papers as t2 on t1.paperid = t2.paperid where t2.paperid = 201"
},
"style": "rule"
} | {
"index": 2614,
"split": "train"
} | |
Is the log entry for problem log 12 more recent than the log entry for problem log 7? | tracking_software_problems | select t1.c2 > t0.c2 from (select log_entry_date as c2 from problem_log where problem_log_id = 12) as t1, (select log_entry_date as c2 from problem_log where problem_log_id = 7) 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_software_problems",
"sql": "select t1.c2 > t0.c2 from (select log_entry_date as c2 from problem_log where problem_log_id = 12) as t1, (select log_entry_date as c2 from problem_log where problem_log_id = 7) as t0"
},
"style": "rule"
} | {
"index": 3109,
"split": "train"
} | |
How much larger is the total customer ID sum for service 11 compared to the smallest total customer ID sum of services with customers numbered between 10 and 15? | e_government | select t2.c0 - t0.c2 from (select min(t1.c2) as c0 from (select sum(t1.customer_id) as c2 from services as t0 join party_services as t1 on t0.service_id = t1.service_id where t1.customer_id between 10 and 15 group by t0.service_id) as t1) as t2, (select t0.service_id, sum(t1.customer_id) as c2 from services as t0 join ... | 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.c0 - t0.c2 from (select min(t1.c2) as c0 from (select sum(t1.customer_id) as c2 from services as t0 join party_services as t1 on t0.service_id = t1.service_id where t1.customer_id between 10 and 15 group by t0.service_id) as t1) as t2, (select t0.... | {
"index": 3191,
"split": "train"
} | |
What are the names, IDs, and types of ships that have both participated in a mission with ship ID 5 and in one or more missions with ship IDs between 3 and 8? | ship_mission | select anon_1.c2, anon_1.c1, anon_1.c0 from (select t0.name as c2, t0.ship_id as c1, t0.type as c0 from ship as t0 join mission as t1 on t0.ship_id = t1.ship_id where t1.ship_id = 5 intersect select t0.name as c2, t0.ship_id as c1, t0.type as c0 from ship as t0 join mission as t1 on t0.ship_id = t1.ship_id where t1.shi... | 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": "ship_mission",
"sql": "select anon_1.c2, anon_1.c1, anon_1.c0 from (select t0.name as c2, t0.ship_id as c1, t0.type as c0 from ship as t0 join mission as t1 on t0.ship_id = t1.ship_id where t1.ship_id = 5 intersect select t0.name as c2, t0.ship_id as c1, t0.type as c0 from ship a... | {
"index": 2175,
"split": "train"
} | |
What are the most recent five author orders and corresponding institution IDs for author with ID 54 across their papers? | icfp_1 | select authorder, instid from authorship where authid = 54 order by paperid 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": "icfp_1",
"sql": "select authorder, instid from authorship where authid = 54 order by paperid desc limit 5"
},
"style": "rule"
} | {
"index": 2195,
"split": "train"
} | |
Is the year when accelerator 3 and browser 3 became compatible later than 2000? | browser_web | select compatible_since_year > 2000 from accelerator_compatible_browser where accelerator_id = 3 and browser_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": "browser_web",
"sql": "select compatible_since_year > 2000 from accelerator_compatible_browser where accelerator_id = 3 and browser_id = 3"
},
"style": "rule"
} | {
"index": 3289,
"split": "train"
} | |
What are the balances and customer IDs of checking accounts for the most commonly occurring customer name, excluding customers who do not have a savings account? | small_bank_1 | select anon_1.c3, anon_1.c0 from (select t0.balance as c3, t0.custid as c0 from checking as t0 join accounts as t1 on t0.custid = t1.custid, (select name as c2 from accounts group by c2 order by count(*) asc nulls last limit 1) as t2 where t1.name = t2.c2 except select t0.balance as c3, t0.custid as c0 from checking 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": "small_bank_1",
"sql": "select anon_1.c3, anon_1.c0 from (select t0.balance as c3, t0.custid as c0 from checking as t0 join accounts as t1 on t0.custid = t1.custid, (select name as c2 from accounts group by c2 order by count(*) asc nulls last limit 1) as t2 where t1.name = t2.c2 e... | {
"index": 2880,
"split": "train"
} | |
Which track locations have their earliest open year at or after 1964, and among these, which location opened the earliest? | race_track | select location as c0 from track group by c0 having min(year_opened) >= 1964.0 order by min(year_opened) 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": "race_track",
"sql": "select location as c0 from track group by c0 having min(year_opened) >= 1964.0 order by min(year_opened) asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 2048,
"split": "train"
} | |
Which manufacturers have furniture items priced at exactly 3.5 or at or below 0.5 in market rate, and what are their names, number of shops, and the IDs of those specific furniture items? | manufacturer | select t0.name, t0.num_of_shops, t1.furniture_id from manufacturer as t0 join furniture_manufacte as t1 on t0.manufacturer_id = t1.manufacturer_id join furniture as t2 on t1.furniture_id = t2.furniture_id where t2.market_rate = 3.5 or t2.market_rate <= 0.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": "manufacturer",
"sql": "select t0.name, t0.num_of_shops, t1.furniture_id from manufacturer as t0 join furniture_manufacte as t1 on t0.manufacturer_id = t1.manufacturer_id join furniture as t2 on t1.furniture_id = t2.furniture_id where t2.market_rate = 3.5 or t2.market_rate <= 0.5"... | {
"index": 2044,
"split": "train"
} | |
What are the product category, ID, and price for the product with ID 117 that had complaints raised between February 10, 1973, and July 18, 2002? | customer_complaints | select t0.product_category_code, t0.product_id, t0.product_price from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t1.product_id = 117 and t1.date_complaint_raised between '1973-02-10 22:55:56' and '2002-07-18 10:59:35' | 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_complaints",
"sql": "select t0.product_category_code, t0.product_id, t0.product_price from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t1.product_id = 117 and t1.date_complaint_raised between '1973-02-10 22:55:56' and '2002-07-18 10:59:35'... | {
"index": 1104,
"split": "train"
} | |
Which are the three nationalities of constructors with the highest constructor IDs? | formula_1 | select nationality from constructors order by constructorid 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": "formula_1",
"sql": "select nationality from constructors order by constructorid asc nulls last limit 3"
},
"style": "rule"
} | {
"index": 1113,
"split": "train"
} | |
Which medicines are FDA approved that act as activators on enzymes involved in heme biosynthesis? | medicine_enzyme_interaction | select t0.fda_approved from medicine as t0 join medicine_enzyme_interaction as t1 on t0.id = t1.medicine_id where t1.interaction_type = 'activitor' | 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.fda_approved from medicine as t0 join medicine_enzyme_interaction as t1 on t0.id = t1.medicine_id where t1.interaction_type = 'activitor'"
},
"style": "rule"
} | {
"index": 2696,
"split": "train"
} | |
Which universities have basketball matches played at the all-home location with the lowest total sum of school IDs, but do not participate in matches during the most common regular season success percentage? Please provide the nicknames and primary conferences of these universities. | university_basketball | select anon_1.c0, anon_1.c1 from (select t0.nickname as c0, t0.primary_conference as c1 from university as t0 join basketball_match as t1 on t0.school_id = t1.school_id, (select all_home as c3 from basketball_match group by c3 order by sum(school_id) asc nulls last limit 1) as t2 where t1.all_home = t2.c3 except select... | 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": "university_basketball",
"sql": "select anon_1.c0, anon_1.c1 from (select t0.nickname as c0, t0.primary_conference as c1 from university as t0 join basketball_match as t1 on t0.school_id = t1.school_id, (select all_home as c3 from basketball_match group by c3 order by sum(school_i... | {
"index": 2080,
"split": "train"
} | |
What are the number of home games, the capacity percentage, and the total number of injuries recorded for each stadium? | game_injury | select t0.home_games, t0.capacity_percentage, sum(t2.game_id) from stadium as t0 join game as t1 on t0.id = t1.stadium_id join injury_accident as t2 on t1.id = t2.game_id group by t0.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": "game_injury",
"sql": "select t0.home_games, t0.capacity_percentage, sum(t2.game_id) from stadium as t0 join game as t1 on t0.id = t1.stadium_id join injury_accident as t2 on t1.id = t2.game_id group by t0.id"
},
"style": "rule"
} | {
"index": 2253,
"split": "train"
} | |
What are the document type codes and descriptions for documents related to projects that have an outcome code of 'Paper' or outcomes whose codes start with "Pape"? | tracking_grants_for_research | select t0.document_type_code, t0.document_description from document_types as t0 join documents as t1 on t0.document_type_code = t1.document_type_code join grants as t2 on t1.grant_id = t2.grant_id join organisations as t3 on t2.organisation_id = t3.organisation_id join projects as t4 on t3.organisation_id = t4.organisa... | 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.document_type_code, t0.document_description from document_types as t0 join documents as t1 on t0.document_type_code = t1.document_type_code join grants as t2 on t1.grant_id = t2.grant_id join organisations as t3 on t2.organisation_... | {
"index": 473,
"split": "train"
} | |
What are the market value, rank, and company ID of the station companies that operate gas stations with the most frequently occurring representative name? | gas_company | select t0.market_value, t0.rank, t1.company_id from company as t0 join station_company as t1 on t0.company_id = t1.company_id join gas_station as t2 on t1.station_id = t2.station_id, (select representative_name as c0 from gas_station group by c0 order by count(*) desc limit 1) as t0 where t2.representative_name = t0.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": "gas_company",
"sql": "select t0.market_value, t0.rank, t1.company_id from company as t0 join station_company as t1 on t0.company_id = t1.company_id join gas_station as t2 on t1.station_id = t2.station_id, (select representative_name as c0 from gas_station group by c0 order by cou... | {
"index": 2359,
"split": "train"
} | |
How many days passed between the date when the policy with ID 346 was opened and the date it was closed? | insurance_fnol | select julianday(t1.c0) - julianday(t0.c1) from (select date_closed as c0 from customers_policies where policy_id = 346 and policy_id = 346) as t1, (select date_opened as c1 from customers_policies) 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 where policy_id = 346 and policy_id = 346) as t1, (select date_opened as c1 from customers_policies) as t0"
},
"style": "rule"
} | {
"index": 3723,
"split": "train"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.