Skip to main content
SQL • LESSON 123

Data Quality Check

How can we detect invalid or corrupt salary records?

Advanced3 Minutes1360 XP
🤔 THE QUESTION

How can we detect invalid or corrupt salary records?

💡 WHAT IS IT?

Checking for NULL or negative values identifies corrupt source data before reporting.

🎯 WHAT IS IT USED FOR?

Automated dbt test assertions, ingestion boundary validation, preventing corrupted financial reports.

💻 EXAMPLE
SELECT
COUNT(*) AS invalid_salary_count
FROM employees
WHERE salary IS NULL
OR salary < 0;

🎯 Mission Objectives

Practice typing production-grade SQL code for Data Quality Check.

  • Data validation rule
  • Negative value check
  • Anomaly detection
  • Data pipeline testing