Telecom: Subscriber Display Name

Telecom: Subscriber Display Name

You are a CRM developer at the telecom operator LinkCell. The support team complains: the caller card is often blank because the subscriber name is scattered across sources. There is the official contract name (contract_name), the mobile-app nickname (app_nickname), and the phone number itself (msisdn) — always present. The product rule: show the contract name; if missing — the app nickname; if that is missing too — show the phone number. Build the view for the support screen: for every subscriber output their id and the name the agent will see per the rule above. Return columns: - subscriber_id — subscriber identifier; - display_name — the display name: the first non-empty of contract_name, app_nickname, msisdn. Sort by subscriber_id ascending. Return all subscribers.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables. Your answer must use the same column names as this sample — alias them with AS if needed.

subscriber_iddisplay_name
1Robert King
2speedy
3+15550003
PostgreSQLv16

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid