DataDriven
LearnPracticeInterviewDiscussDailyJobs

Broken Promises Between Tables

A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.

Domain
SQL
Difficulty
medium
Seniority
L3

Problem

The data-quality pipeline runs a battery of validation rules over our warehouse tables, logging each run in dq_checks. A downstream consumer just choked on dangling references, so the on-call DE wants to know how bad the referential-integrity situation is. Count how many data quality checks whose rule is referential integrity actually failed (passed = 0). Note that rule names are not stored consistently, so match the rule case-insensitively. Return a single column fail_count.

Summary

Every foreign key is a pinky-swear. Count the ones that got broken.

Practice This Problem

Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.

Related

  • All Practice Problems
  • Mock Interview Mode
  • SQL Interview Questions
  • Data Engineering Interview Prep Guide
  • Daily Challenge
  • Data Engineering Lessons