Transactions Status Report SQL

Asked at Intuit · Coding Questions · Difficulty: Medium · Last asked Dec 25, 2025

A payments table records every transaction and, for failed ones, a free-text failure reason typed by different systems, so the same reason appears with different capitalization and stray spaces. Write one SQL query that produces a status report: for each status, the number of transactions, the total amount, and the failure reasons ranked from most to least frequent.

Loading the problem…