Active Apple Music Subscribers
Which customers currently hold an active Apple Music subscription, and what plan are they on?
- Joins
- Filtering
- Sorting
Challenge brief
Understand the request
Apple Music Team needs a list of all paying subscribers for a campaign targeting active Apple Music users.
List active Apple Music subscribers with customer full name, email, plan type, and monthly price.
Return
- full_name (first + last)
- plan_type
- monthly_price
Constraints
- Return active Apple Music subscriptions only
- Show higher monthly prices first and resolve ties by customer ID
Data you will use
Review the relevant tables before deciding how to join, filter, or aggregate them.
customers
customer_idINTEGERfirst_nameVARCHAR(50)last_nameVARCHAR(50)emailVARCHAR(100)
apple_music_subscriptions
subscription_idINTEGERcustomer_idINTEGERplan_typeVARCHAR(30)monthly_priceREALstatusVARCHAR(20)
Hints, when you need them
Open one clue at a time so you still do the reasoning.
Hint 1
Customer names are in customers. Subscription details are in apple_music_subscriptions. Connect on customer_id. Filter to status = 'active'.
Hint 2
INNER JOIN customers to apple_music_subscriptions on customer_id. WHERE ams.status = 'active'. Concatenate name with || ' ' ||. ORDER BY monthly_price DESC.
Hint 3
Build question 2 from its business grain: identify the driving rows, add only valid relationships, then apply the required filtering, aggregation, and deterministic ordering.
Verified SQL answer
Attempt the problem first, then compare structure and reasoning—not just syntax.
Reveal solution and explanation
SELECT c.first_name || ' ' || c.last_name AS full_name, c.email, ams.plan_type, ams.monthly_price FROM customers c INNER JOIN apple_music_subscriptions ams ON c.customer_id = ams.customer_id WHERE ams.status = 'active' ORDER BY ams.monthly_price DESC, c.customer_id ASC;Why this works
status = 'active' excludes David Brown whose subscription was cancelled. INNER JOIN connects each customer to their subscription row via customer_id.
Success check
5 active subscribers — David Brown is the only cancelled subscriber and is excluded
Expected result
Use this output to verify values, aliases, ordering, and row count.
| full_name | plan_type | monthly_price | |
|---|---|---|---|
| Bob Smith | bob.s@gmail.com | Family | 16.99 |
| Emma Davis | emma.d@icloud.com | Family | 16.99 |
| Alice Johnson | alice.j@icloud.com | Individual | 10.99 |
| Frank Miller | frank.m@gmail.com | Individual | 10.99 |
| Carol White | carol.w@icloud.com | Student | 5.99 |
Learn the concepts behind this answer
Strengthen your understanding with these targeted learning topics:
Continue practicing
Explore related company challenges
Microsoft
Independent Microsoft-style cloud, productivity, subscription, usage, support, and customer analytics SQL practice.
Google
Independent Google-style search, advertising, user-engagement, and video-product SQL practice.
Amazon
Independent Amazon-style e-commerce, warehouse, inventory, and customer analytics SQL practice.
Return to the complete interview preparation experience.