You're a CRM developer at LinkCell, a telecom company. The support team reports that caller records often have no name because subscriber information comes from different sources. There's an official name from the contract (contract_name), a nickname from the mobile app (app_nickname), and the phone number (msisdn), which is always available. The product rule is to display the contract name first; if it's missing, use the app nickname; if that's also missing, display the phone number.
Write a query for the support screen that returns each subscriber's ID and the display name the support agent should see under this rule.
Return these columns:
- subscriber_id — subscriber ID;
- display_name — display name: the first available value from contract_name, app_nickname, and msisdn, in that order.
Sort by subscriber_id in ascending order. Include all subscribers.
subscriber_iddisplay_nameShowing the first 3 rows of the sample — the full sample comes with Premium
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in