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 is the percentage change in the minimum customer ID for product 117, considering complaints made on October 29, 2006, by staff members with IDs greater than 117? | customer_complaints | select (t0.c2 / cast(t0.c2 as real) - 1) * 100 from (select min(t1.customer_id) as c2 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 = '2006-10-29 07:08:46' and t1.staff_id > 117 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.c2 / cast(t0.c2 as real) - 1) * 100 from (select min(t1.customer_id) as c2 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 = '2006-10-29 07:08:46' and t1.sta... | {
"index": 3416,
"split": "train"
} | |
Retrieve the vehicle ID and details along with the lesson status code and the vehicle ID for lessons involving customers whose date of birth is different from the date of birth of the staff member with nickname 'nicholaus92' and staff ID 1.
---
This phrasing maintains all the original information but makes it sound c... | driving_school | select t0.vehicle_id, t0.vehicle_details, t1.lesson_status_code, t1.vehicle_id from vehicles as t0 join lessons as t1 on t0.vehicle_id = t1.vehicle_id join customers as t2 on t1.customer_id = t2.customer_id where (not t2.date_of_birth in (select staff.date_of_birth as c1 from staff where staff.nickname = 'nicholaus92' ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "driving_school",
"sql": "select t0.vehicle_id, t0.vehicle_details, t1.lesson_status_code, t1.vehicle_id from vehicles as t0 join lessons as t1 on t0.vehicle_id = t1.vehicle_id join customers as t2 on t1.customer_id = t2.customer_id where (not t2.date_of_birth in (select staff.dat... | {
"index": 1748,
"split": "train"
} | |
Can you tell me the difference between the average premise ID values associated with addresses linked to premises 5 and 8? | customers_campaigns_ecommerce | select t1.c1 - t0.c1 from (select avg(t1.premise_id) as c1 from premises as t0 join customer_addresses as t1 on t0.premise_id = t1.premise_id where t0.premise_id = 8 group by t0.premise_id) as t1, (select t0.premise_id, avg(t1.premise_id) as c1 from premises as t0 join customer_addresses as t1 on t0.premise_id = t1.pre... | 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_campaigns_ecommerce",
"sql": "select t1.c1 - t0.c1 from (select avg(t1.premise_id) as c1 from premises as t0 join customer_addresses as t1 on t0.premise_id = t1.premise_id where t0.premise_id = 8 group by t0.premise_id) as t1, (select t0.premise_id, avg(t1.premise_id) a... | {
"index": 3599,
"split": "train"
} | |
Can you tell me how much the highest customer ID among customers who paid 99.26 in shipping charges exceeds the customer ID of customer 1? | customers_campaigns_ecommerce | select t2.c1 - t0.c2 from (select max(t1.c2) as c1 from (select max(t1.customer_id) as c2 from customers as t0 join customer_orders as t1 on t0.customer_id = t1.customer_id where t1.order_shipping_charges = 99.26 group by t0.customer_id) as t1) as t2, (select t0.customer_id, max(t1.customer_id) as c2 from customers 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": "customers_campaigns_ecommerce",
"sql": "select t2.c1 - t0.c2 from (select max(t1.c2) as c1 from (select max(t1.customer_id) as c2 from customers as t0 join customer_orders as t1 on t0.customer_id = t1.customer_id where t1.order_shipping_charges = 99.26 group by t0.customer_id) as... | {
"index": 3168,
"split": "train"
} | |
What are the visit details and the average of tourist IDs for visits that happened on December 10th, 1998, or on or after October 4th, 2010, grouped by visit details? | cre_Theme_park | select visit_details as c1, avg(tourist_id) from visits where visit_date = '1998-12-10 02:46:43' or visit_date >= '2010-10-04 01:34:12' group by c1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "cre_Theme_park",
"sql": "select visit_details as c1, avg(tourist_id) from visits where visit_date = '1998-12-10 02:46:43' or visit_date >= '2010-10-04 01:34:12' group by c1"
},
"style": "rule"
} | {
"index": 991,
"split": "train"
} | |
Which supplier IDs and address IDs are associated with customers whose customer codes end with "401"? | department_store | select t0.supplier_id, t0.address_id from supplier_addresses as t0 join addresses as t1 on t0.address_id = t1.address_id join customer_addresses as t2 on t1.address_id = t2.address_id join customers as t3 on t2.customer_id = t3.customer_id where t3.customer_code like '%401' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "department_store",
"sql": "select t0.supplier_id, t0.address_id from supplier_addresses as t0 join addresses as t1 on t0.address_id = t1.address_id join customer_addresses as t2 on t1.address_id = t2.address_id join customers as t3 on t2.customer_id = t3.customer_id where t3.cust... | {
"index": 873,
"split": "train"
} | |
What are the invoice numbers, their details, and dates for invoices linked to orders made by customers with IDs less than 9 or with customer ID 11? | tracking_orders | select t0.invoice_number, t0.invoice_details, t0.invoice_date from invoices as t0 join shipments as t1 on t0.invoice_number = t1.invoice_number join orders as t2 on t1.order_id = t2.order_id where t2.customer_id < 9 or t2.customer_id = 11 | 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 t0.invoice_number, t0.invoice_details, t0.invoice_date from invoices as t0 join shipments as t1 on t0.invoice_number = t1.invoice_number join orders as t2 on t1.order_id = t2.order_id where t2.customer_id < 9 or t2.customer_id = 11"
},
"style"... | {
"index": 743,
"split": "train"
} | |
For each festival listed in the details, how many entries are there, and how often does each festival ID appear? | entertainment_awards | select festival_id as c0, count(*), count(festival_id) from festival_detail group by 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": "entertainment_awards",
"sql": "select festival_id as c0, count(*), count(festival_id) from festival_detail group by c0"
},
"style": "rule"
} | {
"index": 2763,
"split": "train"
} | |
How many days passed between the birth date and hire date for employees whose addresses end with "W"? | store_1 | select julianday(t1.c3) - julianday(t0.c0) from (select birth_date as c3 from employees where address like '%W' and address like '%W') as t1, (select hire_date as c0 from employees) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "store_1",
"sql": "select julianday(t1.c3) - julianday(t0.c0) from (select birth_date as c3 from employees where address like '%W' and address like '%W') as t1, (select hire_date as c0 from employees) as t0"
},
"style": "rule"
} | {
"index": 3738,
"split": "train"
} | |
For each airport, what is its elevation and airport ID, and how many different airlines (by their IDs) operate routes starting from that airport, considering only airlines whose names begin with "P" and have airline IDs less than 5067? | flight_4 | select t0.elevation, t0.apid as c2, count(distinct (t1.alid)) from airports as t0 join routes as t1 on t0.apid = t1.src_apid where t1.airline like 'P%' and t1.alid < 5067 group by 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": "flight_4",
"sql": "select t0.elevation, t0.apid as c2, count(distinct (t1.alid)) from airports as t0 join routes as t1 on t0.apid = t1.src_apid where t1.airline like 'P%' and t1.alid < 5067 group by c2"
},
"style": "rule"
} | {
"index": 2123,
"split": "train"
} | |
Can you list the top 10 organizations' details along with their IDs that provide the most frequently offered service type? Sort these organizations in reverse alphabetical order by their details. | local_govt_and_lot | select t0.organization_details as c0 from organizations as t0 join services as t1 on t0.organization_id = t1.organization_id, (select service_type_code as c1 from services group by c1 order by count(*) asc nulls last limit 1) as t0 where t1.service_type_code = t0.c1 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": "local_govt_and_lot",
"sql": "select t0.organization_details as c0 from organizations as t0 join services as t1 on t0.organization_id = t1.organization_id, (select service_type_code as c1 from services group by c1 order by count(*) asc nulls last limit 1) as t0 where t1.service_ty... | {
"index": 560,
"split": "train"
} | |
Which insurance policies have claims settled for an amount of $1,724 or less but do not have any claims that haven’t been settled yet? List their policy IDs and policy type codes. | insurance_policies | select anon_1.c2, anon_1.c0 from (select t0.policy_id as c2, t0.policy_type_code as c0 from customer_policies as t0 join claims as t1 on t0.policy_id = t1.policy_id where t1.amount_settled <= 1724 except select t0.policy_id as c2, t0.policy_type_code as c0 from customer_policies as t0 join claims as t1 on t0.policy_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": "insurance_policies",
"sql": "select anon_1.c2, anon_1.c0 from (select t0.policy_id as c2, t0.policy_type_code as c0 from customer_policies as t0 join claims as t1 on t0.policy_id = t1.policy_id where t1.amount_settled <= 1724 except select t0.policy_id as c2, t0.policy_type_code ... | {
"index": 197,
"split": "train"
} | |
Which course authors have an average enrolled student ID of 14 or less, and what is the highest course ID they have authored along with their author ID and login name? | e_learning | select max(t0.course_id), t2.author_id as c1, t2.login_name from student_course_enrolment as t0 join courses as t1 on t0.course_id = t1.course_id join course_authors_and_tutors as t2 on t1.author_id = t2.author_id group by c1 having avg(t0.student_id) <= 14 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "e_learning",
"sql": "select max(t0.course_id), t2.author_id as c1, t2.login_name from student_course_enrolment as t0 join courses as t1 on t0.course_id = t1.course_id join course_authors_and_tutors as t2 on t1.author_id = t2.author_id group by c1 having avg(t0.student_id) <= 14"
... | {
"index": 2792,
"split": "train"
} | |
What is the difference in low temperature between Thursday at station 1 and Monday at station 2, where the Monday low temperature is at least 54? | station_weather | select t1.c2 - t0.c2 from (select low_temperature as c2 from weekly_weather where station_id = 2 and day_of_week = 'Monday' and c2 >= 54) as t1, (select low_temperature as c2 from weekly_weather where station_id = 1 and day_of_week = 'Thursday') 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": "station_weather",
"sql": "select t1.c2 - t0.c2 from (select low_temperature as c2 from weekly_weather where station_id = 2 and day_of_week = 'Monday' and c2 >= 54) as t1, (select low_temperature as c2 from weekly_weather where station_id = 1 and day_of_week = 'Thursday') as t0"
... | {
"index": 3624,
"split": "train"
} | |
Was the song "My love" released before "Ami opar hoye"? | music_1 | select t1.c2 < t0.c2 from (select releasedate as c2 from song where song_name = 'My love') as t1, (select releasedate as c2 from song where song_name = 'Ami opar hoye') 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": "music_1",
"sql": "select t1.c2 < t0.c2 from (select releasedate as c2 from song where song_name = 'My love') as t1, (select releasedate as c2 from song where song_name = 'Ami opar hoye') as t0"
},
"style": "rule"
} | {
"index": 3136,
"split": "train"
} | |
Is the highest product ID linked to product 2 with order quantities beginning with "1" less than the highest product ID linked to product 3? | customers_and_addresses | select t1.c2 < t0.c2 from (select max(t1.product_id) as c2 from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t0.product_id = 2 and t1.order_quantity like '1%' group by t0.product_id) as t1, (select t0.product_id, max(t1.product_id) as c2 from products as t0 join order_items as t1 on t0.p... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_and_addresses",
"sql": "select t1.c2 < t0.c2 from (select max(t1.product_id) as c2 from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t0.product_id = 2 and t1.order_quantity like '1%' group by t0.product_id) as t1, (select t0.product_id, m... | {
"index": 3561,
"split": "train"
} | |
Can you identify the top ten accounts with the highest total sum of transaction IDs, including their associated customer IDs and account IDs, among accounts belonging to customers with IDs less than 6? | customers_card_transactions | select sum(t0.account_id) as c2, t1.customer_id as c0, t1.account_id as c1 from financial_transactions as t0 join accounts as t1 on t0.account_id = t1.account_id where c0 < 6 group by c1 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": "customers_card_transactions",
"sql": "select sum(t0.account_id) as c2, t1.customer_id as c0, t1.account_id as c1 from financial_transactions as t0 join accounts as t1 on t0.account_id = t1.account_id where c0 < 6 group by c1 order by c2 desc limit 10"
},
"style": "rule"
} | {
"index": 2611,
"split": "train"
} | |
Which courses, including course ID 303, had student registrations between November 4 and November 8, 2008, and what are their course IDs and names? | student_assessment | select anon_1.c0, anon_1.c1 from (select t0.course_id as c0, t0.course_name as c1 from courses as t0 join student_course_registrations as t1 on t0.course_id = t1.course_id where t1.registration_date between '2008-11-04 10:35:13' and '2008-11-08 10:35:13' intersect select t0.course_id as c0, t0.course_name as c1 from co... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "student_assessment",
"sql": "select anon_1.c0, anon_1.c1 from (select t0.course_id as c0, t0.course_name as c1 from courses as t0 join student_course_registrations as t1 on t0.course_id = t1.course_id where t1.registration_date between '2008-11-04 10:35:13' and '2008-11-08 10:35:... | {
"index": 1181,
"split": "train"
} | |
Among the rooms whose names contain "ypt", which room ID comes first in alphabetical order, and what is the minimum number of beds among those rooms? | inn_1 | select roomid as c0, min(beds) from rooms where roomname like '%ypt%' group by c0 order by c0 asc nulls last limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "inn_1",
"sql": "select roomid as c0, min(beds) from rooms where roomname like '%ypt%' group by c0 order by c0 asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 2000,
"split": "train"
} | |
What is the name of the club with the highest club ID? | riding_club | select club_name from club order by club_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": "riding_club",
"sql": "select club_name from club order by club_id desc limit 1"
},
"style": "rule"
} | {
"index": 321,
"split": "train"
} | |
What are the top 5 zip codes and cities, along with customer address IDs and the dates customers first became clients, for customers who have taken lessons with vehicles that have "Van" in their details, sorted by zip code in reverse alphabetical order? | driving_school | select t0.zip_postcode as c1, t0.city, t1.customer_address_id, t1.date_became_customer from addresses as t0 join customers as t1 on t0.address_id = t1.customer_address_id join lessons as t2 on t1.customer_id = t2.customer_id join vehicles as t3 on t2.vehicle_id = t3.vehicle_id where t3.vehicle_details like '%Van' order... | 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.zip_postcode as c1, t0.city, t1.customer_address_id, t1.date_became_customer from addresses as t0 join customers as t1 on t0.address_id = t1.customer_address_id join lessons as t2 on t1.customer_id = t2.customer_id join vehicles as t3 on t2.vehi... | {
"index": 359,
"split": "train"
} | |
Find the budget, building, and department name for departments headed by instructors whose names end with "ero" or start with "Pime". | college_2 | select t0.budget, t0.building, t0.dept_name from department as t0 join instructor as t1 on t0.dept_name = t1.dept_name where t1.name like '%ero' or t1.name like 'Pime%' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "college_2",
"sql": "select t0.budget, t0.building, t0.dept_name from department as t0 join instructor as t1 on t0.dept_name = t1.dept_name where t1.name like '%ero' or t1.name like 'Pime%'"
},
"style": "rule"
} | {
"index": 2657,
"split": "train"
} | |
Which county appears last when listing all appellations in reverse alphabetical order? | wine_1 | select county as c0 from appellations 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": "wine_1",
"sql": "select county as c0 from appellations order by c0 desc limit 1"
},
"style": "rule"
} | {
"index": 1144,
"split": "train"
} | |
Which customers and their card validity start dates are linked to transactions that involved amounts exceeding 1701.23 or amounts of 462.63 or less? | customers_card_transactions | select t0.customer_id, t0.date_valid_from from customers_cards as t0 join financial_transactions as t1 on t0.card_id = t1.card_id where t1.transaction_amount > 1701.23 or t1.transaction_amount <= 462.63 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_card_transactions",
"sql": "select t0.customer_id, t0.date_valid_from from customers_cards as t0 join financial_transactions as t1 on t0.card_id = t1.card_id where t1.transaction_amount > 1701.23 or t1.transaction_amount <= 462.63"
},
"style": "rule"
} | {
"index": 297,
"split": "train"
} | |
What is the percentage increase or decrease in the number of orders (based on their earliest shipment IDs) that were shipped on January 17, 2006, compared to those shipped on June 7, 1986? | tracking_orders | select (count(distinct (t0.c2)) / cast(count(distinct (t1.c2)) as real) - 1) * 100 from (select min(t1.order_id) as c2 from orders as t0 join shipments as t1 on t0.order_id = t1.order_id where t1.shipment_date = '2006-01-17 03:08:05' group by t0.order_id) as t0, (select t0.order_id, min(t1.order_id) as c2 from orders a... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_orders",
"sql": "select (count(distinct (t0.c2)) / cast(count(distinct (t1.c2)) as real) - 1) * 100 from (select min(t1.order_id) as c2 from orders as t0 join shipments as t1 on t0.order_id = t1.order_id where t1.shipment_date = '2006-01-17 03:08:05' group by t0.order_id... | {
"index": 3999,
"split": "train"
} | |
List the different areas, languages spoken, and country IDs for the countries. | roller_coaster | select distinct area, languages, country_id from country | 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 distinct area, languages, country_id from country"
},
"style": "rule"
} | {
"index": 2558,
"split": "train"
} | |
Which shops that have stock entries for shop ID 2 but do not have any stock with a quantity of 56? Specifically, what are their open dates and open years? | device | select anon_1.c1, anon_1.c0 from (select t0.open_date as c1, t0.open_year as c0 from shop as t0 join stock as t1 on t0.shop_id = t1.shop_id where t1.shop_id = 2 except select t0.open_date as c1, t0.open_year as c0 from shop as t0 join stock as t1 on t0.shop_id = t1.shop_id where t1.quantity = 56) 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": "device",
"sql": "select anon_1.c1, anon_1.c0 from (select t0.open_date as c1, t0.open_year as c0 from shop as t0 join stock as t1 on t0.shop_id = t1.shop_id where t1.shop_id = 2 except select t0.open_date as c1, t0.open_year as c0 from shop as t0 join stock as t1 on t0.shop_id = ... | {
"index": 841,
"split": "train"
} | |
Are there fewer unique staff members with the role of researcher involved in projects with IDs up to 2 than there are staff members with the role of leader overall? | tracking_grants_for_research | select t1.c1 < t0.c1 from (select count(distinct (t1.staff_id)) as c1 from staff_roles as t0 join project_staff as t1 on t0.role_code = t1.role_code where t0.role_code = 'researcher' and t1.project_id <= 2 group by t0.role_code) as t1, (select t0.role_code, count(distinct (t1.staff_id)) as c1 from staff_roles as t0 joi... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_grants_for_research",
"sql": "select t1.c1 < t0.c1 from (select count(distinct (t1.staff_id)) as c1 from staff_roles as t0 join project_staff as t1 on t0.role_code = t1.role_code where t0.role_code = 'researcher' and t1.project_id <= 2 group by t0.role_code) as t1, (sele... | {
"index": 3578,
"split": "train"
} | |
Which buildings have three or fewer office locations occupied by the company with ID 11? Please provide the names and IDs of those buildings. | company_office | select t0.name, t0.id as c1 from buildings as t0 join office_locations as t1 on t0.id = t1.building_id where t1.company_id = 11 group by c1 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": "company_office",
"sql": "select t0.name, t0.id as c1 from buildings as t0 join office_locations as t1 on t0.id = t1.building_id where t1.company_id = 11 group by c1 having count(*) <= 3"
},
"style": "rule"
} | {
"index": 1381,
"split": "train"
} | |
What are the advisor and age of students, and their club roles, for members of clubs whose descriptions mention "d adults about computer"? | club_1 | select t0.advisor, t0.age, t1.position from student as t0 join member_of_club as t1 on t0.stuid = t1.stuid join club as t2 on t1.clubid = t2.clubid where t2.clubdesc like '%d adults about computer%' | 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": "club_1",
"sql": "select t0.advisor, t0.age, t1.position from student as t0 join member_of_club as t1 on t0.stuid = t1.stuid join club as t2 on t1.clubid = t2.clubid where t2.clubdesc like '%d adults about computer%'"
},
"style": "rule"
} | {
"index": 349,
"split": "train"
} | |
Which faculty members participate in activities with IDs of 771 or higher? Please provide the faculty IDs and activity IDs involved. | activity_1 | select t0.actid, t0.facid, t1.actid from faculty_participates_in as t0 join activity as t1 on t0.actid = t1.actid join participates_in as t2 on t1.actid = t2.actid where t2.actid >= 771 | 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 t0.actid, t0.facid, t1.actid from faculty_participates_in as t0 join activity as t1 on t0.actid = t1.actid join participates_in as t2 on t1.actid = t2.actid where t2.actid >= 771"
},
"style": "rule"
} | {
"index": 2541,
"split": "train"
} | |
Which airlines operate routes starting from airport 3144 and flying to destinations that have "K" in their airport code, and what are their countries and names? | flight_4 | select t0.country, t0.name from airlines as t0 join routes as t1 on t0.alid = t1.alid where t1.src_apid = 3144 and t1.dst_ap like '%K%' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "flight_4",
"sql": "select t0.country, t0.name from airlines as t0 join routes as t1 on t0.alid = t1.alid where t1.src_apid = 3144 and t1.dst_ap like '%K%'"
},
"style": "rule"
} | {
"index": 1525,
"split": "train"
} | |
Which rooms with reservations starting in November have their names and decor styles, excluding any rooms that are not listed in the Rooms table? | inn_1 | select anon_1.c2, anon_1.c0 from (select t0.roomname as c2, t0.decor as c0 from rooms as t0 join reservations as t1 on t0.roomid = t1.room where t1.checkin like '11-J%' except select t0.roomname as c2, t0.decor as c0 from rooms as t0 join reservations as t1 on t0.roomid = t1.room where (not t1.room in (select roomid fr... | 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": "inn_1",
"sql": "select anon_1.c2, anon_1.c0 from (select t0.roomname as c2, t0.decor as c0 from rooms as t0 join reservations as t1 on t0.roomid = t1.room where t1.checkin like '11-J%' except select t0.roomname as c2, t0.decor as c0 from rooms as t0 join reservations as t1 on t0.... | {
"index": 1761,
"split": "train"
} | |
Which five customers have the highest average property IDs associated with their events, and what are their customer details and IDs? | local_govt_and_lot | select t0.customer_details, t0.customer_id as c2, avg(t2.property_id) as c0 from customers as t0 join customer_events as t1 on t0.customer_id = t1.customer_id join customer_event_notes as t2 on t1.customer_event_id = t2.customer_event_id group by c2 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": "local_govt_and_lot",
"sql": "select t0.customer_details, t0.customer_id as c2, avg(t2.property_id) as c0 from customers as t0 join customer_events as t1 on t0.customer_id = t1.customer_id join customer_event_notes as t2 on t1.customer_event_id = t2.customer_event_id group by c2 o... | {
"index": 2737,
"split": "train"
} | |
Can you list the Channel ID, rating percentage, name, and owner of all channels that do not broadcast the program called 'Youman'? | program_share | select anon_1.c3, anon_1.c1, anon_1.c0, anon_1.c2 from (select channel_id as c3, rating_in_percent as c1, name as c0, owner as c2 from channel except select t0.channel_id as c3, t0.rating_in_percent as c1, t0.name as c0, t0.owner as c2 from channel as t0 join broadcast as t1 on t0.channel_id = t1.channel_id join progra... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "program_share",
"sql": "select anon_1.c3, anon_1.c1, anon_1.c0, anon_1.c2 from (select channel_id as c3, rating_in_percent as c1, name as c0, owner as c2 from channel except select t0.channel_id as c3, t0.rating_in_percent as c1, t0.name as c0, t0.owner as c2 from channel as t0 j... | {
"index": 2595,
"split": "train"
} | |
Could you tell me the total number of scores, the count of distinct home teams, and the number of injury accident records for the most common number of matches affected, specifically looking at injury reports from 'inter.it'? I'm interested in the three injury records with the smallest number of incidents, sorted accor... | game_injury | select count(t0.score), count(distinct (t0.home_team)), count(t1.id) as c1 from game as t0 join injury_accident as t1 on t0.id = t1.game_id, (select number_of_matches as c2 from injury_accident group by c2 order by count(*) desc limit 1) as t0 where t1.source = 'inter.it' and t1.number_of_matches = t0.c2 order by c1 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": "game_injury",
"sql": "select count(t0.score), count(distinct (t0.home_team)), count(t1.id) as c1 from game as t0 join injury_accident as t1 on t0.id = t1.game_id, (select number_of_matches as c2 from injury_accident group by c2 order by count(*) desc limit 1) as t0 where t1.sourc... | {
"index": 919,
"split": "train"
} | |
Can you tell me the names of the representatives and managers of gas stations that are operated by companies in the most common industry and also those operated by companies headquartered in the most common location? | gas_company | select anon_1.c2, anon_1.c1 from (select t0.representative_name as c2, t0.manager_name as c1 from gas_station as t0 join station_company as t1 on t0.station_id = t1.station_id join company as t2 on t1.company_id = t2.company_id, (select main_industry as c0 from company group by c0 order by count(*) asc nulls last limit... | 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 anon_1.c2, anon_1.c1 from (select t0.representative_name as c2, t0.manager_name as c1 from gas_station as t0 join station_company as t1 on t0.station_id = t1.station_id join company as t2 on t1.company_id = t2.company_id, (select main_industry as c0 f... | {
"index": 1775,
"split": "train"
} | |
Which five medicines, including their names, trade names, types of interaction, and IDs, interact with the enzyme whose name ends with "phyrinogen III synthase," listed in order of their medicine IDs from lowest to highest? | medicine_enzyme_interaction | select t0.name, t0.trade_name, t1.interaction_type, t1.medicine_id as c0 from medicine as t0 join medicine_enzyme_interaction as t1 on t0.id = t1.medicine_id join enzyme as t2 on t1.enzyme_id = t2.id where t2.name like '%phyrinogen III synthase' order by c0 asc nulls last limit 5 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "medicine_enzyme_interaction",
"sql": "select t0.name, t0.trade_name, t1.interaction_type, t1.medicine_id as c0 from medicine as t0 join medicine_enzyme_interaction as t1 on t0.id = t1.medicine_id join enzyme as t2 on t1.enzyme_id = t2.id where t2.name like '%phyrinogen III syntha... | {
"index": 960,
"split": "train"
} | |
Within the set of transaction types that occur exactly once for share transactions with a share count of 1522 and investors whose IDs are between 7 and 17, what are the descriptions and type codes of the five least frequent transaction types, ordered by how many times they appear? | tracking_share_transactions | select t0.transaction_type_description, t0.transaction_type_code as c0 from ref_transaction_types as t0 join transactions as t1 on t0.transaction_type_code = t1.transaction_type_code where t1.share_count = 1522 and t1.investor_id between 7 and 17 group by c0 having count(*) = 1 order by count(*) 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": "tracking_share_transactions",
"sql": "select t0.transaction_type_description, t0.transaction_type_code as c0 from ref_transaction_types as t0 join transactions as t1 on t0.transaction_type_code = t1.transaction_type_code where t1.share_count = 1522 and t1.investor_id between 7 an... | {
"index": 1620,
"split": "train"
} | |
Who are the first five students, including their login and middle names, enrolled in courses with IDs less than or equal to 1 or greater than or equal to 10, sorted alphabetically by their personal names? | e_learning | select t0.login_name, t0.middle_name from students as t0 join student_course_enrolment as t1 on t0.student_id = t1.student_id where t1.course_id <= 1 or t1.course_id >= 10 order by t0.personal_name 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": "e_learning",
"sql": "select t0.login_name, t0.middle_name from students as t0 join student_course_enrolment as t1 on t0.student_id = t1.student_id where t1.course_id <= 1 or t1.course_id >= 10 order by t0.personal_name asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 216,
"split": "train"
} | |
Can you tell me the country, city, company, and invoice ID for all invoices issued on December 6, 2011? | store_1 | select t0.country, t0.city, t0.company, t1.id from customers as t0 join invoices as t1 on t0.id = t1.customer_id where t1.invoice_date = '2011-12-06 00:00:00' | 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, t0.company, t1.id from customers as t0 join invoices as t1 on t0.id = t1.customer_id where t1.invoice_date = '2011-12-06 00:00:00'"
},
"style": "rule"
} | {
"index": 2263,
"split": "train"
} | |
Can you tell me all the unique years, company IDs, and employee IDs associated with the employee who has ID 4, reflecting all the different periods and companies they have worked for? | company_employee | select distinct year_working, people_id as c0, company_id from employment where c0 = 4 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "company_employee",
"sql": "select distinct year_working, people_id as c0, company_id from employment where c0 = 4"
},
"style": "rule"
} | {
"index": 1506,
"split": "train"
} | |
What are the product IDs and order IDs for the order items that are linked to financial transactions either with transaction types starting with "Payment" or with the transaction type associated with the most recent invoice number? | customers_and_invoices | select t0.product_id, t0.order_id from order_items as t0 join orders as t1 on t0.order_id = t1.order_id join invoices as t2 on t1.order_id = t2.order_id join financial_transactions as t3 on t2.invoice_number = t3.invoice_number, (select transaction_type as c0 from financial_transactions group by c0 order by min(invoice... | 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 t0.product_id, t0.order_id from order_items as t0 join orders as t1 on t0.order_id = t1.order_id join invoices as t2 on t1.order_id = t2.order_id join financial_transactions as t3 on t2.invoice_number = t3.invoice_number, (select transactio... | {
"index": 379,
"split": "train"
} | |
Which are the five customers' IDs with the highest savings account IDs, listed in order from lowest to highest? | small_bank_1 | select custid as c0 from savings order by c0 asc nulls last limit 5 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "small_bank_1",
"sql": "select custid as c0 from savings order by c0 asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 2470,
"split": "train"
} | |
Which artists, with their countries and genders, have songs in genres rated exactly 9, and what are the release dates of those songs? | music_1 | select t0.country, t0.gender, t0.artist_name, t1.releasedate from artist as t0 join song as t1 on t0.artist_name = t1.artist_name join genre as t2 on t1.genre_is = t2.g_name where t2.rating = 9 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "music_1",
"sql": "select t0.country, t0.gender, t0.artist_name, t1.releasedate from artist as t0 join song as t1 on t0.artist_name = t1.artist_name join genre as t2 on t1.genre_is = t2.g_name where t2.rating = 9"
},
"style": "rule"
} | {
"index": 176,
"split": "train"
} | |
Which are the email addresses, staff IDs, first names, and product IDs of the first five staff members handling complaints for customers from the most frequently occurring town, sorted by product ID? | customer_complaints | select t0.email_address, t0.staff_id, t0.first_name, t1.product_id as c1 from staff as t0 join complaints as t1 on t0.staff_id = t1.staff_id join customers as t2 on t1.customer_id = t2.customer_id, (select town_city as c4 from customers where customer_id = 116 group by c4 order by count(*) asc nulls last limit 1) 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.email_address, t0.staff_id, t0.first_name, t1.product_id as c1 from staff as t0 join complaints as t1 on t0.staff_id = t1.staff_id join customers as t2 on t1.customer_id = t2.customer_id, (select town_city as c4 from customers where custome... | {
"index": 1271,
"split": "train"
} | |
Among the accounts that have transactions with card IDs between 9 and 12, what are the smallest and largest average account IDs? | customers_card_transactions | select min(t0.c3), max(t0.c3) from (select avg(t1.account_id) as c3 from accounts as t0 join financial_transactions as t1 on t0.account_id = t1.account_id where t1.card_id between 9 and 12 group by t0.account_id) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_card_transactions",
"sql": "select min(t0.c3), max(t0.c3) from (select avg(t1.account_id) as c3 from accounts as t0 join financial_transactions as t1 on t0.account_id = t1.account_id where t1.card_id between 9 and 12 group by t0.account_id) as t0"
},
"style": "rule"... | {
"index": 3942,
"split": "train"
} | |
How many songs are there overall, what is the lowest rating among all songs, and what are the ratings and names of genres that have a rating ending in "8"? | music_1 | select count(*), min(t0.rating), t1.rating as c0, t1.g_name as c1 from song as t0 join genre as t1 on t0.genre_is = t1.g_name where c0 like '%8' group by c1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "music_1",
"sql": "select count(*), min(t0.rating), t1.rating as c0, t1.g_name as c1 from song as t0 join genre as t1 on t0.genre_is = t1.g_name where c0 like '%8' group by c1"
},
"style": "rule"
} | {
"index": 575,
"split": "train"
} | |
What are the distinct address type codes for addresses associated with the most frequently occurring premise whose type includes the letter 'e'? | customers_campaigns_ecommerce | select distinct t0.address_type_code from customer_addresses as t0 join premises as t1 on t0.premise_id = t1.premise_id, (select premise_id as c1 from premises group by c1 order by count(*) desc limit 1) as t0 where t1.premise_id = t0.c1 and t1.premises_type like '%e%' | 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_campaigns_ecommerce",
"sql": "select distinct t0.address_type_code from customer_addresses as t0 join premises as t1 on t0.premise_id = t1.premise_id, (select premise_id as c1 from premises group by c1 order by count(*) desc limit 1) as t0 where t1.premise_id = t0.c1 an... | {
"index": 1534,
"split": "train"
} | |
What are the budget type description, budget type code, and project ID for project 35? | cre_Docs_and_Epenses | select t0.budget_type_description, t0.budget_type_code, t2.project_id 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 projects as t3 on t2.project_id = t3.project_id where t3.project_id = 35 or... | 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_description, t0.budget_type_code, t2.project_id 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 proj... | {
"index": 2233,
"split": "train"
} | |
Which team had the highest 'so' and 'attendance' in their home games played at parks located in cities ending with "im" or starting with "Columbus", and what are the team and park IDs for the park with the highest park ID among these? | baseball_1 | select t0.so, t0.attendance, t1.team_id, t1.park_id as c2 from team as t0 join home_game as t1 on t0.team_id = t1.team_id join park as t2 on t1.park_id = t2.park_id where t2.city like '%im' or t2.city like 'Columbus%' order by c2 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": "baseball_1",
"sql": "select t0.so, t0.attendance, t1.team_id, t1.park_id as c2 from team as t0 join home_game as t1 on t0.team_id = t1.team_id join park as t2 on t1.park_id = t2.park_id where t2.city like '%im' or t2.city like 'Columbus%' order by c2 desc limit 1"
},
"style":... | {
"index": 2356,
"split": "train"
} | |
What is the difference in the total sum of problem IDs associated with staff members numbered 6 and 8? | tracking_software_problems | select t1.c2 - t0.c2 from (select sum(t1.problem_id) as c2 from staff as t0 join problem_log as t1 on t0.staff_id = t1.assigned_to_staff_id where t0.staff_id = 8 group by t0.staff_id) as t1, (select t0.staff_id, sum(t1.problem_id) as c2 from staff as t0 join problem_log as t1 on t0.staff_id = t1.assigned_to_staff_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": "tracking_software_problems",
"sql": "select t1.c2 - t0.c2 from (select sum(t1.problem_id) as c2 from staff as t0 join problem_log as t1 on t0.staff_id = t1.assigned_to_staff_id where t0.staff_id = 8 group by t0.staff_id) as t1, (select t0.staff_id, sum(t1.problem_id) as c2 from s... | {
"index": 3631,
"split": "train"
} | |
Among teachers whose last names contain the letter "A" and who teach classrooms numbered 109 or higher, which ten teachers have the highest average classroom number? List their last names in alphabetical order along with their average classroom numbers, only including those with an average above 107. | student_1 | select avg(classroom) from teachers where lastname like '%A%' and classroom >= 109 group by lastname having avg(classroom) > 107 order by lastname 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": "student_1",
"sql": "select avg(classroom) from teachers where lastname like '%A%' and classroom >= 109 group by lastname having avg(classroom) > 107 order by lastname asc nulls last limit 10"
},
"style": "rule"
} | {
"index": 1717,
"split": "train"
} | |
Which airport IDs, altitudes, and company IDs are associated with flights operated by companies that have "di" in their type and whose names start with "Dragonair," listed in order of their company IDs? | flight_company | select t0.airport_id, t0.altitude, t1.id as c2 from flight as t0 join operate_company as t1 on t0.company_id = t1.id where t1.type like '%di%' and t1.name like 'Dragonair%' order by c2 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": "flight_company",
"sql": "select t0.airport_id, t0.altitude, t1.id as c2 from flight as t0 join operate_company as t1 on t0.company_id = t1.id where t1.type like '%di%' and t1.name like 'Dragonair%' order by c2 asc nulls last"
},
"style": "rule"
} | {
"index": 1079,
"split": "train"
} | |
Did the transaction with ID 15 happen before the transaction with ID 3? | tracking_share_transactions | select t1.c1 < t0.c1 from (select date_of_transaction as c1 from transactions where transaction_id = 15) as t1, (select date_of_transaction as c1 from transactions where transaction_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_share_transactions",
"sql": "select t1.c1 < t0.c1 from (select date_of_transaction as c1 from transactions where transaction_id = 15) as t1, (select date_of_transaction as c1 from transactions where transaction_id = 3) as t0"
},
"style": "rule"
} | {
"index": 3991,
"split": "train"
} | |
Who is the player with an ID starting with "zub" whose first name is last alphabetically? Provide their first name as the top result. | baseball_1 | select t0.name_first as c0 from player as t0 join player_college as t1 on t0.player_id = t1.player_id where t1.player_id like 'zub%' 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": "baseball_1",
"sql": "select t0.name_first as c0 from player as t0 join player_college as t1 on t0.player_id = t1.player_id where t1.player_id like 'zub%' order by c0 desc limit 1"
},
"style": "rule"
} | {
"index": 2453,
"split": "train"
} | |
What are the job IDs, maximum salaries, and job titles for all jobs located in the Finance department? | hr_1 | select t0.job_id, t0.max_salary, t0.job_title from jobs as t0 join employees as t1 on t0.job_id = t1.job_id join departments as t2 on t1.department_id = t2.department_id where t2.department_name = 'Finance' | 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 t0.job_id, t0.max_salary, t0.job_title from jobs as t0 join employees as t1 on t0.job_id = t1.job_id join departments as t2 on t1.department_id = t2.department_id where t2.department_name = 'Finance'"
},
"style": "rule"
} | {
"index": 1031,
"split": "train"
} | |
Can you provide the dates and billing states of invoices that include tracks with IDs up to 472? | store_1 | select t0.invoice_date, t0.billing_state from invoices as t0 join invoice_lines as t1 on t0.id = t1.invoice_id where t1.track_id <= 472 or t1.track_id < 274 | 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.billing_state from invoices as t0 join invoice_lines as t1 on t0.id = t1.invoice_id where t1.track_id <= 472 or t1.track_id < 274"
},
"style": "rule"
} | {
"index": 979,
"split": "train"
} | |
Can you tell me the elevation and name of airports that serve as source airports for routes operated by airline 'TCX', where the source airport ID is less than or equal to 3361? | flight_4 | select t0.elevation, t0.name from airports as t0 join routes as t1 on t0.apid = t1.src_apid where t1.src_apid <= 3361 and t1.airline = 'TCX' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "flight_4",
"sql": "select t0.elevation, t0.name from airports as t0 join routes as t1 on t0.apid = t1.src_apid where t1.src_apid <= 3361 and t1.airline = 'TCX'"
},
"style": "rule"
} | {
"index": 1190,
"split": "train"
} | |
What is the total number of days between the start and end dates of the maintenance contract? | assets_maintenance | select julianday(t1.c2) - julianday(t0.c1) from (select contract_start_date as c2 from maintenance_contracts) as t1, (select contract_end_date as c1 from maintenance_contracts) 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": "assets_maintenance",
"sql": "select julianday(t1.c2) - julianday(t0.c1) from (select contract_start_date as c2 from maintenance_contracts) as t1, (select contract_end_date as c1 from maintenance_contracts) as t0"
},
"style": "rule"
} | {
"index": 3898,
"split": "train"
} | |
Which products have been ordered with a quantity of exactly one, and what are their sizes and colors? | customers_and_invoices | select t0.product_size, t0.product_color from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_quantity = 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": "customers_and_invoices",
"sql": "select t0.product_size, t0.product_color from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_quantity = 1"
},
"style": "rule"
} | {
"index": 1023,
"split": "train"
} | |
What are the ratings in percent, channel IDs, and channel names for channels that broadcast programs owned by Shanghai Media Group (SMG)? | program_share | select t0.rating_in_percent, t0.channel_id, t0.name from channel as t0 join broadcast as t1 on t0.channel_id = t1.channel_id join program as t2 on t1.program_id = t2.program_id where t2.owner = 'Shanghai Media Group (SMG)' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "program_share",
"sql": "select t0.rating_in_percent, t0.channel_id, t0.name from channel as t0 join broadcast as t1 on t0.channel_id = t1.channel_id join program as t2 on t1.program_id = t2.program_id where t2.owner = 'Shanghai Media Group (SMG)'"
},
"style": "rule"
} | {
"index": 1651,
"split": "train"
} | |
What are the payment methods and address IDs for customers whose addresses are not associated with any supplier addresses? | department_store | select t0.payment_method_code, t1.address_id as c2 from customers as t0 join customer_addresses as t1 on t0.customer_id = t1.customer_id where (not c2 in (select supplier_addresses.address_id as c1 from supplier_addresses)) | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "department_store",
"sql": "select t0.payment_method_code, t1.address_id as c2 from customers as t0 join customer_addresses as t1 on t0.customer_id = t1.customer_id where (not c2 in (select supplier_addresses.address_id as c1 from supplier_addresses))"
},
"style": "rule"
} | {
"index": 2904,
"split": "train"
} | |
What are the descriptions, IDs, and types of aircraft that are associated with airports having at least 1,320,678 domestic passengers? | aircraft | select t0.description, t0.aircraft_id, t0.aircraft from aircraft as t0 join airport_aircraft as t1 on t0.aircraft_id = t1.aircraft_id join airport as t2 on t1.airport_id = t2.airport_id where t2.domestic_passengers >= 1320678.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": "aircraft",
"sql": "select t0.description, t0.aircraft_id, t0.aircraft from aircraft as t0 join airport_aircraft as t1 on t0.aircraft_id = t1.aircraft_id join airport as t2 on t1.airport_id = t2.airport_id where t2.domestic_passengers >= 1320678.0"
},
"style": "rule"
} | {
"index": 1255,
"split": "train"
} | |
How many pilot records are there? | pilot_record | select count(*) from pilot_record | 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 count(*) from pilot_record"
},
"style": "rule"
} | {
"index": 2581,
"split": "train"
} | |
How many problems reported before October 27, 1970, 16:35:34 have the earliest reporting date among those problems? | tracking_software_problems | select count(date_problem_reported) as c0 from problems where date_problem_reported < '1970-10-27 16:35:34' 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": "tracking_software_problems",
"sql": "select count(date_problem_reported) as c0 from problems where date_problem_reported < '1970-10-27 16:35:34' order by c0 asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 2365,
"split": "train"
} | |
For each election cycle, what is the highest president vote recorded, listing the first 10 election cycles in order? | voter_2 | select election_cycle as c0, max(president_vote) from voting_record group by c0 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": "voter_2",
"sql": "select election_cycle as c0, max(president_vote) from voting_record group by c0 order by c0 asc nulls last limit 10"
},
"style": "rule"
} | {
"index": 2234,
"split": "train"
} | |
Could you tell me the Event IDs, Event Service IDs, and Service IDs for all events related to services whose type code ends with "th Proof"? | local_govt_in_alabama | select t0.event_id, t0.service_id, t1.service_id from events as t0 join services as t1 on t0.service_id = t1.service_id where t1.service_type_code like '%th Proof' | 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.event_id, t0.service_id, t1.service_id from events as t0 join services as t1 on t0.service_id = t1.service_id where t1.service_type_code like '%th Proof'"
},
"style": "rule"
} | {
"index": 2212,
"split": "train"
} | |
Show the location of each college along with the total number of entries, the number of unique leaders, and the total number of members associated with each location. | decoration_competition | select college_location as c3, count(*), count(distinct (leader_name)), count(name) from college group by c3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "decoration_competition",
"sql": "select college_location as c3, count(*), count(distinct (leader_name)), count(name) from college group by c3"
},
"style": "rule"
} | {
"index": 1491,
"split": "train"
} | |
What are the weights and people IDs of individuals who both have an entrepreneur investor starting with "D" and are associated with the most common company? | entrepreneur | select anon_1.c1, anon_1.c0 from (select t0.weight as c1, t0.people_id as c0 from people as t0 join entrepreneur as t1 on t0.people_id = t1.people_id where t1.investor like 'D%' intersect select t0.weight as c1, t0.people_id as c0 from people as t0 join entrepreneur as t1 on t0.people_id = t1.people_id, (select company... | 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": "entrepreneur",
"sql": "select anon_1.c1, anon_1.c0 from (select t0.weight as c1, t0.people_id as c0 from people as t0 join entrepreneur as t1 on t0.people_id = t1.people_id where t1.investor like 'D%' intersect select t0.weight as c1, t0.people_id as c0 from people as t0 join ent... | {
"index": 1739,
"split": "train"
} | |
List the height, status, and ID of buildings that are either the building with ID 7 or are referenced in office locations but are not present in the buildings database. | company_office | select t0.height, t0.status from buildings as t0 join office_locations as t1 on t0.id = t1.building_id where (not t1.building_id in (select t0.id as c0 from buildings)) or t1.building_id = 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": "company_office",
"sql": "select t0.height, t0.status from buildings as t0 join office_locations as t1 on t0.id = t1.building_id where (not t1.building_id in (select t0.id as c0 from buildings)) or t1.building_id = 7"
},
"style": "rule"
} | {
"index": 422,
"split": "train"
} | |
What is the name of the technician with technician ID 5 who has the most recent starting year? | machine_repair | select t0.name from technician as t0 join repair_assignment as t1 on t0.technician_id = t1.technician_id where t1.technician_id = 5 or t1.technician_id = 5 order by t0.starting_year 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": "machine_repair",
"sql": "select t0.name from technician as t0 join repair_assignment as t1 on t0.technician_id = t1.technician_id where t1.technician_id = 5 or t1.technician_id = 5 order by t0.starting_year desc limit 1"
},
"style": "rule"
} | {
"index": 1295,
"split": "train"
} | |
Return the last name and phone number of the staff member involved in handling complaints from customers whose states contain either "a" or "olor," focusing on the staff member with the highest phone number when sorted in descending order. | customer_complaints | select t0.last_name, t0.phone_number as c1 from staff as t0 join complaints as t1 on t0.staff_id = t1.staff_id join customers as t2 on t1.customer_id = t2.customer_id where t2.state like '%a%' or t2.state like '%olor%' order by c1 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": "customer_complaints",
"sql": "select t0.last_name, t0.phone_number as c1 from staff as t0 join complaints as t1 on t0.staff_id = t1.staff_id join customers as t2 on t1.customer_id = t2.customer_id where t2.state like '%a%' or t2.state like '%olor%' order by c1 desc limit 1"
},
... | {
"index": 9,
"split": "train"
} | |
What are the order status codes of the earliest five customer orders where the order includes either products with an ID equal to the total number of products ordered or products with an ID greater than 3, sorted by their order date? | department_store | select t0.order_status_code from customer_orders as t0 join order_items as t1 on t0.order_id = t1.order_id, (select count(product_id) as c0 from order_items) as t0 where t1.product_id = t0.c0 or t1.product_id > 3 order by t0.order_date 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": "department_store",
"sql": "select t0.order_status_code from customer_orders as t0 join order_items as t1 on t0.order_id = t1.order_id, (select count(product_id) as c0 from order_items) as t0 where t1.product_id = t0.c0 or t1.product_id > 3 order by t0.order_date asc nulls last li... | {
"index": 362,
"split": "train"
} | |
Which five employees certified for aircraft 8 or 2 have the lowest salaries, when sorted alphabetically by their name? | flight_1 | select t0.salary from employee as t0 join certificate as t1 on t0.eid = t1.eid where t1.aid = 8 or t1.aid = 2 order by t0.name asc nulls last limit 5 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "flight_1",
"sql": "select t0.salary from employee as t0 join certificate as t1 on t0.eid = t1.eid where t1.aid = 8 or t1.aid = 2 order by t0.name asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 2164,
"split": "train"
} | |
Which three manufacturers have an average revenue of exactly 30.0, when grouped by their manufacturer code, and listed in descending order of their codes? | manufactory_1 | select avg(revenue) from manufacturers group by code having avg(revenue) = 30.0 order by code 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": "manufactory_1",
"sql": "select avg(revenue) from manufacturers group by code having avg(revenue) = 30.0 order by code desc limit 3"
},
"style": "rule"
} | {
"index": 2634,
"split": "train"
} | |
Which station has the lowest latitude among those where the number of bikes available is either less than 12 or at least 16, and what are its latitude, dock count, station ID, and the maximum number of bikes available at that station? | bike_1 | select t0.lat as c0, t0.dock_count, t0.id as c3, max(t1.bikes_available) from station as t0 join status as t1 on t0.id = t1.station_id where t1.bikes_available < 12 or t1.bikes_available >= 16 group by c3 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": "bike_1",
"sql": "select t0.lat as c0, t0.dock_count, t0.id as c3, max(t1.bikes_available) from station as t0 join status as t1 on t0.id = t1.station_id where t1.bikes_available < 12 or t1.bikes_available >= 16 group by c3 order by c0 asc nulls last limit 1"
},
"style": "rule"... | {
"index": 2343,
"split": "train"
} | |
Which markets have films produced by studios that include the letter "c" or "a" in their names, and what are their Market IDs, number of cities, and countries? | film_rank | select t0.market_id, t0.number_cities, t0.country from market as t0 join film_market_estimation as t1 on t0.market_id = t1.market_id join film as t2 on t1.film_id = t2.film_id where t2.studio like '%c%' or t2.studio like '%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": "film_rank",
"sql": "select t0.market_id, t0.number_cities, t0.country from market as t0 join film_market_estimation as t1 on t0.market_id = t1.market_id join film as t2 on t1.film_id = t2.film_id where t2.studio like '%c%' or t2.studio like '%a%'"
},
"style": "rule"
} | {
"index": 2985,
"split": "train"
} | |
What are the student ID, major, last name, and hours played for students who have played the video game with game ID 3? | game_1 | select t0.stuid, t0.major, t0.lname, t1.hours_played 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 = 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": "game_1",
"sql": "select t0.stuid, t0.major, t0.lname, t1.hours_played 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 = 3"
},
"style": "rule"
} | {
"index": 1485,
"split": "train"
} | |
What is the percentage change in the highest student ID associated with `'NOISE'` incidents that ended after March 8, 2018, between incidents starting on August 29, 2017, and January 27, 2018? | behavior_monitoring | select (t0.c1 / cast(t1.c1 as real) - 1) * 100 from (select max(t1.student_id) as c1 from ref_incident_type as t0 join behavior_incident as t1 on t0.incident_type_code = t1.incident_type_code where t0.incident_type_code = 'NOISE' and t1.date_incident_start = '2017-08-29 20:48:56' and t1.date_incident_end > '2018-03-08 ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "behavior_monitoring",
"sql": "select (t0.c1 / cast(t1.c1 as real) - 1) * 100 from (select max(t1.student_id) as c1 from ref_incident_type as t0 join behavior_incident as t1 on t0.incident_type_code = t1.incident_type_code where t0.incident_type_code = 'NOISE' and t1.date_incident... | {
"index": 3407,
"split": "train"
} | |
Which region's name and ID, along with the affected region's storm ID and region ID, corresponds to the affected region with the highest region ID among storms that caused fewer than 71 deaths? | storm_record | select t0.region_name, t0.region_id, t1.storm_id, t1.region_id as c1 from region as t0 join affected_region as t1 on t0.region_id = t1.region_id join storm as t2 on t1.storm_id = t2.storm_id where t2.number_deaths < 71 order by c1 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": "storm_record",
"sql": "select t0.region_name, t0.region_id, t1.storm_id, t1.region_id as c1 from region as t0 join affected_region as t1 on t0.region_id = t1.region_id join storm as t2 on t1.storm_id = t2.storm_id where t2.number_deaths < 71 order by c1 desc limit 1"
},
"styl... | {
"index": 1972,
"split": "train"
} | |
Which mountains have both climbers with a mountain ID less than 7 and climbers coming from countries not listed among the mountains' countries? Specifically, what are the names, heights, and countries of such mountains? | climbing | select anon_1.c1, anon_1.c0, anon_1.c2 from (select t0.name as c1, t0.height as c0, t0.country as c2 from mountain as t0 join climber as t1 on t0.mountain_id = t1.mountain_id where t1.mountain_id < 7 intersect select t0.name as c1, t0.height as c0, t0.country as c2 from mountain as t0 join climber as t1 on t0.mountain_... | 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": "climbing",
"sql": "select anon_1.c1, anon_1.c0, anon_1.c2 from (select t0.name as c1, t0.height as c0, t0.country as c2 from mountain as t0 join climber as t1 on t0.mountain_id = t1.mountain_id where t1.mountain_id < 7 intersect select t0.name as c1, t0.height as c0, t0.country a... | {
"index": 1502,
"split": "train"
} | |
How much did the number of unique customers associated with addresses in countries containing "U" change in percentage between March 11, 2018, at 20:11:21 and March 11, 2018, at 20:16:56? | customers_and_products_contacts | select (count(t0.c1) / cast(count(t1.c1) as real) - 1) * 100 from (select count(distinct (t1.customer_id)) as c1 from addresses as t0 join customer_address_history as t1 on t0.address_id = t1.address_id where t1.date_to = '2018-03-11 20:16:56' and t0.country like '%U%' group by t0.address_id) as t0, (select t0.address_... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_and_products_contacts",
"sql": "select (count(t0.c1) / cast(count(t1.c1) as real) - 1) * 100 from (select count(distinct (t1.customer_id)) as c1 from addresses as t0 join customer_address_history as t1 on t0.address_id = t1.address_id where t1.date_to = '2018-03-11 20:1... | {
"index": 3026,
"split": "train"
} | |
Can you tell me the customer contact channel IDs, their active to dates, along with the customer IDs and names for customers who live in Arkansas? | customers_and_addresses | select t0.customer_id, t0.active_to_date, t1.customer_id, t1.customer_name from customer_contact_channels as t0 join customers as t1 on t0.customer_id = t1.customer_id join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.address_id = t3.address_id where t3.state_province_county = ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_and_addresses",
"sql": "select t0.customer_id, t0.active_to_date, t1.customer_id, t1.customer_name from customer_contact_channels as t0 join customers as t1 on t0.customer_id = t1.customer_id join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresse... | {
"index": 1308,
"split": "train"
} | |
When comparing the maximum catalog ID within catalog 1 to the highest catalog ID overall, is 1 less than that maximum catalog ID? | product_catalog | select t2.c2 < t1.c3 from (select max(t1.catalog_id) as c2 from catalogs as t0 join catalog_structure as t1 on t0.catalog_id = t1.catalog_id where t0.catalog_id = 1 group by t0.catalog_id) as t2, (select max(t0.c2) as c3 from (select max(t1.catalog_id) as c2 from catalogs as t0 join catalog_structure as t1 on t0.catalo... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "product_catalog",
"sql": "select t2.c2 < t1.c3 from (select max(t1.catalog_id) as c2 from catalogs as t0 join catalog_structure as t1 on t0.catalog_id = t1.catalog_id where t0.catalog_id = 1 group by t0.catalog_id) as t2, (select max(t0.c2) as c3 from (select max(t1.catalog_id) a... | {
"index": 3319,
"split": "train"
} | |
Which ten locations that Culture Companies are incorporated in have the highest number of entries where the company name ends with "re Services (HK) Limited" or contains the letter "a," when counting the number of distinct book clubs associated with each location? | culture_company | select incorporated_in as c0, count(*) from culture_company where company_name like '%re Services (HK) Limited' or company_name like '%a%' group by c0 order by count(distinct (book_club_id)) desc limit 10 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "culture_company",
"sql": "select incorporated_in as c0, count(*) from culture_company where company_name like '%re Services (HK) Limited' or company_name like '%a%' group by c0 order by count(distinct (book_club_id)) desc limit 10"
},
"style": "rule"
} | {
"index": 2166,
"split": "train"
} | |
Which countries, institution names, and institution IDs belong to institutions that have at least one author with an authorship position of one or higher, but do not include the institution with ID 1020? | icfp_1 | select anon_1.c1, anon_1.c0, anon_1.c2 from (select t0.country as c1, t0.name as c0, t0.instid as c2 from inst as t0 join authorship as t1 on t0.instid = t1.instid where t1.authorder >= 1 except select t0.country as c1, t0.name as c0, t0.instid as c2 from inst as t0 join authorship as t1 on t0.instid = t1.instid where ... | 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 anon_1.c1, anon_1.c0, anon_1.c2 from (select t0.country as c1, t0.name as c0, t0.instid as c2 from inst as t0 join authorship as t1 on t0.instid = t1.instid where t1.authorder >= 1 except select t0.country as c1, t0.name as c0, t0.instid as c2 from inst as... | {
"index": 2788,
"split": "train"
} | |
Which three department numbers and faculty IDs have faculty IDs greater than the average faculty ID, and are the lowest sorted by department number? | college_3 | select t0.dno as c0, t0.facid as c1 from member_of as t0, (select avg(facid) as c2 from member_of) as t0 where c1 > t0.c2 order by c0 asc nulls last limit 3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "college_3",
"sql": "select t0.dno as c0, t0.facid as c1 from member_of as t0, (select avg(facid) as c2 from member_of) as t0 where c1 > t0.c2 order by c0 asc nulls last limit 3"
},
"style": "rule"
} | {
"index": 49,
"split": "train"
} | |
Can you list the location and festival name for each festival, along with the artwork and festival IDs from nominations where the artwork's name starts with "Ma"? | entertainment_awards | select t0.location, t0.festival_name, t1.artwork_id, t1.festival_id from festival_detail as t0 join nomination as t1 on t0.festival_id = t1.festival_id join artwork as t2 on t1.artwork_id = t2.artwork_id where t2.name like 'Ma%' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "entertainment_awards",
"sql": "select t0.location, t0.festival_name, t1.artwork_id, t1.festival_id from festival_detail as t0 join nomination as t1 on t0.festival_id = t1.festival_id join artwork as t2 on t1.artwork_id = t2.artwork_id where t2.name like 'Ma%'"
},
"style": "ru... | {
"index": 1182,
"split": "train"
} | |
Which regions have been both affected in region 2 and impacted by storm number 5, and what are their names and codes? | storm_record | select anon_1.c0, anon_1.c1 from (select t0.region_name as c0, t0.region_code as c1 from region as t0 join affected_region as t1 on t0.region_id = t1.region_id where t1.region_id = 2 intersect select t0.region_name as c0, t0.region_code as c1 from region as t0 join affected_region as t1 on t0.region_id = t1.region_id w... | 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": "storm_record",
"sql": "select anon_1.c0, anon_1.c1 from (select t0.region_name as c0, t0.region_code as c1 from region as t0 join affected_region as t1 on t0.region_id = t1.region_id where t1.region_id = 2 intersect select t0.region_name as c0, t0.region_code as c1 from region as... | {
"index": 280,
"split": "train"
} | |
How much did the total grant ID sum for research application documents change between responses received on December 8, 1979, and May 18, 1986? | tracking_grants_for_research | select t1.c0 - t0.c0 from (select sum(t1.grant_id) as c0 from document_types as t0 join documents as t1 on t0.document_type_code = t1.document_type_code where t0.document_type_code = 'APP' and t1.response_received_date = '1979-12-08 10:38:07' group by t0.document_type_code) as t1, (select t0.document_type_code, sum(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": "tracking_grants_for_research",
"sql": "select t1.c0 - t0.c0 from (select sum(t1.grant_id) as c0 from document_types as t0 join documents as t1 on t0.document_type_code = t1.document_type_code where t0.document_type_code = 'APP' and t1.response_received_date = '1979-12-08 10:38:07... | {
"index": 3526,
"split": "train"
} | |
Which registration IDs have an average student ID of at least 4, and can you list these registration IDs ordered by their average student ID? | e_learning | select registration_id as c0 from student_course_enrolment group by c0 having avg(student_id) >= 4 order by avg(student_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": "e_learning",
"sql": "select registration_id as c0 from student_course_enrolment group by c0 having avg(student_id) >= 4 order by avg(student_id) asc nulls last"
},
"style": "rule"
} | {
"index": 1913,
"split": "train"
} | |
How many log entries are there for each problem where the problem was reported by staff members with IDs greater than 2 or exactly 4? Please include the number of assigned staff involved and the problem's identifier. | tracking_software_problems | select count(t0.assigned_to_staff_id), t1.problem_id as c1 from problem_log as t0 join problems as t1 on t0.problem_id = t1.problem_id where t1.reported_by_staff_id > 2 or t1.reported_by_staff_id = 4 group by c1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_software_problems",
"sql": "select count(t0.assigned_to_staff_id), t1.problem_id as c1 from problem_log as t0 join problems as t1 on t0.problem_id = t1.problem_id where t1.reported_by_staff_id > 2 or t1.reported_by_staff_id = 4 group by c1"
},
"style": "rule"
} | {
"index": 455,
"split": "train"
} | |
When looking at Alice's friendships with people whose names include 'B', what is her rank from most recent to oldest based on when the friendship occurred? | network_2 | select t1.c4, t1.c2 as c5 from (select row_number() over (order by year desc) as c4, name as c2 from personfriend where friend like '%B%') as t1 where c5 = 'Alice' | 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.c4, t1.c2 as c5 from (select row_number() over (order by year desc) as c4, name as c2 from personfriend where friend like '%B%') as t1 where c5 = 'Alice'"
},
"style": "rule"
} | {
"index": 3838,
"split": "train"
} | |
What are the top 5 films, including their directors, titles, and IDs, along with the cinema IDs and number of showtimes per day, for schedules at cinemas located either with 't' in their location or ending with 'y Laois'? The results should be ordered by the number of showtimes per day from highest to lowest. | cinema | select t0.directed_by, t0.title, t0.film_id, t1.cinema_id, t1.show_times_per_day as c0 from film as t0 join schedule as t1 on t0.film_id = t1.film_id join cinema as t2 on t1.cinema_id = t2.cinema_id where t2.location like '%t%' or t2.location like '%y Laois' 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": "cinema",
"sql": "select t0.directed_by, t0.title, t0.film_id, t1.cinema_id, t1.show_times_per_day as c0 from film as t0 join schedule as t1 on t0.film_id = t1.film_id join cinema as t2 on t1.cinema_id = t2.cinema_id where t2.location like '%t%' or t2.location like '%y Laois' orde... | {
"index": 1339,
"split": "train"
} | |
Is the average founding year of institutions in building number 7 later than the number of buildings whose names end with 'mpa City Hall' that have associated institutions? | protein_institute | select t2.c3 > t1.c1 from (select avg(t1.founded) as c3 from building as t0 join institution as t1 on t0.building_id = t1.building_id where t0.building_id = 7 group by t0.building_id) as t2, (select count(t0.c3) as c1 from (select avg(t1.founded) as c3 from building as t0 join institution as t1 on t0.building_id = t1.b... | 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.c3 > t1.c1 from (select avg(t1.founded) as c3 from building as t0 join institution as t1 on t0.building_id = t1.building_id where t0.building_id = 7 group by t0.building_id) as t2, (select count(t0.c3) as c1 from (select avg(t1.founded) as c3... | {
"index": 3279,
"split": "train"
} | |
Find the average target user ID and list each user’s name and user ID for users whose names include "ar. | epinions_1 | select avg(t0.target_u_id), t1.name as c0, t1.u_id as c1 from trust as t0 join useracct as t1 on t0.source_u_id = t1.u_id where c0 like '%ar%' group by c1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "epinions_1",
"sql": "select avg(t0.target_u_id), t1.name as c0, t1.u_id as c1 from trust as t0 join useracct as t1 on t0.source_u_id = t1.u_id where c0 like '%ar%' group by c1"
},
"style": "rule"
} | {
"index": 272,
"split": "train"
} | |
Can you tell me the top three customers with customer IDs up to 11 who have the most customer details recorded? | tracking_orders | select count(t0.customer_id) from customers as t0 join orders as t1 on t0.customer_id = t1.customer_id where t1.customer_id <= 11 order by count(t0.customer_details) 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_orders",
"sql": "select count(t0.customer_id) from customers as t0 join orders as t1 on t0.customer_id = t1.customer_id where t1.customer_id <= 11 order by count(t0.customer_details) desc limit 3"
},
"style": "rule"
} | {
"index": 41,
"split": "train"
} | |
List each journalist's ID along with their minimum years of experience, grouping the results by the journalist's ID. | news_report | select journalist_id as c0, min(years_working) from journalist group by 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": "news_report",
"sql": "select journalist_id as c0, min(years_working) from journalist group by c0"
},
"style": "rule"
} | {
"index": 2458,
"split": "train"
} | |
Does the year associated with book club 6 come after the total number of unique years between 1989 and 1990? | culture_company | select t2.c3 > t1.c0 from (select year as c3 from book_club where book_club_id = 6) as t2, (select count(distinct (year)) as c0 from book_club where year between 1989 and 1990) 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": "culture_company",
"sql": "select t2.c3 > t1.c0 from (select year as c3 from book_club where book_club_id = 6) as t2, (select count(distinct (year)) as c0 from book_club where year between 1989 and 1990) as t1"
},
"style": "rule"
} | {
"index": 3267,
"split": "train"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.