issuance_records has one row per branch and card type (branch, card_type, issued_count). For each card type, compute the gap between the highest and the lowest issued_count across branches (0 when only one branch issues it). Output columns: card_type, issue_difference. Order by issue_difference descending, then card_type ascending.
| Column | Type |
|---|---|
| branch | TEXT |
| card_type | TEXT |
| issued_count | INTEGER |
| branch | card_type | issued_count |
|---|---|---|
| A | Gold | 100 |
| B | Gold | 160 |
| A | Silver | 80 |
| B | Silver | 120 |
| card_type | issue_difference |
|---|---|
| Gold | 60 |
| Silver | 40 |
Solve it in the live editor on this page — run on sample data, then submit against hidden tests.
‹ Software Feature Event Counts · Weighted Catalog Average ›
{{ totalCount }} questions in the style asked at Amazon, Microsoft, Google, Meta, Flipkart and more — {{ hardPct }}% Hard. Write SQL in a real database engine in your browser, run it on sample data, then evaluate against hidden tests.
Company tags show where this type of question is commonly reported in interviews. Questions, data and solutions are written by TechTown.
{{ cur.statement }}
No submissions yet. Press Evaluate to submit your query.
{{ solutionSql }}
{{ out.error }}
You have solved your 3 free questions — nice work! Log in (free) to unlock all 150 questions, keep your streak and appear on the leaderboard.