hardViu · joinsPro
Total paid, joined across three tables
Viu stores subscribers, plans, and payments in three separate tables. For each subscriber, return their name, their plan's name, and the total amount they've paid so far.
Subscribers who haven't made any payment yet should still appear, with a total of 0.
Return name, plan_name, and total_paid.
Schema
▸subscribers
| id | INT |
| name | TEXT |
| plan_id | INT |
▸plans
| id | INT |
| plan_name | TEXT |
| monthly_fee | NUMERIC |
▸payments
| id | INT |
| subscriber_id | INT |
| amount | NUMERIC |
Pro
The example input, expected output, and walkthrough for this question unlock with a Pro plan.
Pro
This is a Pro question
Premium practice questions unlock with a Pro plan. The full solution, expected output, and grading are available to Pro members.