WORK 93 words
Compare Two SQL Query Approaches for the Same Report
Two queries, one report, and a nagging feeling they do not actually agree on the edge cases. This checks both for correctness on nulls and duplicates, readability, and likely performance at your table size, then tells you which one to keep or how to merge them.
Compare these two SQL queries that are meant to produce the same report and tell me which one to keep.
Query A:
[paste first query]
Query B:
[paste second query]
Assess both on correctness (do they actually produce the same result on edge cases like nulls and duplicates), readability, and likely performance on a table with {ROW_COUNT} rows. Point out any case where they would silently return different results. Recommend one query to keep, or a merged version that takes the best of both, and explain the choice in two or three sentences. ⚠ human-in-the-loop: you are responsible for the results of using this prompt, not us.