#45

Top 10 Invoice Senders

EASYAggregationPOSTGRESQL

Problem Description

You are building a top-senders report for a payment analytics pipeline. The finance team monitors which users generate the most invoice volume to identify high-value merchants and detect anomalous activity. Given the `invoices` table, find the top 10 users who sent the most invoices. Return `user_id` and `invoice_count`, ordered by invoice count descending. Break ties by `user_id` ascending.

Topics

rankingsortingaggregation

Asked at Companies

square

Solve This Problem

Sign up to access the interactive code editor, run test cases, view the editorial, and get AI-powered feedback on your solution.

Start Solving →