▶ SQL Playground
Q14 HARD · Data Quality

Fact table validation queries

Run a battery of data quality checks on a fact table — NULL foreign keys, orphaned rows, negative amounts, future dates.

Try this problem in the playground

The sample tables will be auto-loaded — write a query and run it instantly.

▶ Open Playground

Setup & sample data

The playground will create these tables and populate them automatically when you click "Open Playground" above:

Solutions

Multiple approaches — try each and understand the trade-offs.

Expected output