How would you handle null values and data type formatting, including ensuring precision in output, in a complex reporting query for HackerRank?
Use the provided HackerRank challenge, domain, and submission data. Include active challenges even when they have no submissions, and represent missing values consistently.
Output
- One row per active challenge, ordered by
challenge_id ascending.
- Return
challenge_id, challenge_name, domain_name, total_submissions, average_score, pass_rate_pct, and average_score_display.
- Use zero-valued numeric metrics when no applicable submissions exist, and show domain
Unassigned when the domain is missing.