Office Subscribers
Which users are subscribed to Microsoft Office (product_id = 1)?
- Filtering
- Sorting
Challenge brief
Understand the request
Microsoft Office Team wants to reach Microsoft Office subscribers with a targeted upgrade campaign for the new Office 365 plan.
List user_ids subscribed to product_id = 1 (Microsoft Office).
Return
- user_id
Constraints
- Return subscriptions for Microsoft Office only
- Order by user ID
Data you will use
Review the relevant tables before deciding how to join, filter, or aggregate them.
subscriptions
subscription_idINTEGERuser_idINTEGERproduct_idINTEGERstart_dateDATEend_dateDATEpriceINTEGER
Hints, when you need them
Open one clue at a time so you still do the reasoning.
Hint 1
All subscription data is in the subscriptions table. Microsoft Office has product_id = 1. Filter to that product_id and return user_id.
Hint 2
SELECT user_id FROM subscriptions WHERE product_id = 1.
Hint 3
Build question 5 from the required result grain: choose the driving table, add only the joins and filters needed for that grain, then apply aggregation and deterministic ordering.
Verified SQL answer
Attempt the problem first, then compare structure and reasoning—not just syntax.
Reveal solution and explanation
SELECT user_id FROM subscriptions WHERE product_id = 1 ORDER BY user_id;Why this works
product_id = 1 maps to Microsoft Office. 5 of 12 subscriptions are for Office at $120/year each, generating $600 total. The other 7 users subscribe to Azure, Teams, or Dynamics.
Success check
5 users — user_ids 1, 2, 6, 9, 10
Expected result
Use this output to verify values, aliases, ordering, and row count.
| user_id |
|---|
| 1 |
| 2 |
| 6 |
| 9 |
| 10 |
Learn the concepts behind this answer
Strengthen your understanding with these targeted learning topics:
Continue practicing
Explore related company challenges
Apple
Independent Apple-style product, retail, services, support, workforce, and device-usage 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.