Compute each customer's total number of invoices, then rank customers by that count (most invoices first) using DENSE_RANK().
Return CustomerId, FirstName, LastName, InvoiceCount, and InvoiceCountRank, ordered by rank then CustomerId.
| Column | Type |
|---|---|
| InvoiceId | INTEGER (Primary Key) |
| CustomerId | INTEGER (Foreign Key) |
Ready to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.