Your question is Second-Highest Subscriber Payment. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Write a query to find the second-highest subscriber payment from a billing table.
Return the second-highest distinct non-null payment amount. If fewer than two distinct non-null payment amounts exist, the result should be NULL.
second_highest_payment| Column | Type | Description |
|---|---|---|
| billing_idPK | INT | Unique billing record identifier |
| subscriber_id | VARCHAR(20) | Subscriber identifier |
| payment_amount | DECIMAL(10,2) | Payment amount recorded for the billing entry |