Describe how you approach solving SQL interview problems step by step, including writing and validating the query.
Use the provided tables to demonstrate your approach with a representative PostgreSQL query. Explain how you clarify requirements, verify grain and joins, handle nulls, test edge cases, and compare the result with an independently reasoned expectation.
Output
- Return one row per customer with
customer_id, customer_name, completed_job_count, and paid_total.
- Include customers without completed jobs or paid invoices, use zero for those aggregate values, and order by
customer_id ascending.