Valid Message Routing Keys
Problem
An internal messaging bus routes traffic using a `handle` shaped like `local@server.net`. A handle is considered **valid** only when ALL of these hold: it contains exactly one `@`; the part before the `@` uses only letters, digits, or underscores; the part after the `@` (the server) uses only letters; and it ends in `.net`. Return `record_id` and `handle` for every valid routing key, ordered by `record_id` ascending.
Tables
Example rows — the live problem includes the full dataset.
| record_id | handle |
|---|---|
| 1 | sales_north@hub.net |
| 2 | finance#hub.net |
| 3 | support@hub.io |
Expected output
Your answer should return 2 rows with the columns record_id, handle.
Starter code (SQL)
SELECT *
FROM routing_keys;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock