QuestionQ173

VerifiedMonitoring and Alerting

A data engineering team needs to create a SQL Alert to monitor data quality across multiple columns in its customer table. They want an alert to trigger when both the percentage of customers missing email addresses exceeds 15% AND the percentage of customers with invalid phone-number formats exceeds 10%.

Which SQL query pattern is suitable for implementing this multi-column alert condition?

Explanation

Separate aggregate metrics are required for the percentage of null email addresses and the percentage of invalid phone formats. Those metrics can be evaluated together by an alert condition requiring email_null_pct > 15 AND phone_invalid_pct > 10. The query pattern must therefore calculate both percentages over the customer table; the alternative that evaluates a CASE expression does not actually produce both metrics.

Community Discussion

No comments yet. Be the first to start the discussion!