Credit Card Launch Analysis
Beginner Mode
Objective
Write a SQL query to list each credit card along with the number of cards issued in its launch month.
Table Schema:
- monthly_cards_issued
| Column | Type | Description |
|---|---|---|
| card_name | VARCHAR | Name of the credit card |
| issued_amount | INTEGER | Number of cards issued that month |
| issue_month | INTEGER | Month number (1-12) |
| issue_year | INTEGER | Year of issuance |
Task Requirements:
- The launch month is the earliest month-year combination recorded for each card
- Retrieve the
issued_amountfor each card's launch month - Sort the results by
issued_amountin descending order
Output columns: card_name, issued_amount
Examples
Example 1:
Output:
Input:
| monthly_cards_issued | |||
|---|---|---|---|
| card_name | issue_month | issue_year | issued_amount |
| Chase Sapphire | 1 | 2023 | 50000 |
| Chase Sapphire | 2 | 2023 | 62000 |
| Chase Sapphire | 3 | 2023 | 71000 |
| Amex Gold | 3 | 2023 | 35000 |
| Amex Gold | 4 | 2023 | 42000 |
| Amex Gold | 5 | 2023 | 55000 |
| Capital One Venture | 2 | 2023 | 28000 |
| Capital One Venture | 3 | 2023 | 31000 |
| card_name | issued_amount |
|---|---|
| Chase Sapphire | 50000 |
| Amex Gold | 35000 |
| Capital One Venture | 28000 |
Code Environment
Sign in or try as guest to run your code.
Track
| Question | Difficulty | Company | Access |
|---|
Need more practice in this area? Explore more questions →
JPMorgan