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 height in feet of building 0 minus 458 feet? | protein_institute | select height_feet - 458 from building where building_id = 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": "protein_institute",
"sql": "select height_feet - 458 from building where building_id = 0"
},
"style": "rule"
} | {
"index": 3954,
"split": "train"
} | |
List the top 10 journalists' years of experience, ages, and names who reported on the event with ID 4, sorted in reverse alphabetical order by their names. | news_report | select t0.years_working, t0.age, t0.name as c1 from journalist as t0 join news_report as t1 on t0.journalist_id = t1.journalist_id join event as t2 on t1.event_id = t2.event_id where t2.event_id = 4 order by c1 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": "news_report",
"sql": "select t0.years_working, t0.age, t0.name as c1 from journalist as t0 join news_report as t1 on t0.journalist_id = t1.journalist_id join event as t2 on t1.event_id = t2.event_id where t2.event_id = 4 order by c1 desc limit 10"
},
"style": "rule"
} | {
"index": 2823,
"split": "train"
} | |
Which members participated in the most attended performance, excluding those who took part in performances hosted by the New York Rangers? Please provide their Member Id, Name, and Role. | performance_attendance | select anon_1.c3, anon_1.c2, anon_1.c0 from (select t0.member_id as c3, t0.name as c2, t0.role as c0 from member as t0 join member_attendance as t1 on t0.member_id = t1.member_id join performance as t2 on t1.performance_id = t2.performance_id, (select performance_id as c1 from performance group by c1 order by count(*) ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "performance_attendance",
"sql": "select anon_1.c3, anon_1.c2, anon_1.c0 from (select t0.member_id as c3, t0.name as c2, t0.role as c0 from member as t0 join member_attendance as t1 on t0.member_id = t1.member_id join performance as t2 on t1.performance_id = t2.performance_id, (se... | {
"index": 1273,
"split": "train"
} | |
What is the description of the functional area associated with the document that has the code 349? | document_management | select t0.functional_area_description from functional_areas as t0 join document_functional_areas as t1 on t0.functional_area_code = t1.functional_area_code where t1.document_code = 349 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "document_management",
"sql": "select t0.functional_area_description from functional_areas as t0 join document_functional_areas as t1 on t0.functional_area_code = t1.functional_area_code where t1.document_code = 349"
},
"style": "rule"
} | {
"index": 2273,
"split": "train"
} | |
For each movie title, what is the average release year? | movie_1 | select title as c0, avg(year) from movie 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": "movie_1",
"sql": "select title as c0, avg(year) from movie group by c0"
},
"style": "rule"
} | {
"index": 1343,
"split": "train"
} | |
Which cities have their White, Name, and Hispanic demographic data listed, excluding those cities that are in counties whose names start with "Castl"? | county_public_safety | select anon_1.c1, anon_1.c2, anon_1.c0 from (select white as c1, name as c2, hispanic as c0 from city except select t0.white as c1, t0.name as c2, t0.hispanic as c0 from city as t0 join county_public_safety as t1 on t0.county_id = t1.county_id where t1.name like 'Castl%') 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": "county_public_safety",
"sql": "select anon_1.c1, anon_1.c2, anon_1.c0 from (select white as c1, name as c2, hispanic as c0 from city except select t0.white as c1, t0.name as c2, t0.hispanic as c0 from city as t0 join county_public_safety as t1 on t0.county_id = t1.county_id where... | {
"index": 1488,
"split": "train"
} | |
Which customers have the phone numbers listed for customer IDs 4 and 12? | customer_deliveries | select t0.customer_phone from customers as t0 join customer_addresses as t1 on t0.customer_id = t1.customer_id where t1.customer_id = 4 or t1.customer_id = 12 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customer_deliveries",
"sql": "select t0.customer_phone from customers as t0 join customer_addresses as t1 on t0.customer_id = t1.customer_id where t1.customer_id = 4 or t1.customer_id = 12"
},
"style": "rule"
} | {
"index": 47,
"split": "train"
} | |
Can you list the IDs and services of all stations, including those that are part of routes ending at Kanniyakumari? | station_weather | select anon_1.c0, anon_1.c1 from (select id as c0, services as c1 from station union select t0.id as c0, t0.services as c1 from station as t0 join route as t1 on t0.id = t1.station_id join train as t2 on t1.train_id = t2.id where t2.destination = 'Kanniyakumari') 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": "station_weather",
"sql": "select anon_1.c0, anon_1.c1 from (select id as c0, services as c1 from station union select t0.id as c0, t0.services as c1 from station as t0 join route as t1 on t0.id = t1.station_id join train as t2 on t1.train_id = t2.id where t2.destination = 'Kanniy... | {
"index": 961,
"split": "train"
} | |
How many days are there between the start and end dates of the bookings? | products_for_hire | select julianday(t1.c1) - julianday(t0.c3) from (select booking_end_date as c1 from bookings) as t1, (select booking_start_date as c3 from bookings) 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": "products_for_hire",
"sql": "select julianday(t1.c1) - julianday(t0.c3) from (select booking_end_date as c1 from bookings) as t1, (select booking_start_date as c3 from bookings) as t0"
},
"style": "rule"
} | {
"index": 3735,
"split": "train"
} | |
Which hosts participated in the most common last year’s parties that had exactly 18 hosts? Please provide the host IDs, names, and the IDs of those parties. | party_host | select t0.host_id, t0.name, t1.party_id from host as t0 join party_host as t1 on t0.host_id = t1.host_id join party as t2 on t1.party_id = t2.party_id, (select last_year as c2 from party group by c2 order by count(*) desc limit 1) as t0 where t2.last_year = t0.c2 and t2.number_of_hosts = 18 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "party_host",
"sql": "select t0.host_id, t0.name, t1.party_id from host as t0 join party_host as t1 on t0.host_id = t1.host_id join party as t2 on t1.party_id = t2.party_id, (select last_year as c2 from party group by c2 order by count(*) desc limit 1) as t0 where t2.last_year = t... | {
"index": 898,
"split": "train"
} | |
How many store products are there for the product with ID 6? | store_product | select count(*) from store_product where product_id = 6 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "store_product",
"sql": "select count(*) from store_product where product_id = 6"
},
"style": "rule"
} | {
"index": 1405,
"split": "train"
} | |
Which zip codes are associated with either weather conditions or trip records in the database? | bike_1 | select anon_1.c1 from (select zip_code as c1 from weather union select zip_code from trip) 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": "bike_1",
"sql": "select anon_1.c1 from (select zip_code as c1 from weather union select zip_code from trip) as anon_1"
},
"style": "rule"
} | {
"index": 2217,
"split": "train"
} | |
How many days pass between when a claim is made and when it is settled for claims under 43,708? | insurance_policies | select julianday(t1.c0) - julianday(t0.c3) from (select date_claim_made as c0 from claims) as t1, (select date_claim_settled as c3 from claims where amount_claimed < 43708 and amount_claimed < 43708) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "insurance_policies",
"sql": "select julianday(t1.c0) - julianday(t0.c3) from (select date_claim_made as c0 from claims) as t1, (select date_claim_settled as c3 from claims where amount_claimed < 43708 and amount_claimed < 43708) as t0"
},
"style": "rule"
} | {
"index": 3728,
"split": "train"
} | |
Which artists have a total number of files (F IDs) exceeding the total number of distinct ratings found across all songs, and what are their names along with the sum of their file IDs? | music_1 | select t0.artist_name as c2, sum(t0.f_id) from song as t0, (select count(distinct (rating)) as c1 from song) as t0 where t0.rating > t0.c1 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": "music_1",
"sql": "select t0.artist_name as c2, sum(t0.f_id) from song as t0, (select count(distinct (rating)) as c1 from song) as t0 where t0.rating > t0.c1 group by c2"
},
"style": "rule"
} | {
"index": 2740,
"split": "train"
} | |
Did the invoice for ID 239 have a more recent date than the invoice for ID 321? | store_1 | select t1.c2 > t0.c2 from (select invoice_date as c2 from invoices where id = 239) as t1, (select invoice_date as c2 from invoices where id = 321) 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 t1.c2 > t0.c2 from (select invoice_date as c2 from invoices where id = 239) as t1, (select invoice_date as c2 from invoices where id = 321) as t0"
},
"style": "rule"
} | {
"index": 3099,
"split": "train"
} | |
What is the race ID with the fewest number of associated years, where the total number of years is less than 2000? | formula_1 | select raceid as c0 from races group by c0 having count(year) < 2000 order by count(year) 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": "formula_1",
"sql": "select raceid as c0 from races group by c0 having count(year) < 2000 order by count(year) asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 1107,
"split": "train"
} | |
Among documents with access counts under 8623, where does the document with code 928 rank in terms of how many functional areas it's linked to? | document_management | select t1.c0, t1.c5 as c4 from (select row_number() over (order by t0.c3 desc) as c0, t0.c2 as c5 from (select t0.document_code as c2, count(distinct (t1.document_code)) as c3 from documents as t0 join document_functional_areas as t1 on t0.document_code = t1.document_code where t0.access_count < 8623 group by c2) 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": "document_management",
"sql": "select t1.c0, t1.c5 as c4 from (select row_number() over (order by t0.c3 desc) as c0, t0.c2 as c5 from (select t0.document_code as c2, count(distinct (t1.document_code)) as c3 from documents as t0 join document_functional_areas as t1 on t0.document_c... | {
"index": 3480,
"split": "train"
} | |
Which are the 10 lessons, including their status code, lesson id, and vehicle id, where the assigned staff member joined the driving school either before May 16th, 2016, or after May 1st, 2016? The results should be ordered by vehicle id, with any lessons missing a vehicle id listed last. | driving_school | select t0.lesson_status_code, t0.lesson_id, t0.vehicle_id as c0 from lessons as t0 join staff as t1 on t0.staff_id = t1.staff_id where t1.date_joined_staff > '2016-05-01 02:22:45' or t1.date_joined_staff < '2016-05-16 20:56:53' 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": "driving_school",
"sql": "select t0.lesson_status_code, t0.lesson_id, t0.vehicle_id as c0 from lessons as t0 join staff as t1 on t0.staff_id = t1.staff_id where t1.date_joined_staff > '2016-05-01 02:22:45' or t1.date_joined_staff < '2016-05-16 20:56:53' order by c0 asc nulls last ... | {
"index": 118,
"split": "train"
} | |
What is the percentage change in the number of products that had problems reported on December 18, 1976, and whose issues were closed by staff with IDs between 1 and 6, compared to the number of products with problems reported on May 14, 1995, with closure authorized by the same staff IDs? | tracking_software_problems | select (count(distinct (t0.c0)) / cast(count(distinct (t1.c0)) as real) - 1) * 100 from (select max(t1.product_id) as c0 from product as t0 join problems as t1 on t0.product_id = t1.product_id where t1.date_problem_reported = '1976-12-18 23:54:41' and t1.closure_authorised_by_staff_id between 1 and 6 group by t0.produc... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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(distinct (t0.c0)) / cast(count(distinct (t1.c0)) as real) - 1) * 100 from (select max(t1.product_id) as c0 from product as t0 join problems as t1 on t0.product_id = t1.product_id where t1.date_problem_reported = '1976-12-18 23:54... | {
"index": 3061,
"split": "train"
} | |
How many parties are there with the ID of 4? | party_host | select count(*) from party where party_id = 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": "party_host",
"sql": "select count(*) from party where party_id = 4"
},
"style": "rule"
} | {
"index": 479,
"split": "train"
} | |
Which events took place in specific years, at certain stadiums, and have both records with IDs between 6 and 13 and results starting with "NC"? | swimming | select anon_1.c1, anon_1.c2, anon_1.c0 from (select t0.year as c1, t0.stadium_id as c2, t0.id as c0 from event as t0 join record as t1 on t0.id = t1.event_id where t1.id between 6 and 13 intersect select t0.year as c1, t0.stadium_id as c2, t0.id as c0 from event as t0 join record as t1 on t0.id = t1.event_id where t1.r... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "swimming",
"sql": "select anon_1.c1, anon_1.c2, anon_1.c0 from (select t0.year as c1, t0.stadium_id as c2, t0.id as c0 from event as t0 join record as t1 on t0.id = t1.event_id where t1.id between 6 and 13 intersect select t0.year as c1, t0.stadium_id as c2, t0.id as c0 from even... | {
"index": 679,
"split": "train"
} | |
Which ten course authors or tutors have authored or tutored courses whose names include "Japanese," and what are their family names and login names? List them starting from the course with the name that comes last alphabetically. | e_learning | select t0.family_name, t0.login_name from course_authors_and_tutors as t0 join courses as t1 on t0.author_id = t1.author_id where t1.course_name like '%Japanese%' order by t1.course_name desc limit 10 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "e_learning",
"sql": "select t0.family_name, t0.login_name from course_authors_and_tutors as t0 join courses as t1 on t0.author_id = t1.author_id where t1.course_name like '%Japanese%' order by t1.course_name desc limit 10"
},
"style": "rule"
} | {
"index": 2055,
"split": "train"
} | |
Looking at addresses, what are the latest five address IDs, along with their state, province, or county, country, and the names of customers who have placed orders with a status code containing "e" and have customer IDs of 2 or less? | customers_and_products_contacts | select t0.address_id as c3, t0.state_province_county, t0.country, t2.customer_name from addresses as t0 join customer_address_history as t1 on t0.address_id = t1.address_id join customers as t2 on t1.customer_id = t2.customer_id join customer_orders as t3 on t2.customer_id = t3.customer_id where t3.order_status_code li... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_and_products_contacts",
"sql": "select t0.address_id as c3, t0.state_province_county, t0.country, t2.customer_name from addresses as t0 join customer_address_history as t1 on t0.address_id = t1.address_id join customers as t2 on t1.customer_id = t2.customer_id join cust... | {
"index": 1380,
"split": "train"
} | |
List the aircraft IDs, models, and fleet series for all aircraft, including those associated with the pilot named Dan O'Sullivan. | pilot_record | select anon_1.c2, anon_1.c0, anon_1.c1 from (select aircraft_id as c2, model as c0, fleet_series as c1 from aircraft union select t0.aircraft_id as c2, t0.model as c0, t0.fleet_series as c1 from aircraft as t0 join pilot_record as t1 on t0.aircraft_id = t1.aircraft_id join pilot as t2 on t1.pilot_id = t2.pilot_id 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": "pilot_record",
"sql": "select anon_1.c2, anon_1.c0, anon_1.c1 from (select aircraft_id as c2, model as c0, fleet_series as c1 from aircraft union select t0.aircraft_id as c2, t0.model as c0, t0.fleet_series as c1 from aircraft as t0 join pilot_record as t1 on t0.aircraft_id = t1.... | {
"index": 2472,
"split": "train"
} | |
How does the total year of founding for institutions in building 3 compare to that in building 4? | protein_institute | select t1.c1 - t0.c1 from (select sum(t1.founded) as c1 from building as t0 join institution as t1 on t0.building_id = t1.building_id where t0.building_id = 4 group by t0.building_id) as t1, (select t0.building_id, sum(t1.founded) as c1 from building as t0 join institution as t1 on t0.building_id = t1.building_id 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": "protein_institute",
"sql": "select t1.c1 - t0.c1 from (select sum(t1.founded) as c1 from building as t0 join institution as t1 on t0.building_id = t1.building_id where t0.building_id = 4 group by t0.building_id) as t1, (select t0.building_id, sum(t1.founded) as c1 from building a... | {
"index": 3620,
"split": "train"
} | |
Can you show me all the balances from both the checking and savings accounts? | small_bank_1 | select anon_1.c1 from (select balance as c1 from checking union select balance from savings) 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": "small_bank_1",
"sql": "select anon_1.c1 from (select balance as c1 from checking union select balance from savings) as anon_1"
},
"style": "rule"
} | {
"index": 2804,
"split": "train"
} | |
How many days are there between an employee's hire date and their date of birth? | college_1 | select julianday(t1.c2) - julianday(t0.c0) from (select emp_hiredate as c2 from employee) as t1, (select emp_dob as c0 from employee) 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": "college_1",
"sql": "select julianday(t1.c2) - julianday(t0.c0) from (select emp_hiredate as c2 from employee) as t1, (select emp_dob as c0 from employee) as t0"
},
"style": "rule"
} | {
"index": 3677,
"split": "train"
} | |
? | student_assessment | select t0.last_name from people as t0 join candidates as t1 on t0.person_id = t1.candidate_id where t1.candidate_id = 181 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "student_assessment",
"sql": "select t0.last_name from people as t0 join candidates as t1 on t0.person_id = t1.candidate_id where t1.candidate_id = 181"
},
"style": "rule"
} | {
"index": 1364,
"split": "train"
} | |
Which People IDs and Names belong to individuals who have multiple employment records with company ID 13? | company_employee | select anon_1.c0, anon_1.c1 from (select t0.people_id as c0, t0.name as c1 from people as t0 join employment as t1 on t0.people_id = t1.people_id where t1.company_id = 13 intersect select t0.people_id as c0, t0.name as c1 from people as t0 join employment as t1 on t0.people_id = t1.people_id where t1.company_id = 13) 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": "company_employee",
"sql": "select anon_1.c0, anon_1.c1 from (select t0.people_id as c0, t0.name as c1 from people as t0 join employment as t1 on t0.people_id = t1.people_id where t1.company_id = 13 intersect select t0.people_id as c0, t0.name as c1 from people as t0 join employme... | {
"index": 2617,
"split": "train"
} | |
What was the highest attendance recorded in the exhibition records? | theme_gallery | select attendance as c0 from exhibition_record 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": "theme_gallery",
"sql": "select attendance as c0 from exhibition_record order by c0 desc limit 1"
},
"style": "rule"
} | {
"index": 2244,
"split": "train"
} | |
How many regions have a region ID other than 9? | storm_record | select count(*) from region where region_id != 9 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "storm_record",
"sql": "select count(*) from region where region_id != 9"
},
"style": "rule"
} | {
"index": 460,
"split": "train"
} | |
What are the IDs of the top 5 projects with the highest outcome codes, listed from the highest to the lowest? | tracking_grants_for_research | select project_id from project_outcomes order by outcome_code desc limit 5 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_grants_for_research",
"sql": "select project_id from project_outcomes order by outcome_code desc limit 5"
},
"style": "rule"
} | {
"index": 2655,
"split": "train"
} | |
What is the numerical difference between the highest customer ID associated with party 13 and the highest customer ID associated with party 5? | e_government | select t1.c0 - t0.c0 from (select max(t1.customer_id) as c0 from parties as t0 join party_services as t1 on t0.party_id = t1.customer_id where t0.party_id = 5 group by t0.party_id) as t1, (select t0.party_id, max(t1.customer_id) as c0 from parties as t0 join party_services as t1 on t0.party_id = t1.customer_id where 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": "e_government",
"sql": "select t1.c0 - t0.c0 from (select max(t1.customer_id) as c0 from parties as t0 join party_services as t1 on t0.party_id = t1.customer_id where t0.party_id = 5 group by t0.party_id) as t1, (select t0.party_id, max(t1.customer_id) as c0 from parties as t0 joi... | {
"index": 3605,
"split": "train"
} | |
Which products have both issues reported by staff member #2 and problems reported between May 20, 1970, and November 13, 1986? Please provide their product IDs and names. | tracking_software_problems | select anon_1.c0, anon_1.c1 from (select t0.product_id as c0, t0.product_name as c1 from product as t0 join problems as t1 on t0.product_id = t1.product_id where t1.reported_by_staff_id = 2 intersect select t0.product_id as c0, t0.product_name as c1 from product as t0 join problems as t1 on t0.product_id = t1.product_i... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_software_problems",
"sql": "select anon_1.c0, anon_1.c1 from (select t0.product_id as c0, t0.product_name as c1 from product as t0 join problems as t1 on t0.product_id = t1.product_id where t1.reported_by_staff_id = 2 intersect select t0.product_id as c0, t0.product_name... | {
"index": 1932,
"split": "train"
} | |
On what date did the employee with the email RLADWIG have their highest commission percentage? | hr_1 | select t0.hire_date, t0.commission_pct as c2 from employees as t0, (select max(commission_pct) as c0 from employees where email = 'RLADWIG') as t1 where c2 = t1.c0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "hr_1",
"sql": "select t0.hire_date, t0.commission_pct as c2 from employees as t0, (select max(commission_pct) as c0 from employees where email = 'RLADWIG') as t1 where c2 = t1.c0"
},
"style": "rule"
} | {
"index": 3779,
"split": "train"
} | |
How many days passed between the Date From and Date To for customer with ID 12 in their address history? | customers_and_products_contacts | select julianday(t1.c2) - julianday(t0.c0) from (select date_to as c2 from customer_address_history) as t1, (select date_from as c0 from customer_address_history where customer_id = 12 and customer_id = 12) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_and_products_contacts",
"sql": "select julianday(t1.c2) - julianday(t0.c0) from (select date_to as c2 from customer_address_history) as t1, (select date_from as c0 from customer_address_history where customer_id = 12 and customer_id = 12) as t0"
},
"style": "rule"
} | {
"index": 3693,
"split": "train"
} | |
What is the highest unit price among all tracks? | chinook_1 | select unitprice as c0 from track 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": "chinook_1",
"sql": "select unitprice as c0 from track order by c0 desc limit 1"
},
"style": "rule"
} | {
"index": 127,
"split": "train"
} | |
Which city IDs and city names are located in countries whose names end with "laysia"? | sakila_1 | select t0.country_id, t0.city_id, t0.city from city as t0 join country as t1 on t0.country_id = t1.country_id where t1.country like '%laysia' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "sakila_1",
"sql": "select t0.country_id, t0.city_id, t0.city from city as t0 join country as t1 on t0.country_id = t1.country_id where t1.country like '%laysia'"
},
"style": "rule"
} | {
"index": 155,
"split": "train"
} | |
Which three countries, X values, and cities are associated with routes having rid 57707, listed in reverse alphabetical order by city? | flight_4 | select t0.country, t0.x, t0.city as c2 from airports as t0 join routes as t1 on t0.apid = t1.src_apid where t1.rid = 57707 order by c2 desc limit 3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "flight_4",
"sql": "select t0.country, t0.x, t0.city as c2 from airports as t0 join routes as t1 on t0.apid = t1.src_apid where t1.rid = 57707 order by c2 desc limit 3"
},
"style": "rule"
} | {
"index": 2955,
"split": "train"
} | |
What are the names of the first 3 products with order items that have a status containing "inish" or ending with "ancel," sorted by their order item ID? | tracking_orders | select t0.product_name from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.order_item_status like '%inish%' or t1.order_item_status like '%ancel' order by t1.order_item_id 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": "tracking_orders",
"sql": "select t0.product_name from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.order_item_status like '%inish%' or t1.order_item_status like '%ancel' order by t1.order_item_id asc nulls last limit 3"
},
"style": "rule"
} | {
"index": 501,
"split": "train"
} | |
Which three countries, where incidents involved at least the average number of injured people and the location includes the letter "g," have the lowest numbers of injured victims, listed in order from fewest to most injured? | perpetrator | select t0.country from perpetrator as t0, (select avg(injured) as c0 from perpetrator) as t0 where t0.injured >= t0.c0 and t0.location like '%g%' order by t0.injured 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": "perpetrator",
"sql": "select t0.country from perpetrator as t0, (select avg(injured) as c0 from perpetrator) as t0 where t0.injured >= t0.c0 and t0.location like '%g%' order by t0.injured asc nulls last limit 3"
},
"style": "rule"
} | {
"index": 1647,
"split": "train"
} | |
Which station(s) with a latitude of at least 37.794139 have the highest total number of bikes available across all their status records? | bike_1 | select t0.id as c0 from station as t0 join status as t1 on t0.id = t1.station_id where t0.lat >= 37.794139 group by c0 order by sum(t1.bikes_available) 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": "bike_1",
"sql": "select t0.id as c0 from station as t0 join status as t1 on t0.id = t1.station_id where t0.lat >= 37.794139 group by c0 order by sum(t1.bikes_available) desc limit 1"
},
"style": "rule"
} | {
"index": 1561,
"split": "train"
} | |
Which universities have a basketball record of 28–6, but do not have a team whose name ends with "ina"? And what are their locations and affiliations? | university_basketball | select anon_1.c0, anon_1.c2, anon_1.c1 from (select t0.school as c0, t0.location as c2, t0.affiliation as c1 from university as t0 join basketball_match as t1 on t0.school_id = t1.school_id where t1.all_games = '28–6' except select t0.school as c0, t0.location as c2, t0.affiliation as c1 from university as t0 join bask... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "university_basketball",
"sql": "select anon_1.c0, anon_1.c2, anon_1.c1 from (select t0.school as c0, t0.location as c2, t0.affiliation as c1 from university as t0 join basketball_match as t1 on t0.school_id = t1.school_id where t1.all_games = '28–6' except select t0.school as c0,... | {
"index": 1158,
"split": "train"
} | |
Find the tweet text posted fewer than three times that has the lowest number of total tweets. For that tweet text, what is the count of distinct tweet IDs and the total number of tweets? | twitter_1 | select text as c2, count(distinct (id)), count(*) as c1 from tweets group by c2 having c1 < 3 order by c1 asc nulls last limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "twitter_1",
"sql": "select text as c2, count(distinct (id)), count(*) as c1 from tweets group by c2 having c1 < 3 order by c1 asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 483,
"split": "train"
} | |
Show the address, description, full name, ID, and manager of buildings where there is at least one guest with a gender starting with "Fe" who has booked an apartment in those buildings. | apartment_rentals | select anon_1.c4, anon_1.c2, anon_1.c1, anon_1.c3, anon_1.c0 from (select building_address as c4, building_description as c2, building_full_name as c1, building_id as c3, building_manager as c0 from apartment_buildings intersect select t0.building_address as c4, t0.building_description as c2, t0.building_full_name as c... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "apartment_rentals",
"sql": "select anon_1.c4, anon_1.c2, anon_1.c1, anon_1.c3, anon_1.c0 from (select building_address as c4, building_description as c2, building_full_name as c1, building_id as c3, building_manager as c0 from apartment_buildings intersect select t0.building_addr... | {
"index": 1040,
"split": "train"
} | |
Can you list the carriers and software platforms of devices available at shop 8 or at the shop with the highest stock count, sorted alphabetically by carrier? Please include the shop IDs where these devices are available. | device | select t0.carrier as c1, t0.software_platform, t1.shop_id from device as t0 join stock as t1 on t0.device_id = t1.device_id join shop as t2 on t1.shop_id = t2.shop_id, (select shop_id as c2 from shop group by c2 order by count(*) desc limit 1) as t0 where t2.shop_id = 8 or t2.shop_id = t0.c2 order by c1 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": "device",
"sql": "select t0.carrier as c1, t0.software_platform, t1.shop_id from device as t0 join stock as t1 on t0.device_id = t1.device_id join shop as t2 on t1.shop_id = t2.shop_id, (select shop_id as c2 from shop group by c2 order by count(*) desc limit 1) as t0 where t2.shop... | {
"index": 1573,
"split": "train"
} | |
What are the calendar date, day number, when each document was moved out of its location, and the document ID for locations with codes ending in "b"? | cre_Doc_Tracking_DB | select t0.calendar_date, t0.day_number, t1.date_in_locaton_to, t1.document_id from ref_calendar as t0 join document_locations as t1 on t0.calendar_date = t1.date_in_locaton_to join ref_locations as t2 on t1.location_code = t2.location_code where t2.location_code like '%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": "cre_Doc_Tracking_DB",
"sql": "select t0.calendar_date, t0.day_number, t1.date_in_locaton_to, t1.document_id from ref_calendar as t0 join document_locations as t1 on t0.calendar_date = t1.date_in_locaton_to join ref_locations as t2 on t1.location_code = t2.location_code where t2.l... | {
"index": 1938,
"split": "train"
} | |
Show the top 10 customer IDs and their response outcome codes from mailshot responses, where the customer has placed an order with a shipping method ending with "fied", sorted alphabetically by outcome code. | customers_campaigns_ecommerce | select t0.customer_id, t0.outcome_code as c1 from mailshot_customers as t0 join customers as t1 on t0.customer_id = t1.customer_id join customer_orders as t2 on t1.customer_id = t2.customer_id where t2.shipping_method_code like '%fied' order by c1 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": "customers_campaigns_ecommerce",
"sql": "select t0.customer_id, t0.outcome_code as c1 from mailshot_customers as t0 join customers as t1 on t0.customer_id = t1.customer_id join customer_orders as t2 on t1.customer_id = t2.customer_id where t2.shipping_method_code like '%fied' orde... | {
"index": 948,
"split": "train"
} | |
What is the user ID of the person who posted the tweet with ID 6? | twitter_1 | select uid from tweets where id = 6 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "twitter_1",
"sql": "select uid from tweets where id = 6"
},
"style": "rule"
} | {
"index": 3406,
"split": "train"
} | |
How many student enrollments have a recorded date of enrolment? | e_learning | select count(date_of_enrolment) from student_course_enrolment | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "e_learning",
"sql": "select count(date_of_enrolment) from student_course_enrolment"
},
"style": "rule"
} | {
"index": 2457,
"split": "train"
} | |
Which document types, with more than one document associated and a status code containing "e", can you tell me their description and code? | cre_Doc_Control_Systems | select t0.document_type_description, t0.document_type_code as c0 from ref_document_types as t0 join documents as t1 on t0.document_type_code = t1.document_type_code where t1.document_status_code like '%e%' group by c0 having count(*) > 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": "cre_Doc_Control_Systems",
"sql": "select t0.document_type_description, t0.document_type_code as c0 from ref_document_types as t0 join documents as t1 on t0.document_type_code = t1.document_type_code where t1.document_status_code like '%e%' group by c0 having count(*) > 1"
},
... | {
"index": 269,
"split": "train"
} | |
Which bridges have been designed by architects who built mills of the most common type or the type with the earliest overall build years, and what are their IDs and names? The results should be listed in alphabetical order by bridge name. | architecture | select t0.id, t0.name as c2 from bridge as t0 join architect as t1 on t0.architect_id = t1.id join mill as t2 on t1.id = t2.architect_id, (select type as c1 from mill group by c1 order by count(*) desc limit 1) as t1, (select type as c1 from mill group by c1 order by sum(built_year) asc nulls last limit 1) as t0 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": "architecture",
"sql": "select t0.id, t0.name as c2 from bridge as t0 join architect as t1 on t0.architect_id = t1.id join mill as t2 on t1.id = t2.architect_id, (select type as c1 from mill group by c1 order by count(*) desc limit 1) as t1, (select type as c1 from mill group by c... | {
"index": 1301,
"split": "train"
} | |
Looking at the Drama Workshop Groups, which store's email address, address ID, and phone number, along with the product name and workshop group ID, are associated with services that have a service type code starting with "1" or exactly equal to 1? Among these, which is the last one alphabetically by store email address... | cre_Drama_Workshop_Groups | select t0.store_email_address as c0, t0.address_id, t0.store_phone, t1.product_name, t1.workshop_group_id from drama_workshop_groups as t0 join services as t1 on t0.workshop_group_id = t1.workshop_group_id join ref_service_types as t2 on t1.service_type_code = t2.service_type_code where t2.service_type_code like '1%' o... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "cre_Drama_Workshop_Groups",
"sql": "select t0.store_email_address as c0, t0.address_id, t0.store_phone, t1.product_name, t1.workshop_group_id from drama_workshop_groups as t0 join services as t1 on t0.workshop_group_id = t1.workshop_group_id join ref_service_types as t2 on t1.ser... | {
"index": 2219,
"split": "train"
} | |
Which catalog levels and their product stock numbers have a next entry ID that is at least as large as the highest next entry ID in the catalog contents? | product_catalog | select t0.catalog_level_number, t0.catalog_level_name, t1.product_stock_number from catalog_structure as t0 join catalog_contents as t1 on t0.catalog_level_number = t1.catalog_level_number, (select max(next_entry_id) as c3 from catalog_contents) as t0 where t1.next_entry_id >= t0.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": "product_catalog",
"sql": "select t0.catalog_level_number, t0.catalog_level_name, t1.product_stock_number from catalog_structure as t0 join catalog_contents as t1 on t0.catalog_level_number = t1.catalog_level_number, (select max(next_entry_id) as c3 from catalog_contents) as t0 wh... | {
"index": 1710,
"split": "train"
} | |
What are the first five school IDs, donator names, and endowment amounts from endowment records for schools with budgets in 2000 or 2001, ordered by school ID, with any missing school IDs listed last? | school_finance | select t0.school_id as c1, t0.donator_name, t0.amount from endowment as t0 join school as t1 on t0.school_id = t1.school_id join budget as t2 on t1.school_id = t2.school_id where t2.year = 2001 or t2.year = 2000 order by c1 asc nulls last limit 5 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "school_finance",
"sql": "select t0.school_id as c1, t0.donator_name, t0.amount from endowment as t0 join school as t1 on t0.school_id = t1.school_id join budget as t2 on t1.school_id = t2.school_id where t2.year = 2001 or t2.year = 2000 order by c1 asc nulls last limit 5"
},
... | {
"index": 1081,
"split": "train"
} | |
Who are the first five players listed when sorting all players alphabetically, placing any with missing names at the end? | match_season | select player as c0 from player 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": "match_season",
"sql": "select player as c0 from player order by c0 asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 1706,
"split": "train"
} | |
What are the last names, advisors, city codes, and student IDs of students who have an allergy containing "hovies," and what allergy do they have? Also, ensure that the allergy type is the most common among allergies with "hovies" in their name. | allergy_1 | select t0.lname, t0.advisor, t0.city_code, t1.allergy, t1.stuid from student as t0 join has_allergy as t1 on t0.stuid = t1.stuid join allergy_type as t2 on t1.allergy = t2.allergy, (select allergytype as c0 from allergy_type group by c0 order by count(*) desc limit 1) as t0 where t2.allergy like '%hovies%' and t2.aller... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "allergy_1",
"sql": "select t0.lname, t0.advisor, t0.city_code, t1.allergy, t1.stuid from student as t0 join has_allergy as t1 on t0.stuid = t1.stuid join allergy_type as t2 on t1.allergy = t2.allergy, (select allergytype as c0 from allergy_type group by c0 order by count(*) desc ... | {
"index": 105,
"split": "train"
} | |
What is the difference between the total sum of subject IDs linked to courses for subject 2 and subject 1? | e_learning | select t1.c2 - t0.c2 from (select sum(t1.subject_id) as c2 from subjects as t0 join courses as t1 on t0.subject_id = t1.subject_id where t0.subject_id = 1 group by t0.subject_id) as t1, (select t0.subject_id, sum(t1.subject_id) as c2 from subjects as t0 join courses as t1 on t0.subject_id = t1.subject_id where t0.subje... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 t1.c2 - t0.c2 from (select sum(t1.subject_id) as c2 from subjects as t0 join courses as t1 on t0.subject_id = t1.subject_id where t0.subject_id = 1 group by t0.subject_id) as t1, (select t0.subject_id, sum(t1.subject_id) as c2 from subjects as t0 join ... | {
"index": 3606,
"split": "train"
} | |
What is the percentage difference in the number of circuits that had their earliest race at 20:00:00 compared to those that had their earliest race at 16:00:00? | formula_1 | select (count(t0.c0) / cast(count(t1.c0) as real) - 1) * 100 from (select min(t1.circuitid) as c0 from circuits as t0 join races as t1 on t0.circuitid = t1.circuitid where t1.time = '20:00:00' group by t0.circuitid) as t0, (select t0.circuitid, min(t1.circuitid) as c0 from circuits as t0 join races as t1 on t0.circuiti... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "formula_1",
"sql": "select (count(t0.c0) / cast(count(t1.c0) as real) - 1) * 100 from (select min(t1.circuitid) as c0 from circuits as t0 join races as t1 on t0.circuitid = t1.circuitid where t1.time = '20:00:00' group by t0.circuitid) as t0, (select t0.circuitid, min(t1.circuiti... | {
"index": 3948,
"split": "train"
} | |
Can you list the names and IDs of media types that are linked to tracks with genre IDs of 9 or less, or up to 11, arranged by the number of associated tracks from most to least? | store_1 | select t0.name, t0.id as c1 from media_types as t0 join tracks as t1 on t0.id = t1.media_type_id where t1.genre_id <= 9 or t1.genre_id <= 11 group by c1 order by count(*) asc nulls last | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "store_1",
"sql": "select t0.name, t0.id as c1 from media_types as t0 join tracks as t1 on t0.id = t1.media_type_id where t1.genre_id <= 9 or t1.genre_id <= 11 group by c1 order by count(*) asc nulls last"
},
"style": "rule"
} | {
"index": 2304,
"split": "train"
} | |
What are the activity IDs, student IDs, and activity names for students participating in activities that are associated with faculty members whose activity IDs are less than 770 or exactly 777? | activity_1 | select t0.actid, t0.stuid, t1.activity_name from participates_in as t0 join activity as t1 on t0.actid = t1.actid join faculty_participates_in as t2 on t1.actid = t2.actid where t2.actid < 770 or t2.actid = 777 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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.stuid, t1.activity_name from participates_in as t0 join activity as t1 on t0.actid = t1.actid join faculty_participates_in as t2 on t1.actid = t2.actid where t2.actid < 770 or t2.actid = 777"
},
"style": "rule"
} | {
"index": 582,
"split": "train"
} | |
What are the account names and additional account details for transactions with amounts up to 1298.73 and transaction types that contain "nd," sorted alphabetically by transaction type, showing only the first 10 records? | customers_card_transactions | select t0.account_name, t0.other_account_details from accounts as t0 join financial_transactions as t1 on t0.account_id = t1.account_id where t1.transaction_amount <= 1298.73 and t1.transaction_type like '%nd%' order by t1.transaction_type 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": "customers_card_transactions",
"sql": "select t0.account_name, t0.other_account_details from accounts as t0 join financial_transactions as t1 on t0.account_id = t1.account_id where t1.transaction_amount <= 1298.73 and t1.transaction_type like '%nd%' order by t1.transaction_type as... | {
"index": 1889,
"split": "train"
} | |
Which are the five aircrafts with the highest aid numbers that are certified to employees whose names include "d" and who earn more than 153,972, and what are their aid, names, and distances? | flight_1 | select t0.aid as c1, t0.name, t0.distance from aircraft as t0 join certificate as t1 on t0.aid = t1.aid join employee as t2 on t1.eid = t2.eid where t2.name like '%d%' and t2.salary > 153972 order by c1 asc nulls last limit 5 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "flight_1",
"sql": "select t0.aid as c1, t0.name, t0.distance from aircraft as t0 join certificate as t1 on t0.aid = t1.aid join employee as t2 on t1.eid = t2.eid where t2.name like '%d%' and t2.salary > 153972 order by c1 asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 2052,
"split": "train"
} | |
Which addresses and corresponding person IDs are associated with individuals whose first names start with "Hoyt" or end with the letter "h"? | student_assessment | select t0.address_id, t0.person_id from people_addresses as t0 join people as t1 on t0.person_id = t1.person_id where t1.first_name like 'Hoyt%' or t1.first_name like '%h' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "student_assessment",
"sql": "select t0.address_id, t0.person_id from people_addresses as t0 join people as t1 on t0.person_id = t1.person_id where t1.first_name like 'Hoyt%' or t1.first_name like '%h'"
},
"style": "rule"
} | {
"index": 1656,
"split": "train"
} | |
What are the product IDs and prices of the first three products, supplied by supplier 4, that have a total purchase value of 36,274.56, sorted by product ID? | department_store | select t0.product_id as c1, t0.product_price from products as t0 join product_suppliers as t1 on t0.product_id = t1.product_id where t1.total_value_purchased = 36274.56 and t1.supplier_id = 4 order by c1 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": "department_store",
"sql": "select t0.product_id as c1, t0.product_price from products as t0 join product_suppliers as t1 on t0.product_id = t1.product_id where t1.total_value_purchased = 36274.56 and t1.supplier_id = 4 order by c1 asc nulls last limit 3"
},
"style": "rule"
} | {
"index": 1598,
"split": "train"
} | |
What are the details of the first five students, including their city code, student ID, age, and the allergies they have that belong to allergy types ending with "imal"? Please sort the results by city code in order, with any missing city codes listed last. | allergy_1 | select t0.city_code as c0, t0.stuid, t0.age, t1.allergy, t1.stuid from student as t0 join has_allergy as t1 on t0.stuid = t1.stuid join allergy_type as t2 on t1.allergy = t2.allergy where t2.allergytype like '%imal' 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": "allergy_1",
"sql": "select t0.city_code as c0, t0.stuid, t0.age, t1.allergy, t1.stuid from student as t0 join has_allergy as t1 on t0.stuid = t1.stuid join allergy_type as t2 on t1.allergy = t2.allergy where t2.allergytype like '%imal' order by c0 asc nulls last limit 5"
},
"... | {
"index": 2593,
"split": "train"
} | |
What are the Film ID, Inventory ID, and Store ID of inventory items that are linked to the film with ID 690? | sakila_1 | select anon_1.c0, anon_1.c2, anon_1.c1 from (select film_id as c0, inventory_id as c2, store_id as c1 from inventory intersect select t0.film_id as c0, t0.inventory_id as c2, t0.store_id as c1 from inventory as t0 join film as t1 on t0.film_id = t1.film_id join film_actor as t2 on t1.film_id = t2.film_id where t2.film_... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "sakila_1",
"sql": "select anon_1.c0, anon_1.c2, anon_1.c1 from (select film_id as c0, inventory_id as c2, store_id as c1 from inventory intersect select t0.film_id as c0, t0.inventory_id as c2, t0.store_id as c1 from inventory as t0 join film as t1 on t0.film_id = t1.film_id join... | {
"index": 1438,
"split": "train"
} | |
What is the source airport id for the route with id 31711? | flight_4 | select src_apid from routes where rid = 31711 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 src_apid from routes where rid = 31711"
},
"style": "rule"
} | {
"index": 3381,
"split": "train"
} | |
On what date did the customer with the highest customer ID among those who had a delivery-related order place an order? | customers_and_addresses | select t0.order_date, t0.customer_id as c2 from customer_orders as t0, (select max(customer_id) as c3 from customer_orders where order_status like 'Del%') as t1 where c2 = t1.c3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_and_addresses",
"sql": "select t0.order_date, t0.customer_id as c2 from customer_orders as t0, (select max(customer_id) as c3 from customer_orders where order_status like 'Del%') as t1 where c2 = t1.c3"
},
"style": "rule"
} | {
"index": 3921,
"split": "train"
} | |
Does the smallest order ID for customer 14 come before the smallest order ID for customer 7? | customers_campaigns_ecommerce | select t1.c1 < t0.c1 from (select min(t1.customer_id) as c1 from customers as t0 join customer_orders as t1 on t0.customer_id = t1.customer_id where t0.customer_id = 7 group by t0.customer_id) as t1, (select t0.customer_id, min(t1.customer_id) as c1 from customers as t0 join customer_orders as t1 on t0.customer_id = 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": "customers_campaigns_ecommerce",
"sql": "select t1.c1 < t0.c1 from (select min(t1.customer_id) as c1 from customers as t0 join customer_orders as t1 on t0.customer_id = t1.customer_id where t0.customer_id = 7 group by t0.customer_id) as t1, (select t0.customer_id, min(t1.customer_... | {
"index": 3564,
"split": "train"
} | |
Can you tell me the number of related entries, the date of the latest revision, and the catalog ID for catalogs published on or after July 22, 2011, 04:57:19, sorted by the number of entries? | product_catalog | select count(*) as c1, t0.date_of_latest_revision, t0.catalog_id as c2 from catalogs as t0 join catalog_structure as t1 on t0.catalog_id = t1.catalog_id where t0.date_of_publication >= '2011-07-22 04:57:19' group by c2 order by c1 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": "product_catalog",
"sql": "select count(*) as c1, t0.date_of_latest_revision, t0.catalog_id as c2 from catalogs as t0 join catalog_structure as t1 on t0.catalog_id = t1.catalog_id where t0.date_of_publication >= '2011-07-22 04:57:19' group by c2 order by c1 asc nulls last"
},
... | {
"index": 1422,
"split": "train"
} | |
When was the largest transaction amount made by investors with an ID greater than 17? | tracking_share_transactions | select t0.date_of_transaction, t0.amount_of_transaction as c0 from transactions as t0, (select max(amount_of_transaction) as c3 from transactions where investor_id > 17) as t1 where c0 = t1.c3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_share_transactions",
"sql": "select t0.date_of_transaction, t0.amount_of_transaction as c0 from transactions as t0, (select max(amount_of_transaction) as c3 from transactions where investor_id > 17) as t1 where c0 = t1.c3"
},
"style": "rule"
} | {
"index": 3997,
"split": "train"
} | |
Did order 5 occur after order 1? | department_store | select t1.c0 > t0.c0 from (select order_date as c0 from customer_orders where order_id = 5) as t1, (select order_date as c0 from customer_orders where order_id = 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": "department_store",
"sql": "select t1.c0 > t0.c0 from (select order_date as c0 from customer_orders where order_id = 5) as t1, (select order_date as c0 from customer_orders where order_id = 1) as t0"
},
"style": "rule"
} | {
"index": 3083,
"split": "train"
} | |
What are the smallest and largest Sales in billions for companies headquartered in locations ending with "SA"? | company_office | select min(sales_billion), max(sales_billion) from companies where headquarters like '%SA' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 min(sales_billion), max(sales_billion) from companies where headquarters like '%SA'"
},
"style": "rule"
} | {
"index": 3637,
"split": "train"
} | |
How many days passed between the date an asset was acquired (specifically for asset models containing "94 kg") and the date it was disposed? | assets_maintenance | select julianday(t1.c0) - julianday(t0.c1) from (select asset_disposed_date as c0 from assets) as t1, (select asset_acquired_date as c1 from assets where asset_model like '%94 kg' and asset_model like '%94 kg') 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.c0) - julianday(t0.c1) from (select asset_disposed_date as c0 from assets) as t1, (select asset_acquired_date as c1 from assets where asset_model like '%94 kg' and asset_model like '%94 kg') as t0"
},
"style": "rule"
} | {
"index": 3853,
"split": "train"
} | |
Who are the five students with the lowest Student IDs, along with their last names, majors, ages, and the allergy IDs of their specific allergies? Specifically, these students have allergies of the most rare or least common allergy type in the database, and the results are sorted by Student ID. | allergy_1 | select t0.lname, t0.major, t0.age, t1.stuid as c4 from student as t0 join has_allergy as t1 on t0.stuid = t1.stuid join allergy_type as t2 on t1.allergy = t2.allergy, (select allergy as c0 from allergy_type group by c0 order by count(*) asc nulls last limit 1) as t0 where t2.allergy = t0.c0 order by c4 asc nulls last l... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "allergy_1",
"sql": "select t0.lname, t0.major, t0.age, t1.stuid as c4 from student as t0 join has_allergy as t1 on t0.stuid = t1.stuid join allergy_type as t2 on t1.allergy = t2.allergy, (select allergy as c0 from allergy_type group by c0 order by count(*) asc nulls last limit 1)... | {
"index": 1010,
"split": "train"
} | |
Which customers have both policies with a customer ID of 435 or higher and the specific policy with policy ID 768? Please provide their details and customer IDs. | insurance_and_eClaims | select anon_1.c0, anon_1.c1 from (select t0.customer_details as c0, t0.customer_id as c1 from customers as t0 join policies as t1 on t0.customer_id = t1.customer_id where t1.customer_id >= 435 intersect select t0.customer_details as c0, t0.customer_id as c1 from customers as t0 join policies as t1 on t0.customer_id = t... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "insurance_and_eClaims",
"sql": "select anon_1.c0, anon_1.c1 from (select t0.customer_details as c0, t0.customer_id as c1 from customers as t0 join policies as t1 on t0.customer_id = t1.customer_id where t1.customer_id >= 435 intersect select t0.customer_details as c0, t0.customer... | {
"index": 1110,
"split": "train"
} | |
Show the three earliest instances of a woman’s country, her name, and the wedding year for weddings held at churches organized by groups starting with "W". | wedding | select t0.country, t0.name, t1.year as c1 from people as t0 join wedding as t1 on t0.people_id = t1.female_id join church as t2 on t1.church_id = t2.church_id where t2.organized_by like 'W%' order by c1 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": "wedding",
"sql": "select t0.country, t0.name, t1.year as c1 from people as t0 join wedding as t1 on t0.people_id = t1.female_id join church as t2 on t1.church_id = t2.church_id where t2.organized_by like 'W%' order by c1 asc nulls last limit 3"
},
"style": "rule"
} | {
"index": 543,
"split": "train"
} | |
What are the genders, city codes, and course IDs for students who have earned a grade of exactly 4.0 or a grade point higher than 1.3? | college_3 | select t0.sex, t0.city_code, t1.cid from student as t0 join enrolled_in as t1 on t0.stuid = t1.stuid join gradeconversion as t2 on t1.grade = t2.lettergrade where t2.gradepoint between 4.0 and 4.0 or t2.gradepoint > 1.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.sex, t0.city_code, t1.cid from student as t0 join enrolled_in as t1 on t0.stuid = t1.stuid join gradeconversion as t2 on t1.grade = t2.lettergrade where t2.gradepoint between 4.0 and 4.0 or t2.gradepoint > 1.3"
},
"style": "rule"
} | {
"index": 1503,
"split": "train"
} | |
What are the most recent validity start dates, customer IDs, and card numbers for the top five customer cards linked to the most frequently used account name or account names ending with "46," ordered by card number from highest to lowest? | customers_card_transactions | select t0.date_valid_from, t0.customer_id, t0.card_number as c2 from customers_cards as t0 join financial_transactions as t1 on t0.card_id = t1.card_id join accounts as t2 on t1.account_id = t2.account_id, (select account_name as c0 from accounts group by c0 order by count(*) asc nulls last limit 1) as t0 where t2.acco... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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.date_valid_from, t0.customer_id, t0.card_number as c2 from customers_cards as t0 join financial_transactions as t1 on t0.card_id = t1.card_id join accounts as t2 on t1.account_id = t2.account_id, (select account_name as c0 from acco... | {
"index": 2578,
"split": "train"
} | |
Which last names of guests with bookings that have a status code ending with "onfirmed" should be listed, limited to the first five, and ordered by their date of birth with nulls last? | apartment_rentals | select t0.guest_last_name from guests as t0 join apartment_bookings as t1 on t0.guest_id = t1.guest_id where t1.booking_status_code like '%onfirmed' order by t0.date_of_birth 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": "apartment_rentals",
"sql": "select t0.guest_last_name from guests as t0 join apartment_bookings as t1 on t0.guest_id = t1.guest_id where t1.booking_status_code like '%onfirmed' order by t0.date_of_birth asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 1627,
"split": "train"
} | |
What are the number of pixels and character cells in the display configurations, and what is the accreditation level of phones that have chip models with 64 MB or more, or exactly 32 MB of RAM? | phone_1 | select t0.pixels, t0.char_cells, t1.accreditation_level from screen_mode as t0 join phone as t1 on t0.graphics_mode = t1.screen_mode join chip_model as t2 on t1.chip_model = t2.model_name where t2.ram_mib > 64.0 or t2.ram_mib = 32.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": "phone_1",
"sql": "select t0.pixels, t0.char_cells, t1.accreditation_level from screen_mode as t0 join phone as t1 on t0.graphics_mode = t1.screen_mode join chip_model as t2 on t1.chip_model = t2.model_name where t2.ram_mib > 64.0 or t2.ram_mib = 32.0"
},
"style": "rule"
} | {
"index": 37,
"split": "train"
} | |
What are the distances and aircraft IDs of aircrafts certified to employees with a salary below 120,433? | flight_1 | select t0.distance, t0.aid from aircraft as t0 join certificate as t1 on t0.aid = t1.aid join employee as t2 on t1.eid = t2.eid where t2.salary < 120433 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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.distance, t0.aid from aircraft as t0 join certificate as t1 on t0.aid = t1.aid join employee as t2 on t1.eid = t2.eid where t2.salary < 120433"
},
"style": "rule"
} | {
"index": 1003,
"split": "train"
} | |
Is the average store where film 185 is held—considering only stores with IDs up to 2—greater than the average store where film 251 is held across all its inventory? | sakila_1 | select t1.c2 > t0.c2 from (select avg(t1.store_id) as c2 from film as t0 join inventory as t1 on t0.film_id = t1.film_id where t0.film_id = 251 group by t0.film_id) as t1, (select t0.film_id, avg(t1.store_id) as c2 from film as t0 join inventory as t1 on t0.film_id = t1.film_id where t0.film_id = 185 and t1.store_id <=... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "sakila_1",
"sql": "select t1.c2 > t0.c2 from (select avg(t1.store_id) as c2 from film as t0 join inventory as t1 on t0.film_id = t1.film_id where t0.film_id = 251 group by t0.film_id) as t1, (select t0.film_id, avg(t1.store_id) as c2 from film as t0 join inventory as t1 on t0.fil... | {
"index": 3554,
"split": "train"
} | |
Which representatives participated in elections ending with "1946" and also had at least one election where their votes were less than 14,077? What are their party affiliations, IDs, and lifespans? | election_representative | select anon_1.c0, anon_1.c1, anon_1.c2 from (select t0.party as c0, t0.representative_id as c1, t0.lifespan as c2 from representative as t0 join election as t1 on t0.representative_id = t1.representative_id where t1.date like '%1946' intersect select t0.party as c0, t0.representative_id as c1, t0.lifespan as c2 from re... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "election_representative",
"sql": "select anon_1.c0, anon_1.c1, anon_1.c2 from (select t0.party as c0, t0.representative_id as c1, t0.lifespan as c2 from representative as t0 join election as t1 on t0.representative_id = t1.representative_id where t1.date like '%1946' intersect se... | {
"index": 2767,
"split": "train"
} | |
Can you find the amenity IDs, dorm IDs, dorm names, and genders of the dorms where student 1016 lives, but only for dorms with IDs less than the highest dorm ID that student 1016 is associated with? | dorm_1 | select t0.amenid, t0.dormid, t1.dorm_name, t1.gender from has_amenity as t0 join dorm as t1 on t0.dormid = t1.dormid join lives_in as t2 on t1.dormid = t2.dormid, (select max(dormid) as c4 from lives_in where stuid = 1016) as t0 where t2.dormid < t0.c4 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "dorm_1",
"sql": "select t0.amenid, t0.dormid, t1.dorm_name, t1.gender from has_amenity as t0 join dorm as t1 on t0.dormid = t1.dormid join lives_in as t2 on t1.dormid = t2.dormid, (select max(dormid) as c4 from lives_in where stuid = 1016) as t0 where t2.dormid < t0.c4"
},
"s... | {
"index": 1294,
"split": "train"
} | |
Which are the three mills with the earliest built years, including their mill IDs, types, and the associated architects' gender and nationality, all built by architects who designed bridges in the most common bridge location? Sort these results by architect ID. | architecture | select t0.architect_id as c0, t0.built_year, t0.type, t1.gender, t1.nationality from mill as t0 join architect as t1 on t0.architect_id = t1.id join bridge as t2 on t1.id = t2.architect_id, (select location as c2 from bridge group by c2 order by count(length_meters) asc nulls last limit 1) as t0 where t2.location = 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": "architecture",
"sql": "select t0.architect_id as c0, t0.built_year, t0.type, t1.gender, t1.nationality from mill as t0 join architect as t1 on t0.architect_id = t1.id join bridge as t2 on t1.id = t2.architect_id, (select location as c2 from bridge group by c2 order by count(lengt... | {
"index": 664,
"split": "train"
} | |
Which artist's name, country, and resolution are associated with songs that have an audio or video file ending in "4.58 MB" and feature the most frequently occurring song duration in the database? | music_1 | select t0.artist_name, t0.country, t0.resolution, t1.artist_name from song as t0 join files as t1 on t0.f_id = t1.f_id, (select duration as c3 from files group by c3 order by count(*) desc limit 1) as t0 where t1.file_size like '%4.58 MB' and t1.duration = t0.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": "music_1",
"sql": "select t0.artist_name, t0.country, t0.resolution, t1.artist_name from song as t0 join files as t1 on t0.f_id = t1.f_id, (select duration as c3 from files group by c3 order by count(*) desc limit 1) as t0 where t1.file_size like '%4.58 MB' and t1.duration = t0.c3... | {
"index": 2446,
"split": "train"
} | |
What are the high school scores, yellow card counts, and player IDs for players who tried out at colleges in Arizona or colleges with states ending in Z? | soccer_2 | select t0.hs, t0.ycard, t1.pid from player as t0 join tryout as t1 on t0.pid = t1.pid join college as t2 on t1.cname = t2.cname where t2.state like 'AZ%' or t2.state like '%Z' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "soccer_2",
"sql": "select t0.hs, t0.ycard, t1.pid from player as t0 join tryout as t1 on t0.pid = t1.pid join college as t2 on t1.cname = t2.cname where t2.state like 'AZ%' or t2.state like '%Z'"
},
"style": "rule"
} | {
"index": 1586,
"split": "train"
} | |
Can you tell me the top five characteristics (with IDs 10 or less) associated with product 7, including their details such as other characteristic descriptions and type codes? For each of these characteristics, I want to know how many times it appears for this product, sorted from the most common to the least.
---
Th... | products_gen_characteristics | select t0.other_characteristic_details, t0.characteristic_type_code, t0.characteristic_id as c3, count(t1.characteristic_id) as c2 from characteristics as t0 join product_characteristics as t1 on t0.characteristic_id = t1.characteristic_id where t1.characteristic_id <= 10 and t1.product_id = 7 group by c3 order by c2 d... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "products_gen_characteristics",
"sql": "select t0.other_characteristic_details, t0.characteristic_type_code, t0.characteristic_id as c3, count(t1.characteristic_id) as c2 from characteristics as t0 join product_characteristics as t1 on t0.characteristic_id = t1.characteristic_id w... | {
"index": 233,
"split": "train"
} | |
How many markets are located in the district of Ontario? | phone_market | select count(*) from market where district = 'Ontario' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "phone_market",
"sql": "select count(*) from market where district = 'Ontario'"
},
"style": "rule"
} | {
"index": 2724,
"split": "train"
} | |
How many times did the student with ID 1001 visit a restaurant? | restaurant_1 | select count(*) from visits_restaurant where stuid = 1001 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "restaurant_1",
"sql": "select count(*) from visits_restaurant where stuid = 1001"
},
"style": "rule"
} | {
"index": 754,
"split": "train"
} | |
Is the total of student IDs for students with a 'B-' grade and student IDs of at least 1006 greater than the total of student IDs for students with a 'B' grade? | college_3 | select t1.c1 > t0.c1 from (select sum(t1.stuid) as c1 from gradeconversion as t0 join enrolled_in as t1 on t0.lettergrade = t1.grade where t0.lettergrade = 'B' group by t0.lettergrade) as t1, (select t0.lettergrade, sum(t1.stuid) as c1 from gradeconversion as t0 join enrolled_in as t1 on t0.lettergrade = t1.grade 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": "college_3",
"sql": "select t1.c1 > t0.c1 from (select sum(t1.stuid) as c1 from gradeconversion as t0 join enrolled_in as t1 on t0.lettergrade = t1.grade where t0.lettergrade = 'B' group by t0.lettergrade) as t1, (select t0.lettergrade, sum(t1.stuid) as c1 from gradeconversion as ... | {
"index": 3539,
"split": "train"
} | |
What are the Market Ids, Districts, and Number of Shops for the markets that have Phone Market entries with market id 5 but do not have any entries with market id 2? | phone_market | select anon_1.c2, anon_1.c0, anon_1.c1 from (select t0.market_id as c2, t0.district as c0, t0.num_of_shops as c1 from market as t0 join phone_market as t1 on t0.market_id = t1.market_id where t1.market_id = 5 except select t0.market_id as c2, t0.district as c0, t0.num_of_shops as c1 from market as t0 join phone_market ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "phone_market",
"sql": "select anon_1.c2, anon_1.c0, anon_1.c1 from (select t0.market_id as c2, t0.district as c0, t0.num_of_shops as c1 from market as t0 join phone_market as t1 on t0.market_id = t1.market_id where t1.market_id = 5 except select t0.market_id as c2, t0.district as... | {
"index": 2653,
"split": "train"
} | |
What are the names, IDs, and the number of unique prices for up to five aircraft models that have fewer than two flights with a distance less than 4103, sorted by the smallest number of distinct prices? | flight_1 | select count(distinct (t0.price)) as c0, t1.name, t1.aid as c1 from flight as t0 join aircraft as t1 on t0.aid = t1.aid where t1.distance < 4103 group by c1 having count(*) < 2 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": "flight_1",
"sql": "select count(distinct (t0.price)) as c0, t1.name, t1.aid as c1 from flight as t0 join aircraft as t1 on t0.aid = t1.aid where t1.distance < 4103 group by c1 having count(*) < 2 order by c0 asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 1764,
"split": "train"
} | |
Can you tell me the role descriptions, role codes, and passwords for users whose login starts with "0" or for the user login that appears most often in the system? | document_management | select t0.role_description, t0.role_code, t1.password from roles as t0 join users as t1 on t0.role_code = t1.role_code, (select user_login as c3 from users group by c3 order by count(*) asc nulls last limit 1) as t0 where t1.user_login like '0%' or t1.user_login = t0.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": "document_management",
"sql": "select t0.role_description, t0.role_code, t1.password from roles as t0 join users as t1 on t0.role_code = t1.role_code, (select user_login as c3 from users group by c3 order by count(*) asc nulls last limit 1) as t0 where t1.user_login like '0%' or t... | {
"index": 1726,
"split": "train"
} | |
Did the tweet with ID 7 happen earlier than the tweet with ID 4? | twitter_1 | select t1.c1 < t0.c1 from (select createdate as c1 from tweets where id = 7) as t1, (select createdate as c1 from tweets where id = 4) 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": "twitter_1",
"sql": "select t1.c1 < t0.c1 from (select createdate as c1 from tweets where id = 7) as t1, (select createdate as c1 from tweets where id = 4) as t0"
},
"style": "rule"
} | {
"index": 3155,
"split": "train"
} | |
Is the total sum of department store IDs for the store chain with ID 4 greater than 2? | department_store | select t0.c1 > 2 from (select sum(t1.dept_store_chain_id) as c1 from department_store_chain as t0 join department_stores as t1 on t0.dept_store_chain_id = t1.dept_store_chain_id where t0.dept_store_chain_id = 4 group by t0.dept_store_chain_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": "department_store",
"sql": "select t0.c1 > 2 from (select sum(t1.dept_store_chain_id) as c1 from department_store_chain as t0 join department_stores as t1 on t0.dept_store_chain_id = t1.dept_store_chain_id where t0.dept_store_chain_id = 4 group by t0.dept_store_chain_id) as t0"
... | {
"index": 3295,
"split": "train"
} | |
Which students are living in dorms that have amenities with an ID greater than 901 or at least 950, and what are the dorm IDs and capacities for those dorms? | dorm_1 | select t0.dormid, t0.stuid, t1.dormid, t1.student_capacity from lives_in as t0 join dorm as t1 on t0.dormid = t1.dormid join has_amenity as t2 on t1.dormid = t2.dormid where t2.amenid > 901 or t2.amenid >= 950 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "dorm_1",
"sql": "select t0.dormid, t0.stuid, t1.dormid, t1.student_capacity from lives_in as t0 join dorm as t1 on t0.dormid = t1.dormid join has_amenity as t2 on t1.dormid = t2.dormid where t2.amenid > 901 or t2.amenid >= 950"
},
"style": "rule"
} | {
"index": 2293,
"split": "train"
} | |
What are the top 10 shipment tracking numbers when sorted in reverse alphabetical order, along with the smallest order ID, the count of unique shipment dates, and the highest invoice number for each? | tracking_orders | select shipment_tracking_number as c3, min(order_id), count(distinct (shipment_date)), max(invoice_number) from shipments group by c3 order by c3 desc limit 10 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_orders",
"sql": "select shipment_tracking_number as c3, min(order_id), count(distinct (shipment_date)), max(invoice_number) from shipments group by c3 order by c3 desc limit 10"
},
"style": "rule"
} | {
"index": 1688,
"split": "train"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.