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 |
|---|---|---|---|---|---|---|---|---|
How many customer addresses are associated with the premise that has an ID of 1? | customers_campaigns_ecommerce | select count(*) from customer_addresses where premise_id = 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_campaigns_ecommerce",
"sql": "select count(*) from customer_addresses where premise_id = 1"
},
"style": "rule"
} | {
"index": 2199,
"split": "train"
} | |
For hotel star ratings beginning with "3," how many hotels are classified under each of those star rating codes? | cre_Theme_park | select count(t0.price_range), t1.star_rating_code as c0 from hotels as t0 join ref_hotel_star_ratings as t1 on t0.star_rating_code = t1.star_rating_code where c0 like '3%' 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": "cre_Theme_park",
"sql": "select count(t0.price_range), t1.star_rating_code as c0 from hotels as t0 join ref_hotel_star_ratings as t1 on t0.star_rating_code = t1.star_rating_code where c0 like '3%' group by c0"
},
"style": "rule"
} | {
"index": 1510,
"split": "train"
} | |
Who are the three users with the smallest number of tweets, among those whose email contains "star.c," when sorted by the number of their unique tweet creation dates? | twitter_1 | select count(t0.uid) from user_profiles as t0 join tweets as t1 on t0.uid = t1.uid where t0.email like '%star.c%' order by count(distinct (t1.createdate)) 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": "twitter_1",
"sql": "select count(t0.uid) from user_profiles as t0 join tweets as t1 on t0.uid = t1.uid where t0.email like '%star.c%' order by count(distinct (t1.createdate)) asc nulls last limit 3"
},
"style": "rule"
} | {
"index": 1451,
"split": "train"
} | |
Can you tell me the total number of customer complaints handled and the staff member's ID for staff members whose email addresses contain "@exa" and whose first name ends with "ustin? | customer_complaints | select sum(t0.customer_id), t1.staff_id as c1 from complaints as t0 join staff as t1 on t0.staff_id = t1.staff_id where t1.email_address like '%@exa%' and t1.first_name like '%ustin' group by c1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customer_complaints",
"sql": "select sum(t0.customer_id), t1.staff_id as c1 from complaints as t0 join staff as t1 on t0.staff_id = t1.staff_id where t1.email_address like '%@exa%' and t1.first_name like '%ustin' group by c1"
},
"style": "rule"
} | {
"index": 1482,
"split": "train"
} | |
Is the earliest service ID (between 1 and 11) for party 12 higher than the earliest service ID for party 9? | e_government | select t1.c2 > t0.c2 from (select min(t1.service_id) as c2 from parties as t0 join party_services as t1 on t0.party_id = t1.customer_id where t0.party_id = 12 and t1.service_id between 1 and 11 group by t0.party_id) as t1, (select t0.party_id, min(t1.service_id) as c2 from parties as t0 join party_services as t1 on 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.c2 > t0.c2 from (select min(t1.service_id) as c2 from parties as t0 join party_services as t1 on t0.party_id = t1.customer_id where t0.party_id = 12 and t1.service_id between 1 and 11 group by t0.party_id) as t1, (select t0.party_id, min(t1.servic... | {
"index": 3545,
"split": "train"
} | |
What are the station IDs and dock counts for stations that are either not among those installed in January with latitude less than 37.77865, or are station 74? | bike_1 | select t0.id as c0, t0.dock_count from station as t0 join status as t1 on t0.id = t1.station_id where (not t1.station_id in (select c0 as c0 from station where t0.installation_date like '%01%' and t0.lat < 37.77865)) or t1.station_id = 74 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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, t0.dock_count from station as t0 join status as t1 on t0.id = t1.station_id where (not t1.station_id in (select c0 as c0 from station where t0.installation_date like '%01%' and t0.lat < 37.77865)) or t1.station_id = 74"
},
"style": "rule"
... | {
"index": 124,
"split": "train"
} | |
Which accelerator compatible browser has the fewest supporting browsers, and what is the number of browsers it supports? | browser_web | select count(browser_id) as c0 from accelerator_compatible_browser order by c0 asc nulls last limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "browser_web",
"sql": "select count(browser_id) as c0 from accelerator_compatible_browser order by c0 asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 516,
"split": "train"
} | |
Show all the details for all institutions. | protein_institute | select * from institution | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 * from institution"
},
"style": "rule"
} | {
"index": 90,
"split": "train"
} | |
How much higher is the rating of the song "Ami opar hoye" compared to the lowest-rated pop song? | music_1 | select t2.c2 - t0.c0 from (select min(rating) as c2 from song where genre_is like '%pop') as t2, (select rating as c0 from song where song_name = 'Ami opar hoye') as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "music_1",
"sql": "select t2.c2 - t0.c0 from (select min(rating) as c2 from song where genre_is like '%pop') as t2, (select rating as c0 from song where song_name = 'Ami opar hoye') as t0"
},
"style": "rule"
} | {
"index": 3196,
"split": "train"
} | |
Which registration dates and course IDs are associated with candidate assessments that either have an outcome code containing "l" or the least frequently occurring assessment outcome code? | student_assessment | select t0.registration_date, t0.course_id from student_course_registrations as t0 join students as t1 on t0.student_id = t1.student_id join people as t2 on t1.student_id = t2.person_id join candidates as t3 on t2.person_id = t3.candidate_id join candidate_assessments as t4 on t3.candidate_id = t4.candidate_id, (select ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "student_assessment",
"sql": "select t0.registration_date, t0.course_id from student_course_registrations as t0 join students as t1 on t0.student_id = t1.student_id join people as t2 on t1.student_id = t2.person_id join candidates as t3 on t2.person_id = t3.candidate_id join candi... | {
"index": 2678,
"split": "train"
} | |
What are the lowest and highest average wine prices in counties whose names include "Am"? | wine_1 | select min(t0.c2), max(t0.c2) from (select avg(t1.price) as c2 from appellations as t0 join wine as t1 on t0.appelation = t1.appelation where t0.county like '%Am%' group by t0.no) 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": "wine_1",
"sql": "select min(t0.c2), max(t0.c2) from (select avg(t1.price) as c2 from appellations as t0 join wine as t1 on t0.appelation = t1.appelation where t0.county like '%Am%' group by t0.no) as t0"
},
"style": "rule"
} | {
"index": 3651,
"split": "train"
} | |
What are the ages and cities of people who are friends with Zach or with someone whose name starts with "Bo"? | network_2 | select t0.age, t0.city from person as t0 join personfriend as t1 on t0.name = t1.friend where t1.name = 'Zach' or t1.name like 'Bo%' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "network_2",
"sql": "select t0.age, t0.city from person as t0 join personfriend as t1 on t0.name = t1.friend where t1.name = 'Zach' or t1.name like 'Bo%'"
},
"style": "rule"
} | {
"index": 1745,
"split": "train"
} | |
Which shop has the device with the highest device ID in stock? | device | select shop_id from stock order by device_id desc limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "device",
"sql": "select shop_id from stock order by device_id desc limit 1"
},
"style": "rule"
} | {
"index": 858,
"split": "train"
} | |
What are the customer IDs and order status codes for the five most recent orders involving products with a product type code ending in "othes," sorted by order status code in reverse alphabetical order? | customers_and_products_contacts | select t0.customer_id, t0.order_status_code as c1 from customer_orders as t0 join order_items as t1 on t0.order_id = t1.order_id join products as t2 on t1.product_id = t2.product_id where t2.product_type_code like '%othes' order by c1 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": "customers_and_products_contacts",
"sql": "select t0.customer_id, t0.order_status_code as c1 from customer_orders as t0 join order_items as t1 on t0.order_id = t1.order_id join products as t2 on t1.product_id = t2.product_id where t2.product_type_code like '%othes' order by c1 des... | {
"index": 629,
"split": "train"
} | |
Which are the top three customers, along with their details, who placed the most orders on or before December 7, 1979, or between August 10, 1974, and December 7, 1979? Show their name, details, ID, and the count of their relevant orders, sorted from most to fewest. | tracking_orders | select t0.customer_name, t0.customer_details, t0.customer_id as c3, count(distinct (t1.customer_id)) as c0 from customers as t0 join orders as t1 on t0.customer_id = t1.customer_id where t1.date_order_placed <= '1979-12-07 02:03:49' or t1.date_order_placed between '1974-08-10 08:15:16' and '1979-12-07 02:03:49' group 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": "tracking_orders",
"sql": "select t0.customer_name, t0.customer_details, t0.customer_id as c3, count(distinct (t1.customer_id)) as c0 from customers as t0 join orders as t1 on t0.customer_id = t1.customer_id where t1.date_order_placed <= '1979-12-07 02:03:49' or t1.date_order_plac... | {
"index": 2039,
"split": "train"
} | |
Which faculty IDs and building locations are associated with students who either have the last name of the oldest student overall or whose last name ends with the letter "g"? | activity_1 | select t0.facid, t0.building from faculty as t0 join faculty_participates_in as t1 on t0.facid = t1.facid join activity as t2 on t1.actid = t2.actid join participates_in as t3 on t2.actid = t3.actid join student as t4 on t3.stuid = t4.stuid, (select lname as c0 from student group by c0 order by sum(age) desc limit 1) 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": "activity_1",
"sql": "select t0.facid, t0.building from faculty as t0 join faculty_participates_in as t1 on t0.facid = t1.facid join activity as t2 on t1.actid = t2.actid join participates_in as t3 on t2.actid = t3.actid join student as t4 on t3.stuid = t4.stuid, (select lname as ... | {
"index": 329,
"split": "train"
} | |
Which are the five countries ending with the letter "a" that have the most cities, and what is the number of cities for each of these countries? | sakila_1 | select count(t0.country_id) as c2, t1.country as c0, t1.country_id as c1 from city as t0 join country as t1 on t0.country_id = t1.country_id where c0 like '%a' group by c1 order by c2 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": "sakila_1",
"sql": "select count(t0.country_id) as c2, t1.country as c0, t1.country_id as c1 from city as t0 join country as t1 on t0.country_id = t1.country_id where c0 like '%a' group by c1 order by c2 desc limit 5"
},
"style": "rule"
} | {
"index": 289,
"split": "train"
} | |
What is the lowest price range for hotels in each star rating category that has a description of "star"? | cre_Theme_park | select min(t0.price_range), t1.star_rating_code as c0 from hotels as t0 join ref_hotel_star_ratings as t1 on t0.star_rating_code = t1.star_rating_code where t1.star_rating_description = 'star' 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": "cre_Theme_park",
"sql": "select min(t0.price_range), t1.star_rating_code as c0 from hotels as t0 join ref_hotel_star_ratings as t1 on t0.star_rating_code = t1.star_rating_code where t1.star_rating_description = 'star' group by c0"
},
"style": "rule"
} | {
"index": 1319,
"split": "train"
} | |
What are the first 10 product colors associated with order number 15, sorted alphabetically with null colors listed last? | customers_and_invoices | select t0.product_color as c0 from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.order_id = 15 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": "customers_and_invoices",
"sql": "select t0.product_color as c0 from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.order_id = 15 order by c0 asc nulls last limit 10"
},
"style": "rule"
} | {
"index": 2394,
"split": "train"
} | |
Can you list the IDs, titles, and artist IDs of albums that include tracks both from albums with IDs 242 or above and from genres with IDs less than 2? | store_1 | select anon_1.c2, anon_1.c0, anon_1.c1 from (select t0.id as c2, t0.title as c0, t0.artist_id as c1 from albums as t0 join tracks as t1 on t0.id = t1.album_id where t1.album_id >= 242 intersect select t0.id as c2, t0.title as c0, t0.artist_id as c1 from albums as t0 join tracks as t1 on t0.id = t1.album_id where t1.gen... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 anon_1.c2, anon_1.c0, anon_1.c1 from (select t0.id as c2, t0.title as c0, t0.artist_id as c1 from albums as t0 join tracks as t1 on t0.id = t1.album_id where t1.album_id >= 242 intersect select t0.id as c2, t0.title as c0, t0.artist_id as c1 from albums a... | {
"index": 2511,
"split": "train"
} | |
Which are the last five order items and their corresponding order IDs associated with shipments that have an order ID greater than the smallest shipment order ID? | tracking_orders | select t0.order_item_id, t0.order_id as c1 from order_items as t0 join orders as t1 on t0.order_id = t1.order_id join shipments as t2 on t1.order_id = t2.order_id, (select min(order_id) as c0 from shipments) as t0 where t2.order_id > t0.c0 order by c1 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_orders",
"sql": "select t0.order_item_id, t0.order_id as c1 from order_items as t0 join orders as t1 on t0.order_id = t1.order_id join shipments as t2 on t1.order_id = t2.order_id, (select min(order_id) as c0 from shipments) as t0 where t2.order_id > t0.c0 order by c1 de... | {
"index": 2785,
"split": "train"
} | |
Which rooms, identified by their maximum occupancy, bed type, and name, have been reserved with no kids, but not at the rate of exactly 172.5? | inn_1 | select anon_1.c1, anon_1.c2, anon_1.c0 from (select t0.maxoccupancy as c1, t0.bedtype as c2, t0.roomname as c0 from rooms as t0 join reservations as t1 on t0.roomid = t1.room where t1.kids = 0 except select t0.maxoccupancy as c1, t0.bedtype as c2, t0.roomname as c0 from rooms as t0 join reservations as t1 on t0.roomid ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "inn_1",
"sql": "select anon_1.c1, anon_1.c2, anon_1.c0 from (select t0.maxoccupancy as c1, t0.bedtype as c2, t0.roomname as c0 from rooms as t0 join reservations as t1 on t0.roomid = t1.room where t1.kids = 0 except select t0.maxoccupancy as c1, t0.bedtype as c2, t0.roomname as c... | {
"index": 2610,
"split": "train"
} | |
What are the names and types of allergies, and which students aged 17 or older have those allergies? Please include the allergy names and student IDs for these students.
---
This version is clearer and more natural, and it maintains all the necessary details to reconstruct the SQL query. | allergy_1 | select t0.allergy, t0.allergytype, t1.allergy, t1.stuid from allergy_type as t0 join has_allergy as t1 on t0.allergy = t1.allergy join student as t2 on t1.stuid = t2.stuid where t2.age >= 17 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "allergy_1",
"sql": "select t0.allergy, t0.allergytype, t1.allergy, t1.stuid from allergy_type as t0 join has_allergy as t1 on t0.allergy = t1.allergy join student as t2 on t1.stuid = t2.stuid where t2.age >= 17"
},
"style": "rule"
} | {
"index": 286,
"split": "train"
} | |
Find the most recent 10 students' IDs and details who live in addresses located in a city ending with "varesburgh" or "st Tavaresburgh," sorted by student ID in descending order. | student_assessment | select t0.student_id as c1, t0.student_details from students as t0 join people as t1 on t0.student_id = t1.person_id join people_addresses as t2 on t1.person_id = t2.person_id join addresses as t3 on t2.address_id = t3.address_id where t3.city like '%varesburgh' or t3.city like '%st Tavaresburgh' order by c1 desc limit... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "student_assessment",
"sql": "select t0.student_id as c1, t0.student_details from students as t0 join people as t1 on t0.student_id = t1.person_id join people_addresses as t2 on t1.person_id = t2.person_id join addresses as t3 on t2.address_id = t3.address_id where t3.city like '%... | {
"index": 1746,
"split": "train"
} | |
Which booking status codes are associated with apartment bookings where the highest guest ID in each group is between 13 and 14, and among these, identify the status code with the lowest maximum guest ID? | apartment_rentals | select booking_status_code as c0 from apartment_bookings group by c0 having max(guest_id) between 13 and 14 order by max(guest_id) 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": "apartment_rentals",
"sql": "select booking_status_code as c0 from apartment_bookings group by c0 having max(guest_id) between 13 and 14 order by max(guest_id) asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 2863,
"split": "train"
} | |
Which user account has the user ID equal to the highest user ID present in reviews, and among those, what is the user ID with the lowest value? | epinions_1 | select t0.u_id as c1 from useracct as t0 join review as t1 on t0.u_id = t1.u_id, (select max(u_id) as c0 from review) as t0 where t1.u_id = t0.c0 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": "epinions_1",
"sql": "select t0.u_id as c1 from useracct as t0 join review as t1 on t0.u_id = t1.u_id, (select max(u_id) as c0 from review) as t0 where t1.u_id = t0.c0 order by c1 asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 2177,
"split": "train"
} | |
Which are the last five playlists (by ID) that include tracks with the media type named "Protected MPEG-4 video file," listing their playlist IDs and names, sorted by playlist ID with nulls last? | store_1 | select t0.id as c2, t0.name, t1.playlist_id from playlists as t0 join playlist_tracks as t1 on t0.id = t1.playlist_id join tracks as t2 on t1.track_id = t2.id join media_types as t3 on t2.media_type_id = t3.id where t3.name = 'Protected MPEG-4 video file' order by c2 asc nulls last limit 5 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "store_1",
"sql": "select t0.id as c2, t0.name, t1.playlist_id from playlists as t0 join playlist_tracks as t1 on t0.id = t1.playlist_id join tracks as t2 on t1.track_id = t2.id join media_types as t3 on t2.media_type_id = t3.id where t3.name = 'Protected MPEG-4 video file' order ... | {
"index": 2572,
"split": "train"
} | |
What are the booking IDs, product IDs, and customer IDs for bookings that have payments made on March 19, 2018, or on or before March 23, 2018, sorted by the most recent booking ID first? | products_for_hire | select t0.booking_id as c2, t0.product_id, t1.customer_id from products_booked as t0 join bookings as t1 on t0.booking_id = t1.booking_id join payments as t2 on t1.booking_id = t2.booking_id where t2.payment_date = '2018-03-19 12:39:31' or t2.payment_date <= '2018-03-23 20:36:04' order by c2 desc | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "products_for_hire",
"sql": "select t0.booking_id as c2, t0.product_id, t1.customer_id from products_booked as t0 join bookings as t1 on t0.booking_id = t1.booking_id join payments as t2 on t1.booking_id = t2.booking_id where t2.payment_date = '2018-03-19 12:39:31' or t2.payment_d... | {
"index": 2124,
"split": "train"
} | |
What are the details and invoice numbers of the first five invoices associated with orders placed either exactly on December 7, 1979, at 02:03:49, or between that date and January 27, 1997, sorted alphabetically by invoice details, placing any null values last? | tracking_orders | select t0.invoice_details as c1, t0.invoice_number from invoices as t0 join shipments as t1 on t0.invoice_number = t1.invoice_number join orders as t2 on t1.order_id = t2.order_id where t2.date_order_placed = '1979-12-07 02:03:49' or t2.date_order_placed between '1979-12-07 02:03:49' and '1997-01-27 19:12:01' order by ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_orders",
"sql": "select t0.invoice_details as c1, t0.invoice_number from invoices as t0 join shipments as t1 on t0.invoice_number = t1.invoice_number join orders as t2 on t1.order_id = t2.order_id where t2.date_order_placed = '1979-12-07 02:03:49' or t2.date_order_placed... | {
"index": 885,
"split": "train"
} | |
Can you list the SSN and name of each scientist, along with the assigned scientist's name, for projects that do not have a name matching any scientist's name? | scientist_1 | select t0.ssn, t0.name as c2, t1.scientist from scientists as t0 join assignedto as t1 on t0.ssn = t1.scientist join projects as t2 on t1.project = t2.code where (not t2.name in (select c2 as c2 from scientists)) | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "scientist_1",
"sql": "select t0.ssn, t0.name as c2, t1.scientist from scientists as t0 join assignedto as t1 on t0.ssn = t1.scientist join projects as t2 on t1.project = t2.code where (not t2.name in (select c2 as c2 from scientists))"
},
"style": "rule"
} | {
"index": 2452,
"split": "train"
} | |
How many days elapsed between the start and end dates of staff department assignments, particularly for assignments ending on March 25, 2018? | department_store | select julianday(t1.c0) - julianday(t0.c1) from (select date_assigned_from as c0 from staff_department_assignments) as t1, (select date_assigned_to as c1 from staff_department_assignments where c1 between '2018-03-25 13:32:57' and '2018-03-25 13:32:57' and c1 between '2018-03-25 13:32:57' and '2018-03-25 13:32:57') as ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "department_store",
"sql": "select julianday(t1.c0) - julianday(t0.c1) from (select date_assigned_from as c0 from staff_department_assignments) as t1, (select date_assigned_to as c1 from staff_department_assignments where c1 between '2018-03-25 13:32:57' and '2018-03-25 13:32:57' ... | {
"index": 3702,
"split": "train"
} | |
Find the opening year, capacity, cinema ID, name, and location of cinemas that have scheduled films directed by someone with "or Treviñ" in their name. | cinema | select anon_1.c3, anon_1.c0, anon_1.c1, anon_1.c2, anon_1.c4 from (select openning_year as c3, capacity as c0, cinema_id as c1, name as c2, location as c4 from cinema union select t0.openning_year as c3, t0.capacity as c0, t0.cinema_id as c1, t0.name as c2, t0.location as c4 from cinema as t0 join schedule as t1 on 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": "cinema",
"sql": "select anon_1.c3, anon_1.c0, anon_1.c1, anon_1.c2, anon_1.c4 from (select openning_year as c3, capacity as c0, cinema_id as c1, name as c2, location as c4 from cinema union select t0.openning_year as c3, t0.capacity as c0, t0.cinema_id as c1, t0.name as c2, t0.lo... | {
"index": 1617,
"split": "train"
} | |
What are the first 10 account names and associated details for accounts linked to customer cards with customer IDs between 3 and 8 and cards valid from May 9, 2015, onward, sorted by their account details? | customers_card_transactions | select t0.account_name, t0.other_account_details as c1 from accounts as t0 join financial_transactions as t1 on t0.account_id = t1.account_id join customers_cards as t2 on t1.card_id = t2.card_id where t2.customer_id between 3 and 8 and t2.date_valid_from >= '2015-05-09 04:05:26' 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_card_transactions",
"sql": "select t0.account_name, t0.other_account_details as c1 from accounts as t0 join financial_transactions as t1 on t0.account_id = t1.account_id join customers_cards as t2 on t1.card_id = t2.card_id where t2.customer_id between 3 and 8 and t2.da... | {
"index": 2340,
"split": "train"
} | |
What are the three highest total budget percentages invested among budgets where the percentage invested falls between 2.2% and 2.7%, with the results ordered from highest to lowest? | school_finance | select sum(total_budget_percent_invested) as c0 from budget where total_budget_percent_invested between 2.2 and 2.7 order by c0 desc limit 3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "school_finance",
"sql": "select sum(total_budget_percent_invested) as c0 from budget where total_budget_percent_invested between 2.2 and 2.7 order by c0 desc limit 3"
},
"style": "rule"
} | {
"index": 425,
"split": "train"
} | |
Which project has the smallest task ID associated with it among projects whose details contain the letter "i"? For each such project, what is its project ID and the minimum task ID linked to it? | tracking_grants_for_research | select min(t0.project_id), t1.project_id as c1 from tasks as t0 join projects as t1 on t0.project_id = t1.project_id where t1.project_details like '%i%' group by c1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_grants_for_research",
"sql": "select min(t0.project_id), t1.project_id as c1 from tasks as t0 join projects as t1 on t0.project_id = t1.project_id where t1.project_details like '%i%' group by c1"
},
"style": "rule"
} | {
"index": 751,
"split": "train"
} | |
Does airport 1 have a lowest company ID that is less than the total number of airports where the minimum company ID is below 9? | flight_company | select t2.c2 < t1.c3 from (select min(t1.company_id) as c2 from airport as t0 join flight as t1 on t0.id = t1.airport_id where t0.id = 1 group by t0.id) as t2, (select count(t0.c2) as c3 from (select min(t1.company_id) as c2 from airport as t0 join flight as t1 on t0.id = t1.airport_id where t1.company_id < 9 group by ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "flight_company",
"sql": "select t2.c2 < t1.c3 from (select min(t1.company_id) as c2 from airport as t0 join flight as t1 on t0.id = t1.airport_id where t0.id = 1 group by t0.id) as t2, (select count(t0.c2) as c3 from (select min(t1.company_id) as c2 from airport as t0 join flight... | {
"index": 3315,
"split": "train"
} | |
Which catalog at level 8 has the lowest catalog ID, and what are its catalog ID and publisher? | product_catalog | select t0.catalog_id as c2, t0.catalog_publisher, t1.catalog_id from catalogs as t0 join catalog_structure as t1 on t0.catalog_id = t1.catalog_id where t1.catalog_level_number = 8 order by c2 asc nulls last limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "product_catalog",
"sql": "select t0.catalog_id as c2, t0.catalog_publisher, t1.catalog_id from catalogs as t0 join catalog_structure as t1 on t0.catalog_id = t1.catalog_id where t1.catalog_level_number = 8 order by c2 asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 5,
"split": "train"
} | |
Which are the first five stores with districts that have a city area smaller than 28.0, including their store IDs, names, types, and the store IDs of their districts? | store_product | select t0.store_id, t0.store_name, t0.type, t1.store_id as c1 from store as t0 join store_district as t1 on t0.store_id = t1.store_id join district as t2 on t1.district_id = t2.district_id where t2.city_area < 28.0 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": "store_product",
"sql": "select t0.store_id, t0.store_name, t0.type, t1.store_id as c1 from store as t0 join store_district as t1 on t0.store_id = t1.store_id join district as t2 on t1.district_id = t2.district_id where t2.city_area < 28.0 order by c1 asc nulls last limit 5"
},
... | {
"index": 194,
"split": "train"
} | |
Looking for the top three follow relationships and user names where the user has tweeted a message that either starts with 'Oh, I only have ' or includes 'on't want', sorted alphabetically by the user’s name. | twitter_1 | select t0.f1, t0.f2, t1.name as c0 from follows as t0 join user_profiles as t1 on t0.f2 = t1.uid join tweets as t2 on t1.uid = t2.uid where t2.text like 'Oh, I only have %' or t2.text like '%on''t want%' order by c0 asc nulls last limit 3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "twitter_1",
"sql": "select t0.f1, t0.f2, t1.name as c0 from follows as t0 join user_profiles as t1 on t0.f2 = t1.uid join tweets as t2 on t1.uid = t2.uid where t2.text like 'Oh, I only have %' or t2.text like '%on''t want%' order by c0 asc nulls last limit 3"
},
"style": "rul... | {
"index": 2584,
"split": "train"
} | |
How many photos are linked to the rarest camera lens with a maximum aperture of 8.0, and what is the total number of such photo records? | mountain_photos | select count(*), count(t0.id) from camera_lens as t0 join photos as t1 on t0.id = t1.camera_lens_id, (select id as c1 from camera_lens group by c1 order by count(*) asc nulls last limit 1) as t0 where t0.id = t0.c1 and t0.max_aperture = 8.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": "mountain_photos",
"sql": "select count(*), count(t0.id) from camera_lens as t0 join photos as t1 on t0.id = t1.camera_lens_id, (select id as c1 from camera_lens group by c1 order by count(*) asc nulls last limit 1) as t0 where t0.id = t0.c1 and t0.max_aperture = 8.0"
},
"styl... | {
"index": 2886,
"split": "train"
} | |
What is the transaction type code for the sale transaction, and what other transaction type code matches it, when sorted in reverse alphabetical order? | tracking_share_transactions | select t0.transaction_type_code, t1.transaction_type_code as c0 from ref_transaction_types as t0 join transactions as t1 on t0.transaction_type_code = t1.transaction_type_code where c0 = 'SALE' 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": "tracking_share_transactions",
"sql": "select t0.transaction_type_code, t1.transaction_type_code as c0 from ref_transaction_types as t0 join transactions as t1 on t0.transaction_type_code = t1.transaction_type_code where c0 = 'SALE' order by c0 desc limit 1"
},
"style": "rule"... | {
"index": 2607,
"split": "train"
} | |
What are the ages of pilots whose ranks are between 13 and 45? | pilot_record | select age from pilot where rank between 13 and 45 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "pilot_record",
"sql": "select age from pilot where rank between 13 and 45"
},
"style": "rule"
} | {
"index": 571,
"split": "train"
} | |
Can you tell me the different compatibility years, accelerator IDs, and browser IDs for accelerator-browser pairs that became compatible before 2005? | browser_web | select distinct compatible_since_year as c1, accelerator_id, browser_id from accelerator_compatible_browser where c1 < 2005 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "browser_web",
"sql": "select distinct compatible_since_year as c1, accelerator_id, browser_id from accelerator_compatible_browser where c1 < 2005"
},
"style": "rule"
} | {
"index": 1213,
"split": "train"
} | |
According to the ranking of maintenance contracts based on the average of their IDs for assets acquired after November 25, 2017, what is the maintenance contract ID that ranks sixth in this order? | assets_maintenance | select t1.c5, t1.c2 as c3 from (select row_number() over (order by t0.c4 asc nulls last) as c5, t0.c0 as c2 from (select t0.maintenance_contract_id as c0, avg(t1.maintenance_contract_id) as c4 from maintenance_contracts as t0 join assets as t1 on t0.maintenance_contract_id = t1.maintenance_contract_id where t1.asset_ac... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 t1.c5, t1.c2 as c3 from (select row_number() over (order by t0.c4 asc nulls last) as c5, t0.c0 as c2 from (select t0.maintenance_contract_id as c0, avg(t1.maintenance_contract_id) as c4 from maintenance_contracts as t0 join assets as t1 on t0.m... | {
"index": 3461,
"split": "train"
} | |
What are the restaurant type IDs and names, including all restaurant types and the types of restaurants visited by student 1008? | restaurant_1 | select anon_1.c0, anon_1.c1 from (select restypeid as c0, restypename as c1 from restaurant_type union select t0.restypeid as c0, t0.restypename as c1 from restaurant_type as t0 join type_of_restaurant as t1 on t0.restypeid = t1.restypeid join restaurant as t2 on t1.resid = t2.resid join visits_restaurant as t3 on t2.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": "restaurant_1",
"sql": "select anon_1.c0, anon_1.c1 from (select restypeid as c0, restypename as c1 from restaurant_type union select t0.restypeid as c0, t0.restypename as c1 from restaurant_type as t0 join type_of_restaurant as t1 on t0.restypeid = t1.restypeid join restaurant as... | {
"index": 2981,
"split": "train"
} | |
Did Customer 6 become a customer after Customer 1? | customer_deliveries | select t1.c2 > t0.c2 from (select date_became_customer as c2 from customers where customer_id = 6) as t1, (select date_became_customer as c2 from customers where customer_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": "customer_deliveries",
"sql": "select t1.c2 > t0.c2 from (select date_became_customer as c2 from customers where customer_id = 6) as t1, (select date_became_customer as c2 from customers where customer_id = 1) as t0"
},
"style": "rule"
} | {
"index": 3073,
"split": "train"
} | |
What are the details, names, and IDs of characteristics linked to product 12, along with how many times each characteristic appears, limited to those associated four times or fewer? | products_gen_characteristics | select t0.other_characteristic_details, t0.characteristic_name, t0.characteristic_id as c3, count(*) as c2 from characteristics as t0 join product_characteristics as t1 on t0.characteristic_id = t1.characteristic_id where t1.product_id = 12 group by c3 having c2 <= 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": "products_gen_characteristics",
"sql": "select t0.other_characteristic_details, t0.characteristic_name, t0.characteristic_id as c3, count(*) as c2 from characteristics as t0 join product_characteristics as t1 on t0.characteristic_id = t1.characteristic_id where t1.product_id = 12 ... | {
"index": 1114,
"split": "train"
} | |
Which customers with complaints involving customer ID 116 have not had their issues handled by any staff members listed in the Staff table? Specifically, what are their email addresses and customer type codes? | customer_complaints | select anon_1.c1, anon_1.c2 from (select t0.email_address as c1, t0.customer_type_code as c2 from customers as t0 join complaints as t1 on t0.customer_id = t1.customer_id where t1.customer_id = 116 except select t0.email_address as c1, t0.customer_type_code as c2 from customers as t0 join complaints as t1 on t0.custome... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customer_complaints",
"sql": "select anon_1.c1, anon_1.c2 from (select t0.email_address as c1, t0.customer_type_code as c2 from customers as t0 join complaints as t1 on t0.customer_id = t1.customer_id where t1.customer_id = 116 except select t0.email_address as c1, t0.customer_ty... | {
"index": 1236,
"split": "train"
} | |
What are the first 10 Wi-Fi options—specifically 'No' or '802.11b'—with the highest number of unique phone models, listed alphabetically by Wi-Fi type? | phone_1 | select wifi as c0, count(distinct (model_name)) from chip_model where c0 = 'No' or c0 = '802.11b' group by c0 order by c0 asc nulls last limit 10 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "phone_1",
"sql": "select wifi as c0, count(distinct (model_name)) from chip_model where c0 = 'No' or c0 = '802.11b' group by c0 order by c0 asc nulls last limit 10"
},
"style": "rule"
} | {
"index": 1997,
"split": "train"
} | |
Which employees' IDs and salaries are not associated with aircraft having aid 2? | flight_1 | select anon_1.c0, anon_1.c1 from (select eid as c0, salary as c1 from employee except select t0.eid as c0, t0.salary as c1 from employee as t0 join certificate as t1 on t0.eid = t1.eid join aircraft as t2 on t1.aid = t2.aid where t2.aid = 2) 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": "flight_1",
"sql": "select anon_1.c0, anon_1.c1 from (select eid as c0, salary as c1 from employee except select t0.eid as c0, t0.salary as c1 from employee as t0 join certificate as t1 on t0.eid = t1.eid join aircraft as t2 on t1.aid = t2.aid where t2.aid = 2) as anon_1"
},
"... | {
"index": 1166,
"split": "train"
} | |
How many students does the Electrical Engineering department have compared to 108? | college_2 | select t0.c2 - 108 from (select count(distinct (t1.id)) as c2 from department as t0 join student as t1 on t0.dept_name = t1.dept_name where t0.dept_name = 'Elec. Eng.' group by t0.dept_name) 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_2",
"sql": "select t0.c2 - 108 from (select count(distinct (t1.id)) as c2 from department as t0 join student as t1 on t0.dept_name = t1.dept_name where t0.dept_name = 'Elec. Eng.' group by t0.dept_name) as t0"
},
"style": "rule"
} | {
"index": 3215,
"split": "train"
} | |
What are the color, mountain ID, name, photo ID, and camera lens ID for all photos, including those taken with lenses whose brand ends with "a"? | mountain_photos | select anon_1.c2, anon_1.c3, anon_1.c1, anon_1.c0, anon_1.c4 from (select color as c2, mountain_id as c3, name as c1, id as c0, camera_lens_id as c4 from photos union select t0.color as c2, t0.mountain_id as c3, t0.name as c1, t0.id as c0, t0.camera_lens_id as c4 from photos as t0 join camera_lens as t1 on t0.camera_le... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "mountain_photos",
"sql": "select anon_1.c2, anon_1.c3, anon_1.c1, anon_1.c0, anon_1.c4 from (select color as c2, mountain_id as c3, name as c1, id as c0, camera_lens_id as c4 from photos union select t0.color as c2, t0.mountain_id as c3, t0.name as c1, t0.id as c0, t0.camera_lens... | {
"index": 1530,
"split": "train"
} | |
Which team names, their team IDs, draft pick numbers, and players are associated with countries whose capitals are either Baghdad or Jakarta? | match_season | select t0.name, t0.team_id, t1.draft_pick_number, t1.player from team as t0 join match_season as t1 on t0.team_id = t1.team join country as t2 on t1.country = t2.country_id where t2.capital = 'Baghdad' or t2.capital = 'Jakarta' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 t0.name, t0.team_id, t1.draft_pick_number, t1.player from team as t0 join match_season as t1 on t0.team_id = t1.team join country as t2 on t1.country = t2.country_id where t2.capital = 'Baghdad' or t2.capital = 'Jakarta'"
},
"style": "rule"
} | {
"index": 1242,
"split": "train"
} | |
What is the percentage change in the total customer activity or record count for customer 19 between their move-in date in March 2015 and their move-in date in September 2016? | local_govt_and_lot | select (t0.c0 / cast(t1.c0 as real) - 1) * 100 from (select sum(t1.customer_id) as c0 from customers as t0 join customer_events as t1 on t0.customer_id = t1.customer_id where t0.customer_id = 19 and t1.date_moved_in = '2015-03-27 12:00:00' group by t0.customer_id) as t0, (select t0.customer_id, sum(t1.customer_id) 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": "local_govt_and_lot",
"sql": "select (t0.c0 / cast(t1.c0 as real) - 1) * 100 from (select sum(t1.customer_id) as c0 from customers as t0 join customer_events as t1 on t0.customer_id = t1.customer_id where t0.customer_id = 19 and t1.date_moved_in = '2015-03-27 12:00:00' group by t0... | {
"index": 3956,
"split": "train"
} | |
What are the highest IDs for the amenities in Has_amenity and Dorm_amenity tables associated with amenities named "4 Walls" or beginning with "Allo"? | dorm_1 | select max(t0.amenid), t1.amenid as c0 from has_amenity as t0 join dorm_amenity as t1 on t0.amenid = t1.amenid where t1.amenity_name = '4 Walls' or t1.amenity_name like 'Allo%' 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": "dorm_1",
"sql": "select max(t0.amenid), t1.amenid as c0 from has_amenity as t0 join dorm_amenity as t1 on t0.amenid = t1.amenid where t1.amenity_name = '4 Walls' or t1.amenity_name like 'Allo%' group by c0"
},
"style": "rule"
} | {
"index": 23,
"split": "train"
} | |
What is the number of credits for the course with ID 647? | college_2 | select credits from course where course_id = 647 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "college_2",
"sql": "select credits from course where course_id = 647"
},
"style": "rule"
} | {
"index": 3361,
"split": "train"
} | |
Find the first five records of dorm amenities and dorm IDs for dorms numbered between 117 and 140, sorted by the dorm ID. | dorm_1 | select t0.dormid as c0, t0.amenid, t1.dormid from has_amenity as t0 join dorm as t1 on t0.dormid = t1.dormid join lives_in as t2 on t1.dormid = t2.dormid where t2.dormid between 117 and 140 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": "dorm_1",
"sql": "select t0.dormid as c0, t0.amenid, t1.dormid from has_amenity as t0 join dorm as t1 on t0.dormid = t1.dormid join lives_in as t2 on t1.dormid = t2.dormid where t2.dormid between 117 and 140 order by c0 asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 2460,
"split": "train"
} | |
How many days are there between the hire date and date of birth for employees whose first names start with "H"? | college_1 | select julianday(t1.c2) - julianday(t0.c0) from (select emp_hiredate as c2 from employee where emp_fname like 'H%' and emp_fname like 'H%') 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 where emp_fname like 'H%' and emp_fname like 'H%') as t1, (select emp_dob as c0 from employee) as t0"
},
"style": "rule"
} | {
"index": 3678,
"split": "train"
} | |
List the number of stories, building name, status, company ID, and building ID for companies whose profits are around 19 billion dollars, including those with profits of 18.8 billion or up to 19.9 billion dollars. | company_office | select t0.stories, t0.name, t0.status, t1.company_id, t1.building_id from buildings as t0 join office_locations as t1 on t0.id = t1.building_id join companies as t2 on t1.company_id = t2.id where t2.profits_billion = 18.8 or t2.profits_billion <= 19.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": "company_office",
"sql": "select t0.stories, t0.name, t0.status, t1.company_id, t1.building_id from buildings as t0 join office_locations as t1 on t0.id = t1.building_id join companies as t2 on t1.company_id = t2.id where t2.profits_billion = 18.8 or t2.profits_billion <= 19.9"
... | {
"index": 2862,
"split": "train"
} | |
Find the school ID and name of the school where driver with ID 3 is assigned, showing only the first such school when sorted alphabetically by school name. | school_bus | select t0.school_id, t0.school as c1 from school as t0 join school_bus as t1 on t0.school_id = t1.school_id join driver as t2 on t1.driver_id = t2.driver_id where t2.driver_id = 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": "school_bus",
"sql": "select t0.school_id, t0.school as c1 from school as t0 join school_bus as t1 on t0.school_id = t1.school_id join driver as t2 on t1.driver_id = t2.driver_id where t2.driver_id = 3 order by c1 asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 718,
"split": "train"
} | |
Which three members, whose purchases were made at branches with names containing "o", are listed from their hometowns starting with the last alphabet letter, and what are their hometowns, membership levels, and card numbers? | shop_membership | select t0.hometown as c1, t0.level, t0.card_number from member as t0 join purchase as t1 on t0.member_id = t1.member_id join branch as t2 on t1.branch_id = t2.branch_id where t2.name like '%o%' order by c1 desc limit 3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "shop_membership",
"sql": "select t0.hometown as c1, t0.level, t0.card_number from member as t0 join purchase as t1 on t0.member_id = t1.member_id join branch as t2 on t1.branch_id = t2.branch_id where t2.name like '%o%' order by c1 desc limit 3"
},
"style": "rule"
} | {
"index": 2649,
"split": "train"
} | |
Which catalog entry IDs and catalog levels correspond to the least common catalog level among catalog IDs up to 8? | product_catalog | select t0.catalog_entry_id, t0.catalog_level_number from catalog_contents_additional_attributes as t0 join catalog_structure as t1 on t0.catalog_level_number = t1.catalog_level_number, (select catalog_level_number as c0 from catalog_structure where catalog_id <= 8 group by c0 order by count(*) asc nulls last limit 1) 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": "product_catalog",
"sql": "select t0.catalog_entry_id, t0.catalog_level_number from catalog_contents_additional_attributes as t0 join catalog_structure as t1 on t0.catalog_level_number = t1.catalog_level_number, (select catalog_level_number as c0 from catalog_structure where catal... | {
"index": 187,
"split": "train"
} | |
What is the highest staff ID involved in rentals made by customer 174 for inventory items numbered between 21 and 2685? | sakila_1 | select t0.c2 from (select max(t1.staff_id) as c2 from customer as t0 join rental as t1 on t0.customer_id = t1.customer_id where t0.customer_id = 174 and t1.inventory_id between 21 and 2685 group by t0.customer_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": "sakila_1",
"sql": "select t0.c2 from (select max(t1.staff_id) as c2 from customer as t0 join rental as t1 on t0.customer_id = t1.customer_id where t0.customer_id = 174 and t1.inventory_id between 21 and 2685 group by t0.customer_id) as t0"
},
"style": "rule"
} | {
"index": 3914,
"split": "train"
} | |
What are the hours of projects that either end with 't3' or are the least common based on the number of assigned scientists, selecting the one with the fewest hours? | scientist_1 | select t0.hours as c1 from projects as t0, (select code as c0 from projects group by c0 order by count(*) asc nulls last limit 1) as t0 where t0.code like '%t3' or t0.code = t0.c0 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": "scientist_1",
"sql": "select t0.hours as c1 from projects as t0, (select code as c0 from projects group by c0 order by count(*) asc nulls last limit 1) as t0 where t0.code like '%t3' or t0.code = t0.c0 order by c1 asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 693,
"split": "train"
} | |
When did the race with the highest circuit ID among those with a date containing '5' take place, and what was the race time? | formula_1 | select t0.time, t0.circuitid as c3 from races as t0, (select max(circuitid) as c0 from races where date like '%5%') as t1 where c3 = 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": "formula_1",
"sql": "select t0.time, t0.circuitid as c3 from races as t0, (select max(circuitid) as c0 from races where date like '%5%') as t1 where c3 = t1.c0"
},
"style": "rule"
} | {
"index": 3774,
"split": "train"
} | |
What are the descriptions, titles, and rental rates of the first three films when ordered alphabetically by description, along with the number of unique staff members who have rented each film and the highest customer ID who rented each film? | sakila_1 | select t0.description as c4, t0.title, t0.rental_rate, count(distinct (t2.staff_id)), max(t2.customer_id) from film as t0 join inventory as t1 on t0.film_id = t1.film_id join rental as t2 on t1.inventory_id = t2.inventory_id group by t0.film_id order by c4 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": "sakila_1",
"sql": "select t0.description as c4, t0.title, t0.rental_rate, count(distinct (t2.staff_id)), max(t2.customer_id) from film as t0 join inventory as t1 on t0.film_id = t1.film_id join rental as t2 on t1.inventory_id = t2.inventory_id group by t0.film_id order by c4 asc ... | {
"index": 2479,
"split": "train"
} | |
Which gender and rank combinations are associated with coaches but do not appear among players? | riding_club | select anon_1.c0, anon_1.c2 from (select gender as c0, rank as c2 from coach except select gender, rank from player) 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": "riding_club",
"sql": "select anon_1.c0, anon_1.c2 from (select gender as c0, rank as c2 from coach except select gender, rank from player) as anon_1"
},
"style": "rule"
} | {
"index": 291,
"split": "train"
} | |
What are the country, id, and prominence of the top 3 photos' mountains, along with each photo's mountain id and name, for photos taken with camera lenses whose names are not mountain names, ordered by photo name from Z to A? | mountain_photos | select t0.country, t0.id, t0.prominence, t1.mountain_id, t1.name as c0 from mountain as t0 join photos as t1 on t0.id = t1.mountain_id join camera_lens as t2 on t1.camera_lens_id = t2.id where (not t2.name in (select t0.name as c5 from mountain)) order by c0 desc limit 3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "mountain_photos",
"sql": "select t0.country, t0.id, t0.prominence, t1.mountain_id, t1.name as c0 from mountain as t0 join photos as t1 on t0.id = t1.mountain_id join camera_lens as t2 on t1.camera_lens_id = t2.id where (not t2.name in (select t0.name as c5 from mountain)) order b... | {
"index": 2784,
"split": "train"
} | |
Can you find the address ID, last name, and active status of customers who rented a movie on August 19, 2005, at 8:44 PM, and whose rental was processed by staff members with IDs higher than the average staff ID for rentals made by customers with IDs 455 or above? | sakila_1 | select t0.address_id, t0.last_name, t0.active from customer as t0 join rental as t1 on t0.customer_id = t1.customer_id, (select avg(staff_id) as c0 from rental where customer_id >= 455) as t0 where t1.rental_date = '2005-08-19 20:44:00' and t1.staff_id > t0.c0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "sakila_1",
"sql": "select t0.address_id, t0.last_name, t0.active from customer as t0 join rental as t1 on t0.customer_id = t1.customer_id, (select avg(staff_id) as c0 from rental where customer_id >= 455) as t0 where t1.rental_date = '2005-08-19 20:44:00' and t1.staff_id > t0.c0"... | {
"index": 1243,
"split": "train"
} | |
When does the most recent valid-to date occur for the customer with the highest customer ID who has a debit card? | customers_card_transactions | select t0.date_valid_to, t0.customer_id as c0 from customers_cards as t0, (select max(customer_id) as c3 from customers_cards where card_type_code = 'Debit') 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": "customers_card_transactions",
"sql": "select t0.date_valid_to, t0.customer_id as c0 from customers_cards as t0, (select max(customer_id) as c3 from customers_cards where card_type_code = 'Debit') as t1 where c0 = t1.c3"
},
"style": "rule"
} | {
"index": 3762,
"split": "train"
} | |
Which authors or editors are associated with book clubs that are linked to companies incorporated in China? | culture_company | select t0.author_or_editor from book_club as t0 join culture_company as t1 on t0.book_club_id = t1.book_club_id where t1.incorporated_in = 'China' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "culture_company",
"sql": "select t0.author_or_editor from book_club as t0 join culture_company as t1 on t0.book_club_id = t1.book_club_id where t1.incorporated_in = 'China'"
},
"style": "rule"
} | {
"index": 2616,
"split": "train"
} | |
What are the restaurant type IDs, restaurant IDs, student IDs, and visited restaurant IDs for all visits made by male students? | restaurant_1 | select t0.restypeid, t0.resid, t2.stuid, t2.resid from type_of_restaurant as t0 join restaurant as t1 on t0.resid = t1.resid join visits_restaurant as t2 on t1.resid = t2.resid join student as t3 on t2.stuid = t3.stuid where t3.sex like '%M' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "restaurant_1",
"sql": "select t0.restypeid, t0.resid, t2.stuid, t2.resid from type_of_restaurant as t0 join restaurant as t1 on t0.resid = t1.resid join visits_restaurant as t2 on t1.resid = t2.resid join student as t3 on t2.stuid = t3.stuid where t3.sex like '%M'"
},
"style"... | {
"index": 2569,
"split": "train"
} | |
What are the Form IDs and Form Type Codes for all forms, including those linked to the service with ID 10? | e_government | select anon_1.c1, anon_1.c0 from (select form_id as c1, form_type_code as c0 from forms union select t0.form_id as c1, t0.form_type_code as c0 from forms as t0 join party_forms as t1 on t0.form_id = t1.form_id join parties as t2 on t1.party_id = t2.party_id join party_services as t3 on t2.party_id = t3.customer_id join... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "e_government",
"sql": "select anon_1.c1, anon_1.c0 from (select form_id as c1, form_type_code as c0 from forms union select t0.form_id as c1, t0.form_type_code as c0 from forms as t0 join party_forms as t1 on t0.form_id = t1.form_id join parties as t2 on t1.party_id = t2.party_id... | {
"index": 2183,
"split": "train"
} | |
What is the product ID and category code for the product with ID 120? | customer_complaints | select product_id as c1, product_category_code from products where c1 = 120 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customer_complaints",
"sql": "select product_id as c1, product_category_code from products where c1 = 120"
},
"style": "rule"
} | {
"index": 2632,
"split": "train"
} | |
What is the first Book Club ID, author or editor, and publisher for the company named Culture China, along with the associated book club ID, when sorted by the book club ID? | culture_company | select t0.book_club_id, t0.author_or_editor, t0.publisher, t1.book_club_id as c1 from book_club as t0 join culture_company as t1 on t0.book_club_id = t1.book_club_id where t1.company_name = 'Culture China' 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": "culture_company",
"sql": "select t0.book_club_id, t0.author_or_editor, t0.publisher, t1.book_club_id as c1 from book_club as t0 join culture_company as t1 on t0.book_club_id = t1.book_club_id where t1.company_name = 'Culture China' order by c1 asc nulls last limit 1"
},
"styl... | {
"index": 2043,
"split": "train"
} | |
For each player name that appears more than four times, what is the number of unique IDs, the tallest height, and the average of their player API IDs? | soccer_1 | select player_name as c3, count(distinct (id)), max(height), avg(player_api_id) from player group by c3 having count(*) > 4 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "soccer_1",
"sql": "select player_name as c3, count(distinct (id)), max(height), avg(player_api_id) from player group by c3 having count(*) > 4"
},
"style": "rule"
} | {
"index": 2239,
"split": "train"
} | |
What is the difference between the total number of student IDs who received a grade of 'B' in any course and the total number of student IDs who received an 'A' grade specifically in courses ending with '325'? | college_3 | select t1.c0 - t0.c0 from (select sum(t1.stuid) as c0 from gradeconversion as t0 join enrolled_in as t1 on t0.lettergrade = t1.grade where t0.lettergrade = 'A' and t1.cid like '%325' group by t0.lettergrade) as t1, (select t0.lettergrade, sum(t1.stuid) as c0 from gradeconversion as t0 join enrolled_in as t1 on t0.lette... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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.c0 - t0.c0 from (select sum(t1.stuid) as c0 from gradeconversion as t0 join enrolled_in as t1 on t0.lettergrade = t1.grade where t0.lettergrade = 'A' and t1.cid like '%325' group by t0.lettergrade) as t1, (select t0.lettergrade, sum(t1.stuid) as c0 f... | {
"index": 3589,
"split": "train"
} | |
What are the friends whose total friendship years with people ending with "Alice" and whose names start with "Za" add up to more than five years? | network_2 | select friend as c0, sum(year) from personfriend where c0 like '%Alice' and name like 'Za%' group by c0 having sum(year) > 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": "network_2",
"sql": "select friend as c0, sum(year) from personfriend where c0 like '%Alice' and name like 'Za%' group by c0 having sum(year) > 5"
},
"style": "rule"
} | {
"index": 797,
"split": "train"
} | |
Did the number of researchers, measured by unique staff members, increase or decrease by a greater percentage between December 16, 2004, and February 2, 2007, than the overall change (across all staff roles) from the start date of October 9, 1981, up to February 2, 2007? | tracking_grants_for_research | select t5.c2 > t2.c0 from (select abs((t3.c1 / cast(t4.c1 as real) - 1) * 100) as c2 from (select count(distinct (t1.staff_id)) as c1 from staff_roles as t0 join project_staff as t1 on t0.role_code = t1.role_code where t0.role_code = 'researcher' and t1.date_to = '2007-02-02 17:26:02' group by t0.role_code) as t3, (sel... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 t5.c2 > t2.c0 from (select abs((t3.c1 / cast(t4.c1 as real) - 1) * 100) as c2 from (select count(distinct (t1.staff_id)) as c1 from staff_roles as t0 join project_staff as t1 on t0.role_code = t1.role_code where t0.role_code = 'resear... | {
"index": 3450,
"split": "train"
} | |
Show the names, locations, and leaders of colleges that have members with a college ID of 2 or higher, excluding those colleges whose member is named Jack Nicklaus. | decoration_competition | select anon_1.c1, anon_1.c2, anon_1.c0 from (select t0.name as c1, t0.college_location as c2, t0.leader_name as c0 from college as t0 join member as t1 on t0.college_id = t1.college_id where t1.college_id >= 2 except select t0.name as c1, t0.college_location as c2, t0.leader_name as c0 from college as t0 join member as... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "decoration_competition",
"sql": "select anon_1.c1, anon_1.c2, anon_1.c0 from (select t0.name as c1, t0.college_location as c2, t0.leader_name as c0 from college as t0 join member as t1 on t0.college_id = t1.college_id where t1.college_id >= 2 except select t0.name as c1, t0.colle... | {
"index": 640,
"split": "train"
} | |
Is the percentage change in the total customer ID sum for customer 113 on February 10, 1973, greater than the overall percentage change across all customers involved in complaints handled by staff 117 on the same date? | customer_complaints | select abs((t2.c3 / cast(t2.c3 as real) - 1) * 100) > t1.c0 from (select sum(t1.customer_id) as c3 from customers as t0 join complaints as t1 on t0.customer_id = t1.customer_id where t0.customer_id = 113 and t1.date_complaint_raised = '1973-02-10 22:55:56' group by t0.customer_id) as t2, (select abs((sum(t0.c3) / cast(... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customer_complaints",
"sql": "select abs((t2.c3 / cast(t2.c3 as real) - 1) * 100) > t1.c0 from (select sum(t1.customer_id) as c3 from customers as t0 join complaints as t1 on t0.customer_id = t1.customer_id where t0.customer_id = 113 and t1.date_complaint_raised = '1973-02-10 22:... | {
"index": 3437,
"split": "train"
} | |
What is the percentage change in the average grant ID for 'REG' documents sent on July 26, 2002, compared to those sent on February 19, 1993, considering only responses received after May 18, 1986? | tracking_grants_for_research | select (t0.c2 / cast(t1.c2 as real) - 1) * 100 from (select avg(t1.grant_id) as c2 from document_types as t0 join documents as t1 on t0.document_type_code = t1.document_type_code where t0.document_type_code = 'REG' and t1.sent_date = '2002-07-26 15:50:28' and t1.response_received_date > '1986-05-18 01:54:56' group by 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": "tracking_grants_for_research",
"sql": "select (t0.c2 / cast(t1.c2 as real) - 1) * 100 from (select avg(t1.grant_id) as c2 from document_types as t0 join documents as t1 on t0.document_type_code = t1.document_type_code where t0.document_type_code = 'REG' and t1.sent_date = '2002-0... | {
"index": 3426,
"split": "train"
} | |
Show the negative values and, for each, the count of unique negatives and the total number of affirmatives, specifically focusing on where the negative value is 6. List the first five such entries, ordered by the negative value. | debate | select negative as c0, count(distinct (negative)), count(affirmative) from debate_people where c0 = 6 group by c0 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": "debate",
"sql": "select negative as c0, count(distinct (negative)), count(affirmative) from debate_people where c0 = 6 group by c0 order by c0 asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 256,
"split": "train"
} | |
When was the flight with aid less than or equal to 10 offered at the highest price? | flight_1 | select t0.departure_date, t0.price as c0 from flight as t0, (select max(price) as c2 from flight where aid <= 10) as t1 where c0 = t1.c2 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "flight_1",
"sql": "select t0.departure_date, t0.price as c0 from flight as t0, (select max(price) as c2 from flight where aid <= 10) as t1 where c0 = t1.c2"
},
"style": "rule"
} | {
"index": 3773,
"split": "train"
} | |
What are the top 10 customers with the highest savings balances, whose checking accounts have a balance of exactly 77.0, along with their customer IDs and names? | small_bank_1 | select t0.balance as c0, t0.custid, t1.name from savings as t0 join accounts as t1 on t0.custid = t1.custid join checking as t2 on t1.custid = t2.custid where t2.balance = 77.0 order by c0 desc limit 10 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "small_bank_1",
"sql": "select t0.balance as c0, t0.custid, t1.name from savings as t0 join accounts as t1 on t0.custid = t1.custid join checking as t2 on t1.custid = t2.custid where t2.balance = 77.0 order by c0 desc limit 10"
},
"style": "rule"
} | {
"index": 1514,
"split": "train"
} | |
What is the catalog ID, publication date, name, the number of unique next entry IDs, and the number of unique catalog levels for the catalog with the smallest catalog ID? | product_catalog | select t0.catalog_id as c1, t0.date_of_publication, t0.catalog_name, count(distinct (t2.next_entry_id)), count(distinct (t2.catalog_level_number)) from catalogs as t0 join catalog_structure as t1 on t0.catalog_id = t1.catalog_id join catalog_contents as t2 on t1.catalog_level_number = t2.catalog_level_number group by c... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "product_catalog",
"sql": "select t0.catalog_id as c1, t0.date_of_publication, t0.catalog_name, count(distinct (t2.next_entry_id)), count(distinct (t2.catalog_level_number)) from catalogs as t0 join catalog_structure as t1 on t0.catalog_id = t1.catalog_id join catalog_contents as ... | {
"index": 1653,
"split": "train"
} | |
What is the difference between the lowest amenity ID associated with dorm 109 and the number 901? | dorm_1 | select t0.c1 - 901 from (select min(t1.amenid) as c1 from dorm as t0 join has_amenity as t1 on t0.dormid = t1.dormid where t0.dormid = 109 group by t0.dormid) 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": "dorm_1",
"sql": "select t0.c1 - 901 from (select min(t1.amenid) as c1 from dorm as t0 join has_amenity as t1 on t0.dormid = t1.dormid where t0.dormid = 109 group by t0.dormid) as t0"
},
"style": "rule"
} | {
"index": 3231,
"split": "train"
} | |
For dorm 104, among the amenities with amenid less than 931, which one is associated the most times, and what is that number? | dorm_1 | select count(t0.amenid) as c0 from dorm_amenity as t0 join has_amenity as t1 on t0.amenid = t1.amenid where t1.dormid = 104 and t1.amenid < 931 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": "dorm_1",
"sql": "select count(t0.amenid) as c0 from dorm_amenity as t0 join has_amenity as t1 on t0.amenid = t1.amenid where t1.dormid = 104 and t1.amenid < 931 order by c0 desc limit 1"
},
"style": "rule"
} | {
"index": 989,
"split": "train"
} | |
Which users with the role of project manager or any role ending with "DBA" have unique combinations of usernames and passwords? | document_management | select distinct user_name, password from users where role_code = 'PROJ-MGR' or role_code like '%DBA' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 distinct user_name, password from users where role_code = 'PROJ-MGR' or role_code like '%DBA'"
},
"style": "rule"
} | {
"index": 129,
"split": "train"
} | |
Did student 141 attend course 302 before attending course 301 within the date range from May 9, 2012, to April 9, 2015? | student_assessment | select t1.c0 < t0.c0 from (select date_of_attendance as c0 from student_course_attendance where student_id = 141 and course_id = 302) as t1, (select date_of_attendance as c0 from student_course_attendance where student_id = 141 and course_id = 301 and c0 between '2012-05-09 11:44:34' and '2015-04-09 11:44:34') 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": "student_assessment",
"sql": "select t1.c0 < t0.c0 from (select date_of_attendance as c0 from student_course_attendance where student_id = 141 and course_id = 302) as t1, (select date_of_attendance as c0 from student_course_attendance where student_id = 141 and course_id = 301 and... | {
"index": 3148,
"split": "train"
} | |
Who are the customers with fewer than two orders who pay using a method that ends with "Card," and what is the number of their orders along with their payment method and customer ID? And among them, who are the three customers with the fewest orders? | customers_and_addresses | select count(*) as c1, t0.payment_method as c2, t0.customer_id as c0 from customers as t0 join customer_orders as t1 on t0.customer_id = t1.customer_id where c2 like '%Card' group by c0 having c1 < 2 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": "customers_and_addresses",
"sql": "select count(*) as c1, t0.payment_method as c2, t0.customer_id as c0 from customers as t0 join customer_orders as t1 on t0.customer_id = t1.customer_id where c2 like '%Card' group by c0 having c1 < 2 order by c1 asc nulls last limit 3"
},
"st... | {
"index": 1800,
"split": "train"
} | |
Can you list the descriptions of the problems, the dates they were reported, the IDs of the staff who reported them, and the first names of staff members who authorized their closure, specifically for those staff whose last name ends with "Treutel"? | tracking_software_problems | select t0.problem_description, t0.date_problem_reported, t0.reported_by_staff_id, t1.staff_first_name from problems as t0 join staff as t1 on t0.closure_authorised_by_staff_id = t1.staff_id where t1.staff_last_name like '%Treutel' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_software_problems",
"sql": "select t0.problem_description, t0.date_problem_reported, t0.reported_by_staff_id, t1.staff_first_name from problems as t0 join staff as t1 on t0.closure_authorised_by_staff_id = t1.staff_id where t1.staff_last_name like '%Treutel'"
},
"sty... | {
"index": 2182,
"split": "train"
} | |
Which product names are associated with products that have a product ID greater than 4? | tracking_software_problems | select t0.product_name from product as t0 join problems as t1 on t0.product_id = t1.product_id where t1.product_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": "tracking_software_problems",
"sql": "select t0.product_name from product as t0 join problems as t1 on t0.product_id = t1.product_id where t1.product_id > 4"
},
"style": "rule"
} | {
"index": 2093,
"split": "train"
} | |
What are the top three counts of products, the highest product price, and the total number of product names for products whose names start with "Tra" and have prices between 970.77 and 3541.17, sorted by the number of matching products? | solvency_ii | select count(*) as c2, max(product_price), count(product_name) from products where product_name like 'Tra%' and product_price between 970.77 and 3541.17 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": "solvency_ii",
"sql": "select count(*) as c2, max(product_price), count(product_name) from products where product_name like 'Tra%' and product_price between 970.77 and 3541.17 order by c2 desc limit 3"
},
"style": "rule"
} | {
"index": 1977,
"split": "train"
} | |
Is the invoice date for invoice number 15 earlier than the invoice date for invoice number 12? | customers_and_invoices | select t1.c2 < t0.c2 from (select invoice_date as c2 from invoices where invoice_number = 15) as t1, (select invoice_date as c2 from invoices where invoice_number = 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_invoices",
"sql": "select t1.c2 < t0.c2 from (select invoice_date as c2 from invoices where invoice_number = 15) as t1, (select invoice_date as c2 from invoices where invoice_number = 12) as t0"
},
"style": "rule"
} | {
"index": 3124,
"split": "train"
} | |
Looking at the Customer Complaints data, for each complaint type, what is the first (or earliest) entry showing the total number of complaints, the number of unique dates when complaints were raised, and the sum of staff IDs involved, sorted by complaint type code? | customer_complaints | select complaint_type_code as c0, count(*), count(distinct (date_complaint_raised)), sum(staff_id) from complaints group by c0 order by c0 asc nulls last limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customer_complaints",
"sql": "select complaint_type_code as c0, count(*), count(distinct (date_complaint_raised)), sum(staff_id) from complaints group by c0 order by c0 asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 2858,
"split": "train"
} | |
Which manufacturers have products with names that include "or" but do not have any product with code 7? Please specify their names and revenues.
---
This rephrasing simplifies the language, emphasizes the exclusion of manufacturer with product code 7, and clearly states what information (name and revenue) is requeste... | manufactory_1 | select anon_1.c1, anon_1.c0 from (select t0.name as c1, t0.revenue as c0 from manufacturers as t0 join products as t1 on t0.code = t1.manufacturer where t1.name like '%or%' except select t0.name as c1, t0.revenue as c0 from manufacturers as t0 join products as t1 on t0.code = t1.manufacturer where t1.code = 7) as anon_... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "manufactory_1",
"sql": "select anon_1.c1, anon_1.c0 from (select t0.name as c1, t0.revenue as c0 from manufacturers as t0 join products as t1 on t0.code = t1.manufacturer where t1.name like '%or%' except select t0.name as c1, t0.revenue as c0 from manufacturers as t0 join product... | {
"index": 544,
"split": "train"
} | |
Find all unique premise IDs for addresses that are associated with premises identified as warehouses. | customers_campaigns_ecommerce | select distinct t0.premise_id from customer_addresses as t0 join premises as t1 on t0.premise_id = t1.premise_id where t1.premises_type = 'Warehouse' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_campaigns_ecommerce",
"sql": "select distinct t0.premise_id from customer_addresses as t0 join premises as t1 on t0.premise_id = t1.premise_id where t1.premises_type = 'Warehouse'"
},
"style": "rule"
} | {
"index": 1867,
"split": "train"
} | |
Does user 5 have fewer distinct tweets than the highest number of distinct tweets posted by any user? | twitter_1 | select t2.c1 < t1.c2 from (select count(distinct (t1.id)) as c1 from user_profiles as t0 join tweets as t1 on t0.uid = t1.uid where t0.uid = 5 group by t0.uid) as t2, (select max(t0.c1) as c2 from (select count(distinct (t1.id)) as c1 from user_profiles as t0 join tweets as t1 on t0.uid = t1.uid group by t0.uid) 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 t2.c1 < t1.c2 from (select count(distinct (t1.id)) as c1 from user_profiles as t0 join tweets as t1 on t0.uid = t1.uid where t0.uid = 5 group by t0.uid) as t2, (select max(t0.c1) as c2 from (select count(distinct (t1.id)) as c1 from user_profiles as t0 ... | {
"index": 3326,
"split": "train"
} | |
Retrieve the IDs and genders of the first five architects who built mills with names ending in "le," sorted alphabetically by gender. | architecture | select t0.gender as c0 from architect as t0 join mill as t1 on t0.id = t1.architect_id where t1.name like '%le' 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": "architecture",
"sql": "select t0.gender as c0 from architect as t0 join mill as t1 on t0.id = t1.architect_id where t1.name like '%le' order by c0 asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 2341,
"split": "train"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.