Dataset Viewer
Auto-converted to Parquet Duplicate
prompt
stringlengths
1.74k
10.4k
completion
stringlengths
350
1.12k
correct_letter
stringclasses
2 values
src
stringclasses
2 values
pairtype
stringclasses
2 values
db_id
stringlengths
10
75
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A computes the assignment length by subtracting the start date from the end date and orders the rows by that interval, thereby selecting the staff member with the shortest assignment period, which directly answers the question. Candidate B merely orders by the start date, which does not reflect assignment len...
A
spider
cw
department_store
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A joins the accounts, account_holders, account_currencies, and currencies tables to return each holder’s name, the actual account identifier, and the currency’s name and code, which directly matches the requested fields. Candidate B instead returns the account_holder_id (not the account identifier) and the ra...
A
synsql
cw
bank_account_management_and_customer_analysis
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A selects the composer’s name, genre, and the piece title, matching all three fields requested, and filters correctly on both birth year > 1800 and piece year > 1900. Candidate B only returns the title and genre, omitting the composer’s name, thus not fulfilling the request for names. Both queries use the sam...
A
synsql
cw
classical_music_composition_and_performance_tracking
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A correctly computes the assignment length by subtracting the start date from the end date and orders the staff by that duration, returning the staff member with the smallest time span. This directly answers the question about the least amount of assignment time. Candidate B merely orders by the start date, w...
A
spider
cw
department_store
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A selects only the distinct customer names and orders the result by customer_id, matching the request for “distinct names … sorted by customer id” while returning exactly the requested column. Candidate B also filters correctly but returns both customer_name and customer_id, providing an extra column that the...
A
spider
cw
department_store
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A correctly identifies the least‑common document structure by grouping on document_structure_code, ordering the groups by their row count (ascending), and then taking the average access_count of that smallest group. This matches the requirement to average the access counts of documents that share the least fr...
A
spider
cw
document_management
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A joins the two tables, filters for the year 2021 and a population decline greater than 500, and groups by city and primary language, returning the city ID, the summed Arabic‑ancestry percentage, and the primary language (Arabic). Candidate B also filters for the same year and decline but adds an extra condit...
A
synsql
cw
city_demographics_and_population_data
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A groups by each individual username, which always yields a count of 1 for every row, then arbitrarily picks a single record; it does not actually determine which role is most common nor return all users with that role. Candidate B first identifies the role_code that appears most frequently in the Users table...
B
spider
bw
document_management
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A computes separate sums for each name and returns them as two rows via UNION ALL, resulting in 156 and 6546 rather than a single total. Candidate B correctly aggregates across both names in one query using OR, producing a single sum of 6702, which matches the combined hours of the relevant projects. The ques...
B
spider
cw
scientist_1
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A queries the department_id column from the Departments table, grouping by that same column and ordering by the row count per group. Although it does not join the Staff_Department_Assignments table to count actual staff assignments, it at least returns a value from the correct department_id field. Candidate B...
A
spider
cw
department_store
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A counts patients only where the physician is listed as the patient’s primary care provider (PCP). This ignores patients a physician may see through appointments, and the result includes a physician not present in the Physician table, indicating a mismatch. Candidate B counts distinct patients linked to each ...
B
spider
bw
hospital_1
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A correctly uses a sub‑query to compare each account’s checking balance to the overall maximum and applies the “<” operator, which matches the requirement “below the maximum checking balance”. Candidate B joins a CTE that holds the maximum balance but uses “<=”, which would also include the account(s) that ha...
A
spider
cw
small_bank_1
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A calculates popularity by summing the quantity sold for each product in the order_items table and ordering the product names from highest to lowest total quantity, which directly matches the request for “most popular” based on purchase counts. Candidate B instead joins products to the measurements table and ...
A
synsql
cw
clothing_product_measurement_tracking
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Both candidates count ships per ship type using a GROUP BY on the TYPE column, so they each answer the question. The only difference is the order of the selected columns: Candidate A lists the count first and then the type, while Candidate B lists the type first and then the count. The execution results show the same n...
B
spider
cw
ship_mission
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A selects procedure names ordered by cost ascending and limits to three rows, while the question asks for the three most costly procedures, which would require ordering by cost descending. Nonetheless, the result set from A contains two procedure names that actually exist in the Procedures table (“Reverse Rhi...
A
spider
cw
hospital_1
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A orders all match results by total points scored and then applies a single LIMIT 3, which yields the overall top three scorers across all tournaments rather than the top three per tournament, and it also returns the opponent’s name even though the question asks only for “names” (presumably the players). Cand...
B
synsql
cw
badminton_match_and_player_statistics
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A aggregates points per player and then selects the single player with the highest total, which matches “players … return their … total points” but does not differentiate by game. Candidate B groups by `game_id`, yet still selects a single `player_name` without aggregating per player, resulting in an undefine...
A
synsql
cw
basketball_game_statistics_and_performance_tracking
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A joins movies directly to casts and returns the character name with its rank, but the question asks for the top cast members, which are better represented by the actor’s name rather than the character they play. It also limits to three rows, yet only two rows are returned because only two cast entries exist....
B
synsql
cw
__movie_information_and_analysis__
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A selects staff whose assignment start date is on or after 1 Jan 2016, which also includes assignments from later years, so it returns staff not necessarily assigned in 2016. Candidate B filters the assignment start date to strings beginning with “2016”, effectively limiting results to assignments that began ...
B
spider
cw
department_store
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A groups by product and region but then applies a global `ORDER BY … DESC LIMIT 1`, which returns only the single highest‑selling product overall, losing the per‑region information the question asks for. Candidate B also groups by product and region, but it does not limit the result set, so it returns a row f...
B
synsql
cw
clothing_size_conversion_and_inventory_management
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Both queries retrieve the average transaction amount for active accounts opened on the first day of the month, grouping by account ID and type. They use the same join and filter conditions, so they return the same numeric result (350.0 for the single matching account). The main difference is the column ordering and nam...
A
synsql
cw
bank_account_management_and_analytics
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A correctly links customers to their orders through the Customer_Orders table, then to the ordered products via Order_Items, and filters for product_name "keyboard". Candidate B mistakenly joins customers.customer_id directly to order_items.order_id, bypassing the order table, which yields unrelated rows. Con...
A
spider
cw
department_store
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A links the user table through the topic starter, not the post author, so it returns the topic‑starter’s username even for posts written by another user; this produces mismatched username/content pairs (e.g., Tommo shown for a post authored by Andi). Candidate B joins users through posts.user_id, ensuring the...
B
synsql
cw
online_discussion_forum_management
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A computes the sum of the Hours column across all rows in the Projects table, which directly answers the request for the total hours of all projects. Candidate B only counts the number of rows in Projects, which does not provide the total hours. The execution result of A shows a numeric sum (20183), while B s...
A
spider
cw
scientist_1
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A correctly links the physician named John Wen to the procedures he was trained in via the Trained_In table, then averages the procedure costs. Candidate B mistakenly joins the physician to the Procedures table on physician.employeeid = procedures.code, which does not represent the training relationship and y...
A
spider
cw
hospital_1
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A joins images to users and left‑joins features, but its sub‑query selects the latest feature globally rather than per image, and the CASE counts distinct feature IDs over the whole join, causing an incorrect “recurrent” label and returning only one row. Candidate B joins users, images and features, groups by...
B
synsql
cw
image_feature_extraction_and_quality_assessment
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Both queries correctly join physicians to patients via the PCP field, group by physician, and filter for those with more than one patient. The question asks only for the physicians’ names, not their IDs. Candidate A returns the physician’s EmployeeID as well as the name, providing extra information that wasn’t requeste...
B
spider
cw
hospital_1
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A aggregates the balances of checking and savings across all customers into a single total, returning one row (1000542376.0). This does not provide the per‑customer totals nor any ordering, so it does not satisfy “ordered by the total balance.” Candidate B computes the sum of checking and savings for each cus...
B
spider
cw
small_bank_1
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A calculates revenue per sale (quantity × price) and filters rows where the sale’s quantity exceeds the average quantity across all sales, then orders by that computed revenue. This aligns with “stores and products that have had more sales than the average” (using quantity as the sales measure) and returns th...
A
synsql
cw
apparel_sizing_and_inventory_management_485210
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A tries to count employees by joining physicians through Affiliated_With and grouping by department, which is a reasonable way to find the department with the fewest staff. However it selects department.head (an ID) and an arbitrary physician’s name, and it never returns the head’s position, so the output doe...
B
spider
cw
hospital_1
Instruction: Given the database info and the question, there are two candidate SQL queries. Compare the two candidates, analyze the differences between the queries and between their execution results, and decide which one better answers the question based on the database info and the evidence. ************************...
Candidate A attempts to find the physician by grouping on procedure cost and ordering by the sum of costs, which is unnecessary and could yield incorrect results if multiple physicians share costs; it also returns only a single row without guaranteeing it corresponds to the highest‑cost procedure. Candidate B directly ...
B
spider
bw
hospital_1
End of preview. Expand in Data Studio

MATS-SQL — Selection-3B THINK (reasoning duel judge) data review

Pairwise CHASE-SQL-style selection judge, THINK variant. Base = Llama-3.2-3B-Instruct, SFT-only (no ORPO). Completion = a ≤5-sentence reasoning chain (from gpt-oss-120b, hint-conditioned then hint-removed) followed by a final line Answer: A or Answer: B. Decoded at temperature 0.0.

Why THINK: the verdict-only judge (completion = a single A/B) beats majority-vote but is stuck at its conversion frontier — failure-close data augmentation was a wash. A 1-token judge has no channel to reason about why a small/empty result is correct. This dataset adds that channel.

Row schema

prompt = the duel (GRAST-30 schema + question + evidence + two candidate SQLs with 5-row execution previews). completion = reasoning + Answer: X. correct_letter = the ground-truth better candidate. src ∈ {bird, spider, synsql}, pairtype ∈ {cw = correct-vs-wrong, bw = both-wrong-closer-to-gold}.

Composition (train, by src × pairtype)

src pairtype n
bird bw 466
bird cw 5089
spider bw 521
spider cw 3420
synsql bw 253
synsql cw 3782

Quality gates (measured — review these)

gate train test
rows 13531 516
reasoning concludes the CORRECT letter (Answer: == correct_letter) 100.00% 100.00%
verdict parseable 100.00% 100.00%
A / B balance 6670 / 6861 257 / 259
hint-leak mentions 9 0
reasoning length (chars) p50 / p95 652 / 859

Train/test are DB-disjoint (held-out databases), so heldout letter-acc is not memorised.

Training config

  • Base: meta-llama/Llama-3.2-3B-Instruct — full fine-tune (no LoRA/PEFT)
  • Loss: completion-only (reasoning + verdict; prompt masked to −100)
  • Epochs: 2, checkpoint saved every epoch (-ep0, -ep1); pick best by heldout letter-acc
  • Effective batch: 64 (micro-batch 4 × grad-accum 16)
  • LR: 1e-5, cosine schedule, 3% warmup, AdamW (weight_decay 0), grad-clip 1.0
  • max_len: 3072, bf16, gradient checkpointing on
  • Inference: temperature 0.0; round-robin/winner-stays tournament over the top-3 majority-vote clusters, τ=0.80 confidence gate over MV

Examples

Example 1 — src=bird, pairtype=cw, correct=A

Reasoning + verdict (completion):

Candidate A joins the production table (which links each car ID to a country) with country and counts the matching production rows, thus counting every car whose origin country is ‘Europe’. Candidate B only counts rows in the country lookup table where the name is ‘Europe’, which yields the number of country records, not the number of cars. The result of A (102) reflects a car‑level count, whereas B’s result (1) reflects a single country entry. Therefore, A correctly answers “how many cars … originated from Europe”.
Answer: A

Example 2 — src=synsql, pairtype=bw, correct=B

Reasoning + verdict (completion):

Candidate A joins the three tables without aggregation, so each cash_prizes row produces a separate result row, leading to duplicate event rows and mixing of highest_score values (e.g., 850.0 appears with the same event). It also reports only the individual prize amount rather than the total prize money awarded for the event. Candidate B groups by the event fields and sums the cash_prizes.amount, producing one row per event with the correct total prize money (330.0) and the appropriate highest_score. The ordering in both queries follows the required date descending then prize money descending, but only B fulfills the request for total prize money per completed event. Therefore, Candidate B better answers the question.
Answer: B

Example 3 — src=spider, pairtype=cw, correct=B

Reasoning + verdict (completion):

Both candidates join Rating to Movie on the movie identifier and group by the movie to compute an average of the star ratings. The only syntactic difference is the ORDER BY clause: Candidate A orders the averages in descending order (`ORDER BY avg(stars) DESC`) and then limits to one row, which would return the highest‑rated movie, whereas Candidate B orders the averages in ascending order (`ORDER BY avg(rating.stars)`) and limits to one row, which correctly selects the movie with the lowest average rating. The execution results illustrate this difference: Candidate A’s result shows a high average (4.5) for “Snow White,” while Candidate B’s result shows a low average (2.5) for “The Sound of Music.” Since the question asks for the titles and average ratings of movies with the lowest average rating, the ascending order used by Candidate B aligns with the requirement, whereas Candidate A does not. Therefore, Candidate B better answers the question.
Answer: B
Downloads last month
76