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 |
|---|---|---|---|---|---|---|---|---|
Can you find the checking account balances, customer IDs, and names for customers who have savings balances of exactly 200,000 or more than one billion, ordered by their checking balance with nulls listed last? | small_bank_1 | select t0.balance as c2, t0.custid, t1.name from checking as t0 join accounts as t1 on t0.custid = t1.custid join savings as t2 on t1.custid = t2.custid where t2.balance = 200000.0 or t2.balance > 999999999.0 order by c2 asc nulls last | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "small_bank_1",
"sql": "select t0.balance as c2, t0.custid, t1.name from checking as t0 join accounts as t1 on t0.custid = t1.custid join savings as t2 on t1.custid = t2.custid where t2.balance = 200000.0 or t2.balance > 999999999.0 order by c2 asc nulls last"
},
"style": "rul... | {
"index": 1912,
"split": "train"
} | |
What are the trade names of medicines that interact with the enzyme having ID 5? | medicine_enzyme_interaction | select t0.trade_name from medicine as t0 join medicine_enzyme_interaction as t1 on t0.id = t1.medicine_id where t1.enzyme_id = 5 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "medicine_enzyme_interaction",
"sql": "select t0.trade_name from medicine as t0 join medicine_enzyme_interaction as t1 on t0.id = t1.medicine_id where t1.enzyme_id = 5"
},
"style": "rule"
} | {
"index": 747,
"split": "train"
} | |
Who are the five oldest students, and for each of them, what is the number of their city code entries, the total sum of their adviser IDs, and their maximum age? | voter_2 | select stuid as c3, count(city_code), sum(advisor), max(age) as c2 from student group by c3 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": "voter_2",
"sql": "select stuid as c3, count(city_code), sum(advisor), max(age) as c2 from student group by c3 order by c2 desc limit 5"
},
"style": "rule"
} | {
"index": 564,
"split": "train"
} | |
What is the length and architect ID of the longest bridge, along with the architect's ID associated with mills built by architects with IDs between 2 and 3 or greater than 3, sorted by architect ID in descending order, limited to just one result? | architecture | select t0.length_meters, t0.architect_id, t1.id as c0 from bridge as t0 join architect as t1 on t0.architect_id = t1.id join mill as t2 on t1.id = t2.architect_id where t2.architect_id between 2 and 3 or t2.architect_id > 3 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": "architecture",
"sql": "select t0.length_meters, t0.architect_id, t1.id as c0 from bridge as t0 join architect as t1 on t0.architect_id = t1.id join mill as t2 on t1.id = t2.architect_id where t2.architect_id between 2 and 3 or t2.architect_id > 3 order by c0 desc limit 1"
},
... | {
"index": 2366,
"split": "train"
} | |
What are the locations, days held, and wrestler IDs of wrestlers who have been eliminated with moves that include the letter 'T', but excluding those whose wrestler IDs contain the digit '7'? | wrestler | select anon_1.c2, anon_1.c1, anon_1.c0 from (select t0.location as c2, t0.days_held as c1, t0.wrestler_id as c0 from wrestler as t0 join elimination as t1 on t0.wrestler_id = t1.wrestler_id where t1.elimination_move like '%T%' except select t0.location as c2, t0.days_held as c1, t0.wrestler_id as c0 from wrestler 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": "wrestler",
"sql": "select anon_1.c2, anon_1.c1, anon_1.c0 from (select t0.location as c2, t0.days_held as c1, t0.wrestler_id as c0 from wrestler as t0 join elimination as t1 on t0.wrestler_id = t1.wrestler_id where t1.elimination_move like '%T%' except select t0.location as c2, t... | {
"index": 2762,
"split": "train"
} | |
Which services with ID 7 or greater than or equal to 13 have been provided, and for each of these, what is its name, ID, and the number of unique parties that have received that service? | e_government | select t0.service_name, t0.service_id as c0, count(distinct (t1.service_id)) from services as t0 join party_services as t1 on t0.service_id = t1.service_id where t1.service_id = 7 or t1.service_id >= 13 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": "e_government",
"sql": "select t0.service_name, t0.service_id as c0, count(distinct (t1.service_id)) from services as t0 join party_services as t1 on t0.service_id = t1.service_id where t1.service_id = 7 or t1.service_id >= 13 group by c0"
},
"style": "rule"
} | {
"index": 2056,
"split": "train"
} | |
Which products have IDs less than or equal to 1 or between 8 and 11, and what are their names, IDs, and the number of times they have been ordered? | tracking_orders | select t0.product_name, t0.product_id as c2, count(*) from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_id <= 1 or t1.product_id between 8 and 11 group by c2 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_orders",
"sql": "select t0.product_name, t0.product_id as c2, count(*) from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_id <= 1 or t1.product_id between 8 and 11 group by c2"
},
"style": "rule"
} | {
"index": 2159,
"split": "train"
} | |
What was the end date of the project with the highest project ID among those with project IDs less than 5? | tracking_grants_for_research | select t0.date_to, t0.project_id as c0 from project_staff as t0, (select max(project_id) as c2 from project_staff where project_id < 5) 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": "tracking_grants_for_research",
"sql": "select t0.date_to, t0.project_id as c0 from project_staff as t0, (select max(project_id) as c2 from project_staff where project_id < 5) as t1 where c0 = t1.c2"
},
"style": "rule"
} | {
"index": 3800,
"split": "train"
} | |
Who are the employees involved in circulation history records with copy number 5? Please list their names. | cre_Doc_Control_Systems | select t0.employee_name from employees as t0 join circulation_history as t1 on t0.employee_id = t1.employee_id where t1.copy_number = 5 or t1.copy_number = 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": "cre_Doc_Control_Systems",
"sql": "select t0.employee_name from employees as t0 join circulation_history as t1 on t0.employee_id = t1.employee_id where t1.copy_number = 5 or t1.copy_number = 5"
},
"style": "rule"
} | {
"index": 1494,
"split": "train"
} | |
What is the name, phone number, and ID of the customer with ID 5, along with their lowest address ID? If there are multiple addresses, return the customer details associated with the smallest address ID. | customer_deliveries | select t0.customer_name, t0.customer_phone, t0.customer_id as c3, min(t1.address_id) as c0 from customers as t0 join customer_addresses as t1 on t0.customer_id = t1.customer_id where t1.customer_id = 5 group by c3 order by c0 asc nulls last limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customer_deliveries",
"sql": "select t0.customer_name, t0.customer_phone, t0.customer_id as c3, min(t1.address_id) as c0 from customers as t0 join customer_addresses as t1 on t0.customer_id = t1.customer_id where t1.customer_id = 5 group by c3 order by c0 asc nulls last limit 1"
... | {
"index": 1883,
"split": "train"
} | |
Is the percentage change in the total number of investors involved in 'SALE' transactions for investors with IDs up to 6 between January 28, 1981, and April 7, 2002, greater than the average percentage change across all transaction types over the same period? | tracking_share_transactions | select t5.c3 > t2.c1 from (select abs((t3.c2 / cast(t4.c2 as real) - 1) * 100) as c3 from (select sum(t1.investor_id) as c2 from ref_transaction_types as t0 join transactions as t1 on t0.transaction_type_code = t1.transaction_type_code where t0.transaction_type_code = 'SALE' and t1.date_of_transaction = '1981-01-28 08:... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_share_transactions",
"sql": "select t5.c3 > t2.c1 from (select abs((t3.c2 / cast(t4.c2 as real) - 1) * 100) as c3 from (select sum(t1.investor_id) as c2 from ref_transaction_types as t0 join transactions as t1 on t0.transaction_type_code = t1.transaction_type_code where ... | {
"index": 3876,
"split": "train"
} | |
What are the county ID, percentage of White residents, and city names for cities that are associated with county ID 2? | county_public_safety | select anon_1.c0, anon_1.c1, anon_1.c2 from (select county_id as c0, white as c1, name as c2 from city intersect select t0.county_id as c0, t0.white as c1, t0.name as c2 from city as t0 join county_public_safety as t1 on t0.county_id = t1.county_id where t1.county_id = 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": "county_public_safety",
"sql": "select anon_1.c0, anon_1.c1, anon_1.c2 from (select county_id as c0, white as c1, name as c2 from city intersect select t0.county_id as c0, t0.white as c1, t0.name as c2 from city as t0 join county_public_safety as t1 on t0.county_id = t1.county_id ... | {
"index": 2078,
"split": "train"
} | |
Which members, along with their party IDs and member IDs, are in charge of party events where the in-charge member ID is either 11 or 12, but not those events belonging to parties with IDs less than 3? | party_people | select anon_1.c1, anon_1.c0, anon_1.c2 from (select t0.member_name as c1, t0.party_id as c0, t0.member_id as c2 from member as t0 join party_events as t1 on t0.member_id = t1.member_in_charge_id where t1.member_in_charge_id between 11 and 12 except select t0.member_name as c1, t0.party_id as c0, t0.member_id as c2 from... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "party_people",
"sql": "select anon_1.c1, anon_1.c0, anon_1.c2 from (select t0.member_name as c1, t0.party_id as c0, t0.member_id as c2 from member as t0 join party_events as t1 on t0.member_id = t1.member_in_charge_id where t1.member_in_charge_id between 11 and 12 except select t... | {
"index": 2409,
"split": "train"
} | |
Can you tell me the amount claimed, the date the claim was settled, and the date the claim was made for the settlement records of claim 801, excluding any records that also belong to claim 761? | insurance_policies | select anon_1.c2, anon_1.c0, anon_1.c1 from (select t0.amount_claimed as c2, t0.date_claim_settled as c0, t0.date_claim_made as c1 from settlements as t0 join claims as t1 on t0.claim_id = t1.claim_id where t1.claim_id = 801 except select t0.amount_claimed as c2, t0.date_claim_settled as c0, t0.date_claim_made as c1 fr... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "insurance_policies",
"sql": "select anon_1.c2, anon_1.c0, anon_1.c1 from (select t0.amount_claimed as c2, t0.date_claim_settled as c0, t0.date_claim_made as c1 from settlements as t0 join claims as t1 on t0.claim_id = t1.claim_id where t1.claim_id = 801 except select t0.amount_cl... | {
"index": 1637,
"split": "train"
} | |
Which airlines have routes originating from airports located in cities ending with "lorence" or exactly "Lorain-Elyria," and what are their active status, airline IDs, countries, and the source airports for those routes? | flight_4 | select t0.active, t0.alid, t0.country, t1.src_ap from airlines as t0 join routes as t1 on t0.alid = t1.alid join airports as t2 on t1.src_apid = t2.apid where t2.city like '%lorence' or t2.city = 'Lorain-Elyria' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "flight_4",
"sql": "select t0.active, t0.alid, t0.country, t1.src_ap from airlines as t0 join routes as t1 on t0.alid = t1.alid join airports as t2 on t1.src_apid = t2.apid where t2.city like '%lorence' or t2.city = 'Lorain-Elyria'"
},
"style": "rule"
} | {
"index": 633,
"split": "train"
} | |
What is the difference between the highest customer ID involved in "Product Unusable" complaints for product 117 on July 11, 1987, at 2:40:30 PM? | customer_complaints | select t0.c0 - t0.c0 from (select max(t1.customer_id) as c0 from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t0.product_id = 117 and t1.date_complaint_raised = '1987-07-11 14:40:30' and t1.complaint_type_code = 'Product Unusable' group by t0.product_id) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customer_complaints",
"sql": "select t0.c0 - t0.c0 from (select max(t1.customer_id) as c0 from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t0.product_id = 117 and t1.date_complaint_raised = '1987-07-11 14:40:30' and t1.complaint_type_code = 'Produc... | {
"index": 3517,
"split": "train"
} | |
Which competitions, match IDs, and venues are associated with matches that are hosted in cities starting with "1" and have a match ID greater than 2? | city_record | select anon_1.c1, anon_1.c2, anon_1.c0 from (select t0.competition as c1, t0.match_id as c2, t0.venue as c0 from match as t0 join hosting_city as t1 on t0.match_id = t1.match_id where t1.host_city like '1%' intersect select t0.competition as c1, t0.match_id as c2, t0.venue as c0 from match as t0 join hosting_city as t1... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "city_record",
"sql": "select anon_1.c1, anon_1.c2, anon_1.c0 from (select t0.competition as c1, t0.match_id as c2, t0.venue as c0 from match as t0 join hosting_city as t1 on t0.match_id = t1.match_id where t1.host_city like '1%' intersect select t0.competition as c1, t0.match_id ... | {
"index": 1504,
"split": "train"
} | |
Which people have the same name, hometown, and height as gymnasts who scored exactly 9.687 in the floor exercise and also have the same details as the gymnast with ID 7? | gymnast | select anon_1.c2, anon_1.c1, anon_1.c0 from (select t0.name as c2, t0.hometown as c1, t0.height as c0 from people as t0 join gymnast as t1 on t0.people_id = t1.gymnast_id where t1.floor_exercise_points = 9.687 intersect select t0.name as c2, t0.hometown as c1, t0.height as c0 from people as t0 join gymnast 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": "gymnast",
"sql": "select anon_1.c2, anon_1.c1, anon_1.c0 from (select t0.name as c2, t0.hometown as c1, t0.height as c0 from people as t0 join gymnast as t1 on t0.people_id = t1.gymnast_id where t1.floor_exercise_points = 9.687 intersect select t0.name as c2, t0.hometown as c1, t... | {
"index": 1480,
"split": "train"
} | |
What are the mill IDs, and for each, the associated architect's ID, name, and gender, for architects who designed bridges that are 64.2 meters or shorter, with architect IDs between 2 and 5? | architecture | select t0.id, t0.architect_id, t1.name, t1.gender from mill as t0 join architect as t1 on t0.architect_id = t1.id join bridge as t2 on t1.id = t2.architect_id where t2.length_meters <= 64.2 and t2.architect_id between 2 and 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.id, t0.architect_id, t1.name, t1.gender from mill as t0 join architect as t1 on t0.architect_id = t1.id join bridge as t2 on t1.id = t2.architect_id where t2.length_meters <= 64.2 and t2.architect_id between 2 and 5"
},
"style": "rule"
} | {
"index": 1619,
"split": "train"
} | |
Which are the names of the ten most recent stations where the number of bikes available was greater than or equal to 9? | bike_1 | select t0.name from station as t0 join status as t1 on t0.id = t1.station_id where t1.bikes_available > 9 or t1.bikes_available = 9 order by t0.id desc limit 10 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "bike_1",
"sql": "select t0.name from station as t0 join status as t1 on t0.id = t1.station_id where t1.bikes_available > 9 or t1.bikes_available = 9 order by t0.id desc limit 10"
},
"style": "rule"
} | {
"index": 534,
"split": "train"
} | |
Can you tell me the number of titles associated with each film ID, listed in order from the highest to the lowest film ID? | film_rank | select film_id as c1, count(title) from film group by c1 order by c1 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": "film_rank",
"sql": "select film_id as c1, count(title) from film group by c1 order by c1 desc"
},
"style": "rule"
} | {
"index": 1690,
"split": "train"
} | |
Which vehicle has the most recent (by vehicle details in reverse alphabetical order) details and ID used in lessons with customers who became customers after October 5, 2017? | driving_school | select t0.vehicle_details as c1, t0.vehicle_id from vehicles as t0 join lessons as t1 on t0.vehicle_id = t1.vehicle_id join customers as t2 on t1.customer_id = t2.customer_id where t2.date_became_customer > '2017-10-05 14:15:46' order by c1 desc limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "driving_school",
"sql": "select t0.vehicle_details as c1, t0.vehicle_id from vehicles as t0 join lessons as t1 on t0.vehicle_id = t1.vehicle_id join customers as t2 on t1.customer_id = t2.customer_id where t2.date_became_customer > '2017-10-05 14:15:46' order by c1 desc limit 1"
... | {
"index": 488,
"split": "train"
} | |
What are the city IDs and their highest country IDs for cities in countries with IDs between 11 and 98 or country IDs less than or equal to 11? | sakila_1 | select city_id as c0, max(country_id) from city where country_id between 11 and 98 or country_id <= 11 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": "sakila_1",
"sql": "select city_id as c0, max(country_id) from city where country_id between 11 and 98 or country_id <= 11 group by c0"
},
"style": "rule"
} | {
"index": 1673,
"split": "train"
} | |
How many cinemas were opened in years other than 2011? | cinema | select count(*) from cinema where openning_year != 2011 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 count(*) from cinema where openning_year != 2011"
},
"style": "rule"
} | {
"index": 343,
"split": "train"
} | |
Which login name appears most frequently among students whose family name includes "ar"? | e_learning | select t0.c2 as c0, count(distinct (t0.c1)) as c3 from (select login_name as c2, student_id as c1 from students where family_name like '%ar%') as t0 group by c0 order by c3 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": "e_learning",
"sql": "select t0.c2 as c0, count(distinct (t0.c1)) as c3 from (select login_name as c2, student_id as c1 from students where family_name like '%ar%') as t0 group by c0 order by c3 desc limit 1"
},
"style": "rule"
} | {
"index": 3655,
"split": "train"
} | |
Which products are marked as available or unavailable, along with their product IDs, for bookings that started after either November 6th or December 7th, 2016? | products_for_hire | select t0.available_yn, t0.product_id from view_product_availability as t0 join products_for_hire as t1 on t0.product_id = t1.product_id join products_booked as t2 on t1.product_id = t2.product_id join bookings as t3 on t2.booking_id = t3.booking_id where t3.booking_start_date > '2016-11-06 20:54:26' or t3.booking_star... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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.available_yn, t0.product_id from view_product_availability as t0 join products_for_hire as t1 on t0.product_id = t1.product_id join products_booked as t2 on t1.product_id = t2.product_id join bookings as t3 on t2.booking_id = t3.booking_id wh... | {
"index": 586,
"split": "train"
} | |
What are the service type codes and service IDs for services that participant 26 was involved in through events? | local_govt_in_alabama | select anon_1.c0, anon_1.c1 from (select service_type_code as c0, service_id as c1 from services intersect select t0.service_type_code as c0, t0.service_id as c1 from services as t0 join events as t1 on t0.service_id = t1.service_id join participants_in_events as t2 on t1.event_id = t2.event_id join participants as t3 ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "local_govt_in_alabama",
"sql": "select anon_1.c0, anon_1.c1 from (select service_type_code as c0, service_id as c1 from services intersect select t0.service_type_code as c0, t0.service_id as c1 from services as t0 join events as t1 on t0.service_id = t1.service_id join participan... | {
"index": 2393,
"split": "train"
} | |
What are the details of the five oldest wines that have white grapes, including their appellation, year, and location (county and area)? | wine_1 | select t0.county, t0.area, t1.appelation, t1.year as c1 from appellations as t0 join wine as t1 on t0.appelation = t1.appelation join grapes as t2 on t1.grape = t2.grape where t2.color like '%Wh%' 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": "wine_1",
"sql": "select t0.county, t0.area, t1.appelation, t1.year as c1 from appellations as t0 join wine as t1 on t0.appelation = t1.appelation join grapes as t2 on t1.grape = t2.grape where t2.color like '%Wh%' order by c1 asc nulls last limit 5"
},
"style": "rule"
} | {
"index": 2448,
"split": "train"
} | |
Can you show me the first five submissions, including their submission IDs, scores, and authors, for workshop number 5 held in New York USA? Please order the submissions by their ID, with any null IDs appearing last. | workshop_paper | select t0.submission_id as c0, t0.scores, t0.author from submission as t0 join acceptance as t1 on t0.submission_id = t1.submission_id join workshop as t2 on t1.workshop_id = t2.workshop_id where t2.workshop_id = 5 and t2.venue = 'New York USA' 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": "workshop_paper",
"sql": "select t0.submission_id as c0, t0.scores, t0.author from submission as t0 join acceptance as t1 on t0.submission_id = t1.submission_id join workshop as t2 on t1.workshop_id = t2.workshop_id where t2.workshop_id = 5 and t2.venue = 'New York USA' order by c... | {
"index": 305,
"split": "train"
} | |
Can you tell me the department with the fewest courses, and what are the top three courses from that department (showing department name, course title, and course ID), sorted by department name in reverse alphabetical order? | college_2 | select t0.dept_name as c0, t0.title, t0.course_id from course as t0 join department as t1 on t0.dept_name = t1.dept_name, (select dept_name as c1 from department group by c1 order by count(*) asc nulls last limit 1) as t0 where t1.dept_name = t0.c1 order by c0 desc limit 3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "college_2",
"sql": "select t0.dept_name as c0, t0.title, t0.course_id from course as t0 join department as t1 on t0.dept_name = t1.dept_name, (select dept_name as c1 from department group by c1 order by count(*) asc nulls last limit 1) as t0 where t1.dept_name = t0.c1 order by c0... | {
"index": 430,
"split": "train"
} | |
What is the difference between the average product ID for product 3 and the number 2? | customers_and_addresses | select t0.c0 - 2.0 from (select avg(t1.product_id) as c0 from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t0.product_id = 3 group by t0.product_id) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_and_addresses",
"sql": "select t0.c0 - 2.0 from (select avg(t1.product_id) as c0 from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t0.product_id = 3 group by t0.product_id) as t0"
},
"style": "rule"
} | {
"index": 3224,
"split": "train"
} | |
What are the ten highest station IDs for stations served by train number 4? | train_station | select station_id as c0 from train_station where train_id = 4 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": "train_station",
"sql": "select station_id as c0 from train_station where train_id = 4 order by c0 desc limit 10"
},
"style": "rule"
} | {
"index": 1892,
"split": "train"
} | |
List the product size, name, and color along with the order ID for items where the quantity ordered includes a 2 or a 5. | customers_and_invoices | select t0.product_size, t0.product_name, t0.product_color, t1.order_id from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_quantity like '%2%' or t1.product_quantity like '%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_invoices",
"sql": "select t0.product_size, t0.product_name, t0.product_color, t1.order_id from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_quantity like '%2%' or t1.product_quantity like '%5%'"
},
"style": "rule"
} | {
"index": 2033,
"split": "train"
} | |
For each stadium, what is its name and how many unique capacity percentages are associated with it? | game_injury | select name as c0, count(distinct (capacity_percentage)) from stadium 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": "game_injury",
"sql": "select name as c0, count(distinct (capacity_percentage)) from stadium group by c0"
},
"style": "rule"
} | {
"index": 1730,
"split": "train"
} | |
What are the different countries, cities, and zip codes of staff members who joined the driving school between April 27, 2017, and August 27, 2017, or who joined after November 13, 2016? | driving_school | select distinct t0.country, t0.city, t0.zip_postcode from addresses as t0 join staff as t1 on t0.address_id = t1.staff_address_id where t1.date_joined_staff between '2017-04-27 03:21:26' and '2017-08-27 19:19:44' or t1.date_joined_staff > '2016-11-13 20:44:23' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "driving_school",
"sql": "select distinct t0.country, t0.city, t0.zip_postcode from addresses as t0 join staff as t1 on t0.address_id = t1.staff_address_id where t1.date_joined_staff between '2017-04-27 03:21:26' and '2017-08-27 19:19:44' or t1.date_joined_staff > '2016-11-13 20:4... | {
"index": 1876,
"split": "train"
} | |
Which author has the highest author ID among courses in subject 1, and what is the name of that subject? | e_learning | select t0.author_id as c1, t1.subject_name from courses as t0 join subjects as t1 on t0.subject_id = t1.subject_id where t1.subject_id = 1 order by c1 desc limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "e_learning",
"sql": "select t0.author_id as c1, t1.subject_name from courses as t0 join subjects as t1 on t0.subject_id = t1.subject_id where t1.subject_id = 1 order by c1 desc limit 1"
},
"style": "rule"
} | {
"index": 2324,
"split": "train"
} | |
Which paper has the lowest paper ID among those authored by the most prolific author with a last name starting with "Jame" or "S"? Provide the paper ID and title. | icfp_1 | select t0.paperid as c1, t0.title from papers as t0 join authorship as t1 on t0.paperid = t1.paperid join authors as t2 on t1.authid = t2.authid, (select authid as c2 from authors where lname like 'Jame%' or lname like 'S%' group by c2 order by count(*) desc limit 1) as t0 where t2.authid = t0.c2 order by c1 asc nulls ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "icfp_1",
"sql": "select t0.paperid as c1, t0.title from papers as t0 join authorship as t1 on t0.paperid = t1.paperid join authors as t2 on t1.authid = t2.authid, (select authid as c2 from authors where lname like 'Jame%' or lname like 'S%' group by c2 order by count(*) desc limi... | {
"index": 1816,
"split": "train"
} | |
Can you provide the display configurations—specifically, the graphics mode, type, and hardware colours—and the chip model for up to ten phones that use chip models with RAM sizes between 32MB and 64MB and model names starting with "X51"? Please sort the results alphabetically by the chip model. | phone_1 | select t0.graphics_mode, t0.type, t0.hardware_colours, t1.chip_model as c3 from screen_mode as t0 join phone as t1 on t0.graphics_mode = t1.screen_mode join chip_model as t2 on t1.chip_model = t2.model_name where t2.ram_mib between 32.0 and 64.0 and t2.model_name like 'X51%' order by c3 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 t0.graphics_mode, t0.type, t0.hardware_colours, t1.chip_model as c3 from screen_mode as t0 join phone as t1 on t0.graphics_mode = t1.screen_mode join chip_model as t2 on t1.chip_model = t2.model_name where t2.ram_mib between 32.0 and 64.0 and t2.model_nam... | {
"index": 1235,
"split": "train"
} | |
Which three films, along with their directors and IDs, are scheduled at cinemas located in the least common city, including the cinema IDs? | cinema | select t0.directed_by, t0.title, t0.film_id, t1.cinema_id, t1.film_id as c3 from film as t0 join schedule as t1 on t0.film_id = t1.film_id join cinema as t2 on t1.cinema_id = t2.cinema_id, (select location as c5 from cinema group by c5 order by count(*) asc nulls last limit 1) as t0 where t2.location = t0.c5 order by c... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "cinema",
"sql": "select t0.directed_by, t0.title, t0.film_id, t1.cinema_id, t1.film_id as c3 from film as t0 join schedule as t1 on t0.film_id = t1.film_id join cinema as t2 on t1.cinema_id = t2.cinema_id, (select location as c5 from cinema group by c5 order by count(*) asc nulls... | {
"index": 947,
"split": "train"
} | |
Who are the ten most recent employees (highest eids) along with their IDs, names, and salaries who do not have any certifications for aircraft that are scheduled for flights? | flight_1 | select t0.eid as c0, t0.name, t0.salary from employee as t0 join certificate as t1 on t0.eid = t1.eid where (not t1.aid in (select flight.aid as c2 from flight)) 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": "flight_1",
"sql": "select t0.eid as c0, t0.name, t0.salary from employee as t0 join certificate as t1 on t0.eid = t1.eid where (not t1.aid in (select flight.aid as c2 from flight)) order by c0 desc limit 10"
},
"style": "rule"
} | {
"index": 12,
"split": "train"
} | |
Can you list the apartment IDs, bathroom counts, and building IDs for apartments that are located in building number 790? | apartment_rentals | select anon_1.c0, anon_1.c2, anon_1.c1 from (select apt_id as c0, bathroom_count as c2, building_id as c1 from apartments intersect select t0.apt_id as c0, t0.bathroom_count as c2, t0.building_id as c1 from apartments as t0 join apartment_buildings as t1 on t0.building_id = t1.building_id where t1.building_id = 790) 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": "apartment_rentals",
"sql": "select anon_1.c0, anon_1.c2, anon_1.c1 from (select apt_id as c0, bathroom_count as c2, building_id as c1 from apartments intersect select t0.apt_id as c0, t0.bathroom_count as c2, t0.building_id as c1 from apartments as t0 join apartment_buildings as ... | {
"index": 1084,
"split": "train"
} | |
How many days passed between the Active From Date and Active To Date for customer with ID 5? | customers_and_addresses | select julianday(t1.c2) - julianday(t0.c3) from (select active_from_date as c2 from customer_contact_channels where customer_id = 5 and customer_id = 5) as t1, (select active_to_date as c3 from customer_contact_channels) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_and_addresses",
"sql": "select julianday(t1.c2) - julianday(t0.c3) from (select active_from_date as c2 from customer_contact_channels where customer_id = 5 and customer_id = 5) as t1, (select active_to_date as c3 from customer_contact_channels) as t0"
},
"style": "r... | {
"index": 3688,
"split": "train"
} | |
Which stadiums hosted games up to the 2007 season, excluding the stadium with ID 14, and what are their names, the number of home games they hosted, and their total attendance? | game_injury | select anon_1.c1, anon_1.c0, anon_1.c2 from (select t0.name as c1, t0.home_games as c0, t0.total_attendance as c2 from stadium as t0 join game as t1 on t0.id = t1.stadium_id where t1.season <= 2007 except select t0.name as c1, t0.home_games as c0, t0.total_attendance as c2 from stadium as t0 join game as t1 on t0.id = ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "game_injury",
"sql": "select anon_1.c1, anon_1.c0, anon_1.c2 from (select t0.name as c1, t0.home_games as c0, t0.total_attendance as c2 from stadium as t0 join game as t1 on t0.id = t1.stadium_id where t1.season <= 2007 except select t0.name as c1, t0.home_games as c0, t0.total_a... | {
"index": 81,
"split": "train"
} | |
Which are the 10 least common numbers of unique coupon IDs used in discount coupons, sorted from the smallest to larger counts? | products_for_hire | select count(distinct (coupon_id)) as c0 from discount_coupons 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": "products_for_hire",
"sql": "select count(distinct (coupon_id)) as c0 from discount_coupons order by c0 asc nulls last limit 10"
},
"style": "rule"
} | {
"index": 706,
"split": "train"
} | |
Which pilots have won matches with aircraft linked to airports that have at least 8,178,891 total passengers and simultaneously serve airports with fewer than 18,119,230 international passengers? | aircraft | select anon_1.c1, anon_1.c0 from (select t0.pilot_id as c1, t0.name as c0 from pilot as t0 join match as t1 on t0.pilot_id = t1.winning_pilot join aircraft as t2 on t1.winning_aircraft = t2.aircraft_id join airport_aircraft as t3 on t2.aircraft_id = t3.aircraft_id join airport as t4 on t3.airport_id = t4.airport_id whe... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "aircraft",
"sql": "select anon_1.c1, anon_1.c0 from (select t0.pilot_id as c1, t0.name as c0 from pilot as t0 join match as t1 on t0.pilot_id = t1.winning_pilot join aircraft as t2 on t1.winning_aircraft = t2.aircraft_id join airport_aircraft as t3 on t2.aircraft_id = t3.aircraft... | {
"index": 2684,
"split": "train"
} | |
How much larger is the highest address ID for customer 13 than the highest address ID (up to 5) for customer 10? | customers_and_addresses | select t1.c1 - t0.c1 from (select max(t1.address_id) as c1 from customers as t0 join customer_addresses as t1 on t0.customer_id = t1.customer_id where t0.customer_id = 10 and t1.address_id <= 5 group by t0.customer_id) as t1, (select t0.customer_id, max(t1.address_id) as c1 from customers as t0 join customer_addresses ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_and_addresses",
"sql": "select t1.c1 - t0.c1 from (select max(t1.address_id) as c1 from customers as t0 join customer_addresses as t1 on t0.customer_id = t1.customer_id where t0.customer_id = 10 and t1.address_id <= 5 group by t0.customer_id) as t1, (select t0.customer_... | {
"index": 3596,
"split": "train"
} | |
What is the average transaction amount for account 4, considering only transactions made with cards having an ID greater than 2? | customers_card_transactions | select t0.c1 from (select avg(t1.transaction_amount) as c1 from accounts as t0 join financial_transactions as t1 on t0.account_id = t1.account_id where t0.account_id = 4 and t1.card_id > 2 group by t0.account_id) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customers_card_transactions",
"sql": "select t0.c1 from (select avg(t1.transaction_amount) as c1 from accounts as t0 join financial_transactions as t1 on t0.account_id = t1.account_id where t0.account_id = 4 and t1.card_id > 2 group by t0.account_id) as t0"
},
"style": "rule"... | {
"index": 3373,
"split": "train"
} | |
What is the percentage change in the average property ID for customer 19 from March 27, 2015, to September 27, 2016? | local_govt_and_lot | select (t0.c2 / cast(t1.c2 as real) - 1) * 100 from (select avg(t1.property_id) as c2 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, avg(t1.property_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.c2 / cast(t1.c2 as real) - 1) * 100 from (select avg(t1.property_id) as c2 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": 3417,
"split": "train"
} | |
What are the publication years and movie IDs of movies associated with culture companies where the movie ID starts with '7'? | culture_company | select t0.year from movie as t0 join culture_company as t1 on t0.movie_id = t1.movie_id where t1.movie_id like '7%' or t1.movie_id like '7%' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "culture_company",
"sql": "select t0.year from movie as t0 join culture_company as t1 on t0.movie_id = t1.movie_id where t1.movie_id like '7%' or t1.movie_id like '7%'"
},
"style": "rule"
} | {
"index": 290,
"split": "train"
} | |
How many unique follow relationships have user ID 5 as the follower? | twitter_1 | select count(distinct (f1)) from follows where f1 = 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": "twitter_1",
"sql": "select count(distinct (f1)) from follows where f1 = 5"
},
"style": "rule"
} | {
"index": 1731,
"split": "train"
} | |
What are the Dates and Names of events that have both the rarest type of work reported and reports with work types ending with "st"? | news_report | select anon_1.c0, anon_1.c1 from (select t0.date as c0, t0.name as c1 from event as t0 join news_report as t1 on t0.event_id = t1.event_id, (select work_type as c2 from news_report group by c2 order by count(*) asc nulls last limit 1) as t1 where t1.work_type = t1.c2 intersect select t0.date as c0, t0.name as c1 from e... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "news_report",
"sql": "select anon_1.c0, anon_1.c1 from (select t0.date as c0, t0.name as c1 from event as t0 join news_report as t1 on t0.event_id = t1.event_id, (select work_type as c2 from news_report group by c2 order by count(*) asc nulls last limit 1) as t1 where t1.work_typ... | {
"index": 1460,
"split": "train"
} | |
Is the start date of the maintenance contract with ID 10 earlier than the start date of the contract with ID 8? | assets_maintenance | select t1.c2 < t0.c2 from (select contract_start_date as c2 from maintenance_contracts where maintenance_contract_id = 10) as t1, (select contract_start_date as c2 from maintenance_contracts where maintenance_contract_id = 8) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "assets_maintenance",
"sql": "select t1.c2 < t0.c2 from (select contract_start_date as c2 from maintenance_contracts where maintenance_contract_id = 10) as t1, (select contract_start_date as c2 from maintenance_contracts where maintenance_contract_id = 8) as t0"
},
"style": "r... | {
"index": 3116,
"split": "train"
} | |
How many editors are listed? | journal_committee | select count(name) from editor | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "journal_committee",
"sql": "select count(name) from editor"
},
"style": "rule"
} | {
"index": 871,
"split": "train"
} | |
Can you show me the most recent note's text, along with the teacher's ID, the incident type code, and the student ID for the behavior incident associated with the least common incident type description? Please sort the notes in reverse alphabetical order and limit the result to just this top entry. | behavior_monitoring | select t0.text_of_notes as c3, t0.teacher_id, t2.incident_type_code, t2.student_id from assessment_notes as t0 join students as t1 on t0.student_id = t1.student_id join behavior_incident as t2 on t1.student_id = t2.student_id join ref_incident_type as t3 on t2.incident_type_code = t3.incident_type_code, (select inciden... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "behavior_monitoring",
"sql": "select t0.text_of_notes as c3, t0.teacher_id, t2.incident_type_code, t2.student_id from assessment_notes as t0 join students as t1 on t0.student_id = t1.student_id join behavior_incident as t2 on t1.student_id = t2.student_id join ref_incident_type a... | {
"index": 1244,
"split": "train"
} | |
Find the headquarters and names of the manufacturer with code 1, listing the top 5 entries ordered by the founder's name in reverse alphabetical order. | manufactory_1 | select headquarter, name from manufacturers where code = 1 order by founder 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": "manufactory_1",
"sql": "select headquarter, name from manufacturers where code = 1 order by founder desc limit 5"
},
"style": "rule"
} | {
"index": 1029,
"split": "train"
} | |
Can you tell me the last names and first names of the top five guests with bookings ending after October 7th, 2017, at 8:47 PM, for apartments with IDs up to 10? List the guests in reverse alphabetical order by their last name. | apartment_rentals | select t0.guest_last_name as c0, t0.guest_first_name from guests as t0 join apartment_bookings as t1 on t0.guest_id = t1.guest_id where t1.booking_end_date > '2017-10-07 20:47:19' and t1.apt_id <= 10 order by c0 desc limit 5 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "apartment_rentals",
"sql": "select t0.guest_last_name as c0, t0.guest_first_name from guests as t0 join apartment_bookings as t1 on t0.guest_id = t1.guest_id where t1.booking_end_date > '2017-10-07 20:47:19' and t1.apt_id <= 10 order by c0 desc limit 5"
},
"style": "rule"
} | {
"index": 2983,
"split": "train"
} | |
What is the replacement cost and film ID of film 321 that has at least two actors and the shortest duration? | sakila_1 | select t0.replacement_cost, t0.film_id as c0 from film as t0 join film_actor as t1 on t0.film_id = t1.film_id where t1.film_id = 321 group by c0 having count(*) >= 2 order by t0.length asc nulls last limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "sakila_1",
"sql": "select t0.replacement_cost, t0.film_id as c0 from film as t0 join film_actor as t1 on t0.film_id = t1.film_id where t1.film_id = 321 group by c0 having count(*) >= 2 order by t0.length asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 2975,
"split": "train"
} | |
Can you provide the details of the projects, along with their project IDs and start dates, where the staff members have roles that include 'Lead' in their description or are labeled as 'Project Leader'? | tracking_grants_for_research | select t0.project_details, t0.project_id, t1.date_from from projects as t0 join project_staff as t1 on t0.project_id = t1.project_id join staff_roles as t2 on t1.role_code = t2.role_code where t2.role_description like '%ead%' or t2.role_description like '%Project Leader' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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.project_details, t0.project_id, t1.date_from from projects as t0 join project_staff as t1 on t0.project_id = t1.project_id join staff_roles as t2 on t1.role_code = t2.role_code where t2.role_description like '%ead%' or t2.role_desc... | {
"index": 1884,
"split": "train"
} | |
Find the premises types and details for all premises with the address "38291 Jerde Light Apt. 713". | customers_campaigns_ecommerce | select premises_type, premise_details as c0 from premises where c0 = '38291 Jerde Light Apt. 713' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 premises_type, premise_details as c0 from premises where c0 = '38291 Jerde Light Apt. 713'"
},
"style": "rule"
} | {
"index": 1622,
"split": "train"
} | |
What are the three most recent mailing dates in the Documents Mailed records? | cre_Doc_Control_Systems | select mailing_date as c0 from documents_mailed 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": "cre_Doc_Control_Systems",
"sql": "select mailing_date as c0 from documents_mailed order by c0 desc limit 3"
},
"style": "rule"
} | {
"index": 2697,
"split": "train"
} | |
Which organization type descriptions are linked to organizations whose details are either 'consequuntur' or end with the letter 't'? | tracking_grants_for_research | select t0.organisation_type_description from organisation_types as t0 join organisations as t1 on t0.organisation_type = t1.organisation_type where t1.organisation_details = 'consequuntur' or t1.organisation_details like '%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.organisation_type_description from organisation_types as t0 join organisations as t1 on t0.organisation_type = t1.organisation_type where t1.organisation_details = 'consequuntur' or t1.organisation_details like '%t'"
},
"style"... | {
"index": 2158,
"split": "train"
} | |
What is the percentage change in the average of customers' minimum invoice totals from March 29, 2010, to April 19, 2011? | chinook_1 | select (avg(t0.c0) / cast(avg(t1.c0) as real) - 1) * 100 from (select min(t1.total) as c0 from customer as t0 join invoice as t1 on t0.customerid = t1.customerid where t1.invoicedate = '2011-04-19 00:00:00' group by t0.customerid) as t0, (select t0.customerid, min(t1.total) as c0 from customer as t0 join invoice as t1 ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "chinook_1",
"sql": "select (avg(t0.c0) / cast(avg(t1.c0) as real) - 1) * 100 from (select min(t1.total) as c0 from customer as t0 join invoice as t1 on t0.customerid = t1.customerid where t1.invoicedate = '2011-04-19 00:00:00' group by t0.customerid) as t0, (select t0.customerid,... | {
"index": 3006,
"split": "train"
} | |
Is the average enrollment of institutions in building 7 less than the average enrollment of institutions with types ending in "bal" located in building 5? | protein_institute | select t1.c2 < t0.c2 from (select avg(t1.enrollment) as c2 from building as t0 join institution as t1 on t0.building_id = t1.building_id where t0.building_id = 5 and t1.type like '%bal' group by t0.building_id) as t1, (select t0.building_id, avg(t1.enrollment) as c2 from building as t0 join institution as t1 on t0.buil... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "protein_institute",
"sql": "select t1.c2 < t0.c2 from (select avg(t1.enrollment) as c2 from building as t0 join institution as t1 on t0.building_id = t1.building_id where t0.building_id = 5 and t1.type like '%bal' group by t0.building_id) as t1, (select t0.building_id, avg(t1.enr... | {
"index": 3572,
"split": "train"
} | |
What are the ten most recent payment dates made either by customer 13 or by customers who haven't made any bookings? | products_for_hire | select t0.payment_date as c0 from payments as t0 join customers as t1 on t0.customer_id = t1.customer_id where t1.customer_id = 13 or (not t1.customer_id in (select bookings.customer_id as c1 from bookings)) 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": "products_for_hire",
"sql": "select t0.payment_date as c0 from payments as t0 join customers as t1 on t0.customer_id = t1.customer_id where t1.customer_id = 13 or (not t1.customer_id in (select bookings.customer_id as c1 from bookings)) order by c0 desc limit 10"
},
"style": "... | {
"index": 2262,
"split": "train"
} | |
Which students are living in dorms that have amenities with IDs equal to 902 or between 922 and 930? Please include their student IDs and the dorm IDs they reside in.
Note that I simplified the phrasing for clarity while retaining all necessary details about the amenity IDs and the connection to student housing. | dorm_1 | select t0.stuid, t0.dormid from lives_in as t0 join dorm as t1 on t0.dormid = t1.dormid join has_amenity as t2 on t1.dormid = t2.dormid where t2.amenid = 902 or t2.amenid between 922 and 930 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "dorm_1",
"sql": "select t0.stuid, t0.dormid from lives_in as t0 join dorm as t1 on t0.dormid = t1.dormid join has_amenity as t2 on t1.dormid = t2.dormid where t2.amenid = 902 or t2.amenid between 922 and 930"
},
"style": "rule"
} | {
"index": 535,
"split": "train"
} | |
Does engineer 3's skill ID(s) in the range 1 to 3 have a lower value than the total number of skills with IDs between 1 and 3 assigned to any engineer? | assets_maintenance | select t2.c3 < t1.c1 from (select skill_id as c3 from engineer_skills where engineer_id = 3) as t2, (select count(skill_id) as c1 from engineer_skills where skill_id between 1 and 3) as t1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "assets_maintenance",
"sql": "select t2.c3 < t1.c1 from (select skill_id as c3 from engineer_skills where engineer_id = 3) as t2, (select count(skill_id) as c1 from engineer_skills where skill_id between 1 and 3) as t1"
},
"style": "rule"
} | {
"index": 3308,
"split": "train"
} | |
For each customer, how many days are there between their date of birth and the date they became a customer? | driving_school | select julianday(t1.c0) - julianday(t0.c3) from (select date_of_birth as c0 from customers) as t1, (select date_became_customer as c3 from customers) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "driving_school",
"sql": "select julianday(t1.c0) - julianday(t0.c3) from (select date_of_birth as c0 from customers) as t1, (select date_became_customer as c3 from customers) as t0"
},
"style": "rule"
} | {
"index": 3706,
"split": "train"
} | |
Which players from clubs in Japan have their club ID, player ID, name, and points listed, excluding those from club number 6? | sports_competition | select anon_1.c2, anon_1.c0, anon_1.c3, anon_1.c1 from (select t0.club_id as c2, t0.player_id as c0, t0.name as c3, t0.points as c1 from player as t0 join club as t1 on t0.club_id = t1.club_id where t1.region = 'Japan' except select t0.club_id as c2, t0.player_id as c0, t0.name as c3, t0.points as c1 from player 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": "sports_competition",
"sql": "select anon_1.c2, anon_1.c0, anon_1.c3, anon_1.c1 from (select t0.club_id as c2, t0.player_id as c0, t0.name as c3, t0.points as c1 from player as t0 join club as t1 on t0.club_id = t1.club_id where t1.region = 'Japan' except select t0.club_id as c2, ... | {
"index": 328,
"split": "train"
} | |
Which products with ID 7 or 4 are in the system, and what are their names, IDs, and associated order item IDs? | tracking_orders | select t0.product_name, t0.product_id, t1.order_item_id from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_id = 7 or 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_orders",
"sql": "select t0.product_name, t0.product_id, t1.order_item_id from products as t0 join order_items as t1 on t0.product_id = t1.product_id where t1.product_id = 7 or t1.product_id = 4"
},
"style": "rule"
} | {
"index": 2562,
"split": "train"
} | |
For each account with a name that includes "5" or ends with "8," how many unique account IDs are there, and how many transactions have been made? | customers_card_transactions | select count(distinct (t0.account_id)), count(t0.transaction_amount), t1.account_id as c0 from financial_transactions as t0 join accounts as t1 on t0.account_id = t1.account_id where t1.account_name like '%5%' or t1.account_name like '%8' 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": "customers_card_transactions",
"sql": "select count(distinct (t0.account_id)), count(t0.transaction_amount), t1.account_id as c0 from financial_transactions as t0 join accounts as t1 on t0.account_id = t1.account_id where t1.account_name like '%5%' or t1.account_name like '%8' gro... | {
"index": 988,
"split": "train"
} | |
What is the difference between the smallest investor ID associated with 'PUR' transactions on September 13, 2002, at 3:04:56 AM and the smallest investor ID on November 28, 2001, at 3:06:25 PM? | tracking_share_transactions | select t1.c1 - t0.c1 from (select min(t1.investor_id) as c1 from ref_transaction_types as t0 join transactions as t1 on t0.transaction_type_code = t1.transaction_type_code where t0.transaction_type_code = 'PUR' and t1.date_of_transaction = '2002-09-13 03:04:56' group by t0.transaction_type_code) as t1, (select t0.trans... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_share_transactions",
"sql": "select t1.c1 - t0.c1 from (select min(t1.investor_id) as c1 from ref_transaction_types as t0 join transactions as t1 on t0.transaction_type_code = t1.transaction_type_code where t0.transaction_type_code = 'PUR' and t1.date_of_transaction = '2... | {
"index": 3530,
"split": "train"
} | |
Among countries whose names start with "Netherland," which country has the fewest associated leagues, and what is the count of unique league entries and the country's ID? | soccer_1 | select count(distinct (t0.country_id)) as c0, t1.id as c1 from league as t0 join country as t1 on t0.country_id = t1.id where t1.name like 'Netherland%' group by c1 order by c0 asc nulls last limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "soccer_1",
"sql": "select count(distinct (t0.country_id)) as c0, t1.id as c1 from league as t0 join country as t1 on t0.country_id = t1.id where t1.name like 'Netherland%' group by c1 order by c0 asc nulls last limit 1"
},
"style": "rule"
} | {
"index": 817,
"split": "train"
} | |
What are the genders and names of all coaches, including those from clubs that have secured at least 7 gold medals? | riding_club | select anon_1.c0, anon_1.c1 from (select gender as c0, coach_name as c1 from coach union select t0.gender as c0, t0.coach_name as c1 from coach as t0 join club as t1 on t0.club_id = t1.club_id join match_result as t2 on t1.club_id = t2.club_id where t2.gold >= 7) 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.c1 from (select gender as c0, coach_name as c1 from coach union select t0.gender as c0, t0.coach_name as c1 from coach as t0 join club as t1 on t0.club_id = t1.club_id join match_result as t2 on t1.club_id = t2.club_id where t2.gold ... | {
"index": 340,
"split": "train"
} | |
Which submissions and their authors and colleges, as well as the acceptance results for workshops with ID 3 or 4, are associated with submissions that were accepted to either of these workshops? | workshop_paper | select t0.submission_id, t0.college, t0.author, t1.submission_id, t1.result from submission as t0 join acceptance as t1 on t0.submission_id = t1.submission_id join workshop as t2 on t1.workshop_id = t2.workshop_id where t2.workshop_id = 4 or t2.workshop_id = 3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "workshop_paper",
"sql": "select t0.submission_id, t0.college, t0.author, t1.submission_id, t1.result from submission as t0 join acceptance as t1 on t0.submission_id = t1.submission_id join workshop as t2 on t1.workshop_id = t2.workshop_id where t2.workshop_id = 4 or t2.workshop_i... | {
"index": 864,
"split": "train"
} | |
Did the grant awarded with ID 5 conclude before the grant awarded with ID 3? | tracking_grants_for_research | select t1.c0 < t0.c0 from (select grant_end_date as c0 from grants where grant_id = 5) as t1, (select grant_end_date as c0 from grants where grant_id = 3) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_grants_for_research",
"sql": "select t1.c0 < t0.c0 from (select grant_end_date as c0 from grants where grant_id = 5) as t1, (select grant_end_date as c0 from grants where grant_id = 3) as t0"
},
"style": "rule"
} | {
"index": 3149,
"split": "train"
} | |
What is the difference between the average product ID for complaints about product 117 and the highest average product ID among all products that had complaints on October 14, 2007? | customer_complaints | select t2.c1 - t0.c3 from (select max(t1.c3) as c1 from (select avg(t1.product_id) as c3 from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t1.date_complaint_raised = '2007-10-14 21:50:43' group by t0.product_id) as t1) as t2, (select t0.product_id, avg(t1.product_id) as c3 from products 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": "customer_complaints",
"sql": "select t2.c1 - t0.c3 from (select max(t1.c3) as c1 from (select avg(t1.product_id) as c3 from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t1.date_complaint_raised = '2007-10-14 21:50:43' group by t0.product_id) as t1) ... | {
"index": 3164,
"split": "train"
} | |
Find the names of members whose roles include the word 'ello' or 'la'. | performance_attendance | select distinct name from member where role like '%ello%' or role like '%la%' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "performance_attendance",
"sql": "select distinct name from member where role like '%ello%' or role like '%la%'"
},
"style": "rule"
} | {
"index": 2913,
"split": "train"
} | |
How many days passed from when the policy was opened to when it was closed? | insurance_fnol | select julianday(t1.c4) - julianday(t0.c0) from (select date_opened as c4 from customers_policies) as t1, (select date_closed as c0 from customers_policies) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "insurance_fnol",
"sql": "select julianday(t1.c4) - julianday(t0.c0) from (select date_opened as c4 from customers_policies) as t1, (select date_closed as c0 from customers_policies) as t0"
},
"style": "rule"
} | {
"index": 3722,
"split": "train"
} | |
Which staff members have been assigned to problem logs where their staff ID is at least 2 and also have problem logs with a problem ID less than 15? Please provide their last names and staff IDs. | tracking_software_problems | select anon_1.c0, anon_1.c1 from (select t0.staff_last_name as c0, t0.staff_id as c1 from staff as t0 join problem_log as t1 on t0.staff_id = t1.assigned_to_staff_id where t1.assigned_to_staff_id >= 2 intersect select t0.staff_last_name as c0, t0.staff_id as c1 from staff as t0 join problem_log as t1 on t0.staff_id = t... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "tracking_software_problems",
"sql": "select anon_1.c0, anon_1.c1 from (select t0.staff_last_name as c0, t0.staff_id as c1 from staff as t0 join problem_log as t1 on t0.staff_id = t1.assigned_to_staff_id where t1.assigned_to_staff_id >= 2 intersect select t0.staff_last_name as c0,... | {
"index": 2974,
"split": "train"
} | |
List the titles and their average number of issues for books where the average issues are at least 1, showing up to 10 results in alphabetical order of the titles. | book_2 | select title as c0, avg(issues) from book group by c0 having avg(issues) >= 1.0 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": "book_2",
"sql": "select title as c0, avg(issues) from book group by c0 having avg(issues) >= 1.0 order by c0 asc nulls last limit 10"
},
"style": "rule"
} | {
"index": 2431,
"split": "train"
} | |
Can you tell me, for each building address of buildings with the short name "Peter Cooper Village" or those whose short name ends with "arclay Tower," how many records there are, how many building IDs, and how many different full names are associated with those buildings? | apartment_rentals | select building_address as c3, count(*), count(building_id), count(distinct (building_full_name)) from apartment_buildings where building_short_name = 'Peter Cooper Village' or building_short_name like '%arclay Tower' group by c3 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "apartment_rentals",
"sql": "select building_address as c3, count(*), count(building_id), count(distinct (building_full_name)) from apartment_buildings where building_short_name = 'Peter Cooper Village' or building_short_name like '%arclay Tower' group by c3"
},
"style": "rule... | {
"index": 1439,
"split": "train"
} | |
What is the percentage variation in the average total staff ID sum for 'Blue tooth mouse' products based on customer complaints raised on August 6, 1977? | customer_complaints | select (avg(t0.c2) / cast(avg(t0.c2) as real) - 1) * 100 from (select sum(t1.staff_id) as c2 from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t1.date_complaint_raised = '1977-08-06 00:31:19' and t0.product_description = 'Blue tooth mouse' group by t0.product_id) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "customer_complaints",
"sql": "select (avg(t0.c2) / cast(avg(t0.c2) as real) - 1) * 100 from (select sum(t1.staff_id) as c2 from products as t0 join complaints as t1 on t0.product_id = t1.product_id where t1.date_complaint_raised = '1977-08-06 00:31:19' and t0.product_description ... | {
"index": 3019,
"split": "train"
} | |
What is the percentage change in the organization ID associated with service 52 between May 27, 2016, and August 5, 2017? | local_govt_and_lot | select (t0.c1 / cast(t1.c1 as real) - 1) * 100 from (select t0.organization_id as c1 from services as t0 join organizations as t1 on t0.organization_id = t1.organization_id join things as t2 on t1.organization_id = t2.organization_id join timed_status_of_things as t3 on t2.thing_id = t3.thing_id where t0.service_id = 5... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "local_govt_and_lot",
"sql": "select (t0.c1 / cast(t1.c1 as real) - 1) * 100 from (select t0.organization_id as c1 from services as t0 join organizations as t1 on t0.organization_id = t1.organization_id join things as t2 on t1.organization_id = t2.organization_id join timed_status... | {
"index": 3421,
"split": "train"
} | |
Based on the smallest amenity ID associated with each amenity group, what is the rank of amenity ID 909 when the groups are ordered from highest to lowest? | dorm_1 | select t1.c3, t1.c1 as c4 from (select row_number() over (order by t0.c2 desc) as c3, t0.c5 as c1 from (select t0.amenid as c5, min(t1.amenid) as c2 from dorm_amenity as t0 join has_amenity as t1 on t0.amenid = t1.amenid group by c5) as t0) as t1 where c4 = 909 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 t1.c3, t1.c1 as c4 from (select row_number() over (order by t0.c2 desc) as c3, t0.c5 as c1 from (select t0.amenid as c5, min(t1.amenid) as c2 from dorm_amenity as t0 join has_amenity as t1 on t0.amenid = t1.amenid group by c5) as t0) as t1 where c4 = 909"
... | {
"index": 3481,
"split": "train"
} | |
What are the first 10 color descriptions for colors associated with products that are either described as 'minus' or have an 's' in their description, sorted alphabetically by color description? | products_gen_characteristics | select t0.color_description as c0 from ref_colors as t0 join products as t1 on t0.color_code = t1.color_code where t1.product_description = 'minus' or t1.product_description like '%s%' 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": "products_gen_characteristics",
"sql": "select t0.color_description as c0 from ref_colors as t0 join products as t1 on t0.color_code = t1.color_code where t1.product_description = 'minus' or t1.product_description like '%s%' order by c0 asc nulls last limit 10"
},
"style": "ru... | {
"index": 794,
"split": "train"
} | |
Can you provide the name, creation date, and number of employees for the department managed by the head born in a state starting with "Alabam," along with the leadership's temporary or acting status and the head's ID? Please only include the record with the highest head ID. | department_management | select t0.name, t0.creation, t0.num_employees, t1.temporary_acting, t1.head_id as c1 from department as t0 join management as t1 on t0.department_id = t1.department_id join head as t2 on t1.head_id = t2.head_id where t2.born_state like 'Alabam%' order by c1 desc limit 1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "department_management",
"sql": "select t0.name, t0.creation, t0.num_employees, t1.temporary_acting, t1.head_id as c1 from department as t0 join management as t1 on t0.department_id = t1.department_id join head as t2 on t1.head_id = t2.head_id where t2.born_state like 'Alabam%' or... | {
"index": 2849,
"split": "train"
} | |
What are the course IDs for courses offered by departments whose budgets are less than or equal to the smallest department budget among those departments with budgets either above 441,840.92 or below 210,627.58? | college_2 | select t0.course_id from course as t0 join department as t1 on t0.dept_name = t1.dept_name, (select min(budget) as c1 from department where budget > 210627.58 or budget < 441840.92) as t0 where t1.budget <= t0.c1 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "college_2",
"sql": "select t0.course_id from course as t0 join department as t1 on t0.dept_name = t1.dept_name, (select min(budget) as c1 from department where budget > 210627.58 or budget < 441840.92) as t0 where t1.budget <= t0.c1"
},
"style": "rule"
} | {
"index": 135,
"split": "train"
} | |
What are the names, train IDs, and services of trains that serve station 8 but do not serve station 9? | train_station | select anon_1.c0, anon_1.c2, anon_1.c1 from (select t0.name as c0, t0.train_id as c2, t0.service as c1 from train as t0 join train_station as t1 on t0.train_id = t1.train_id where t1.station_id = 8 except select t0.name as c0, t0.train_id as c2, t0.service as c1 from train as t0 join train_station as t1 on t0.train_id ... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "train_station",
"sql": "select anon_1.c0, anon_1.c2, anon_1.c1 from (select t0.name as c0, t0.train_id as c2, t0.service as c1 from train as t0 join train_station as t1 on t0.train_id = t1.train_id where t1.station_id = 8 except select t0.name as c0, t0.train_id as c2, t0.service... | {
"index": 793,
"split": "train"
} | |
For each comptroller who held office between 2002 and 2006, what are their names and the average year they served? | election | select comptroller as c1, avg(year) from party where year between 2002.0 and 2006.0 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": "election",
"sql": "select comptroller as c1, avg(year) from party where year between 2002.0 and 2006.0 group by c1"
},
"style": "rule"
} | {
"index": 496,
"split": "train"
} | |
Find the IDs of cinemas located in places that start with "Coun". | cinema | select cinema_id from cinema where location like 'Coun%' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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 cinema_id from cinema where location like 'Coun%'"
},
"style": "rule"
} | {
"index": 2086,
"split": "train"
} | |
Find the earliest three friendship entries involving friends who are either doctors or have jobs ending with "tor," and display the year, the person's name, and their friend's name, sorted by the friend's age. | network_2 | select t0.year, t0.name, t0.friend from personfriend as t0 join person as t1 on t0.friend = t1.name where t1.job = 'doctor' or t1.job like '%tor' order by t1.age 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": "network_2",
"sql": "select t0.year, t0.name, t0.friend from personfriend as t0 join person as t1 on t0.friend = t1.name where t1.job = 'doctor' or t1.job like '%tor' order by t1.age asc nulls last limit 3"
},
"style": "rule"
} | {
"index": 1891,
"split": "train"
} | |
What are the names, descriptions, and codes of document types that are associated with the Population Research project? | cre_Docs_and_Epenses | select anon_1.c2, anon_1.c0, anon_1.c1 from (select document_type_name as c2, document_type_description as c0, document_type_code as c1 from ref_document_types intersect select t0.document_type_name as c2, t0.document_type_description as c0, t0.document_type_code as c1 from ref_document_types as t0 join documents as t1... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "cre_Docs_and_Epenses",
"sql": "select anon_1.c2, anon_1.c0, anon_1.c1 from (select document_type_name as c2, document_type_description as c0, document_type_code as c1 from ref_document_types intersect select t0.document_type_name as c2, t0.document_type_description as c0, t0.docu... | {
"index": 962,
"split": "train"
} | |
How many days passed between the start and end of the maintenance contract with ID 15? | assets_maintenance | select julianday(t1.c2) - julianday(t0.c3) from (select contract_end_date as c2 from maintenance_contracts) as t1, (select contract_start_date as c3 from maintenance_contracts where maintenance_contract_id = 15 and maintenance_contract_id = 15) as t0 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "assets_maintenance",
"sql": "select julianday(t1.c2) - julianday(t0.c3) from (select contract_end_date as c2 from maintenance_contracts) as t1, (select contract_start_date as c3 from maintenance_contracts where maintenance_contract_id = 15 and maintenance_contract_id = 15) as t0"... | {
"index": 3674,
"split": "train"
} | |
Can you tell me the names of the camera lenses and the mountain IDs for photos that are either in the most common color or are black and white? | mountain_photos | select t0.name, t1.mountain_id from camera_lens as t0 join photos as t1 on t0.id = t1.camera_lens_id, (select color as c0 from photos group by c0 order by avg(camera_lens_id) desc limit 1) as t0 where t1.color = t0.c0 or t1.color = 'Black/White' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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.name, t1.mountain_id from camera_lens as t0 join photos as t1 on t0.id = t1.camera_lens_id, (select color as c0 from photos group by c0 order by avg(camera_lens_id) desc limit 1) as t0 where t1.color = t0.c0 or t1.color = 'Black/White'"
},
... | {
"index": 1934,
"split": "train"
} | |
Which colleges have both had players try out as strikers and accepted players in their teams, including their states, enrollment numbers, and names? | soccer_2 | select anon_1.c1, anon_1.c2, anon_1.c0 from (select t0.state as c1, t0.enr as c2, t0.cname as c0 from college as t0 join tryout as t1 on t0.cname = t1.cname where t1.ppos like '%striker' intersect select t0.state as c1, t0.enr as c2, t0.cname as c0 from college as t0 join tryout as t1 on t0.cname = t1.cname where t1.de... | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "soccer_2",
"sql": "select anon_1.c1, anon_1.c2, anon_1.c0 from (select t0.state as c1, t0.enr as c2, t0.cname as c0 from college as t0 join tryout as t1 on t0.cname = t1.cname where t1.ppos like '%striker' intersect select t0.state as c1, t0.enr as c2, t0.cname as c0 from college... | {
"index": 511,
"split": "train"
} | |
Find the high school scores, player names, years of college experience, and player IDs for players who have not participated in tryouts at colleges with more than 12,000 students. | soccer_2 | select anon_1.c0, anon_1.c1, anon_1.c3, anon_1.c2 from (select hs as c0, pname as c1, ycard as c3, pid as c2 from player except select t0.hs as c0, t0.pname as c1, t0.ycard as c3, t0.pid as c2 from player as t0 join tryout as t1 on t0.pid = t1.pid join college as t2 on t1.cname = t2.cname where t2.enr > 12000) 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": "soccer_2",
"sql": "select anon_1.c0, anon_1.c1, anon_1.c3, anon_1.c2 from (select hs as c0, pname as c1, ycard as c3, pid as c2 from player except select t0.hs as c0, t0.pname as c1, t0.ycard as c3, t0.pid as c2 from player as t0 join tryout as t1 on t0.pid = t1.pid join college ... | {
"index": 2896,
"split": "train"
} | |
Which FDA-approved medicines with their trade names act as inhibitors of the enzyme associated with medicine ID 3? | medicine_enzyme_interaction | select t0.fda_approved, t0.trade_name from medicine as t0 join medicine_enzyme_interaction as t1 on t0.id = t1.medicine_id where t1.medicine_id = 3 and t1.interaction_type = 'inhibitor' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "medicine_enzyme_interaction",
"sql": "select t0.fda_approved, t0.trade_name from medicine as t0 join medicine_enzyme_interaction as t1 on t0.id = t1.medicine_id where t1.medicine_id = 3 and t1.interaction_type = 'inhibitor'"
},
"style": "rule"
} | {
"index": 2369,
"split": "train"
} | |
What are the move-in dates and customer event IDs for events with an ID of 559 or between 559 and 627? | local_govt_and_lot | select t0.date_moved_in, t0.customer_event_id from customer_events as t0 join customer_event_notes as t1 on t0.customer_event_id = t1.customer_event_id where t1.customer_event_id = 559 or t1.customer_event_id between 559 and 627 | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then 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.date_moved_in, t0.customer_event_id from customer_events as t0 join customer_event_notes as t1 on t0.customer_event_id = t1.customer_event_id where t1.customer_event_id = 559 or t1.customer_event_id between 559 and 627"
},
"style": "rule... | {
"index": 1626,
"split": "train"
} | |
Which letter grade(s) are assigned to courses with course IDs ending in "600.415"? | college_3 | select t0.lettergrade from gradeconversion as t0 join enrolled_in as t1 on t0.lettergrade = t1.grade where t1.cid like '%600.415' | spider | [
{
"content": "You are a helpful SQL expert assistant.\nThe assistant first thinks about how to write the SQL query by analyzing the question, database schema and external knowledge, then provides the final SQL query.\nThe reasoning process and SQL query are enclosed within <think> </think> and <answer> </answer... | logic | {
"ground_truth": {
"db_id": "college_3",
"sql": "select t0.lettergrade from gradeconversion as t0 join enrolled_in as t1 on t0.lettergrade = t1.grade where t1.cid like '%600.415'"
},
"style": "rule"
} | {
"index": 1781,
"split": "train"
} | |
Can you provide the names of actors who are in musicals with IDs less than 4, as well as the name of the musical that has ID 1? | musical | select anon_1.c0 from (select name as c0 from actor where musical_id < 4 union select name from musical where musical_id = 1) 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": "musical",
"sql": "select anon_1.c0 from (select name as c0 from actor where musical_id < 4 union select name from musical where musical_id = 1) as anon_1"
},
"style": "rule"
} | {
"index": 602,
"split": "train"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.