Back to Playground0 / 4 dbt Labs Verified
Interactive dbt Modeling, Jinja DAG & Data Quality Lab
dbt Core Analytics Engineering Studio
Fix broken SQL models and schema.yml contracts. Practice {{ source() }}, {{ ref() }} lineage graphs, incremental MERGE filters, and CI quality tests (not_null, unique, relationships).
Staging (Silver) · Model: stg_orders.sql
1. Staging Model Hygiene + {{ source() }} & Schema Tests
Raw upstream ingestion delivered a duplicate ord-102, a NULL order_id, and an unexpected status "chargeback_test". Switch raw table references to {{ source('ecommerce', 'orders') }}, filter out NULL order_id, deduplicate, and declare not_null + unique tests in schema.yml.
Sample Dirty Warehouse Data (raw.orders — 5 rows)
ord-102 duplicated · row #4 has order_id=NULL · ord-104 links orphan cust-999 + chargeback_test
Live Parsed Lineage DAG
Hardcoded table (no Jinja lineage!)
stg_orders