Build data engineering judgment through real challenges
Work through guided SQL foundations, dimensional warehouses, and governance checks right in your browser or on a live Databricks warehouse.
core_balances to versioned product_catalog using bi-temporal date bounds.Build a Complete Marketplace Lakehouse
Explore the engineering challenges behind a high-throughput two-sided ticket marketplace. Work through the complete lifecycle of a modern data platform across 6 progressive stages:
Raw to Bronze Feed
Capture raw ticket listings and transaction feeds with ingestion timestamps and batch metadata.
Bronze to Silver Pipeline
Cleanse dirty formatting, deduplicate streams, and enable Delta Change Data Feed (CDF).
Dimensional Gold & SCD-2
Design conformed dimensions, manage buyer/seller roles, and version user address histories.
ODCS Contracts & Security
Publish Bitol ODCS v3.0.2 schema contracts, dynamic email masking, and row-level filtering.
Funnels, Rollups & Fraud
Compute inventory sell-through, hierarchical category rollups, and detect sybil buyer rings.
Financial & Pipeline Audit
Reconcile 1099-K seller payouts, platform commissions, and assert end-to-end auditability.
Explore All 52 Challenges
Analytics Foundations
Start here! Beginner-friendly labs covering Primary Keys, money types, Facts vs. Dimensions, JOIN fan-out, NULLs, and Bronze-Silver-Gold cleaning.
Tables, Rows & Spotting Duplicate Primary Keys
Find all duplicate customer_id records in bronze.customers_raw. • Expected Columns: customer_id, row_count • Logic: Group rows by customer_id. Keep only groups with more than 1 row. Order by row_count DESC, customer_id ASC.
Money Math, Data Types & Cleaning Dirty Orders
Summarize valid completed revenue by drink category. • Expected Columns: category, order_count, total_revenue • Filter Rules: status = 'completed' amount > 0 • Rounding & Sort: total_revenue = ROUND(SUM(amount), 2) ORDER BY total_revenue DESC
Facts vs. Dimensions: Combining Orders & Customers
Compute total orders and total spend by customer city. • Expected Columns: city, total_orders, total_spend • Join Condition: f.customer_id = c.customer_id • Sort: ORDER BY total_spend DESC
The JOIN Fan-Out Trap (Why Revenue Doubled!)
Compute accurate shipping and item totals per customer without fan-out. • Expected Columns: customer_id, total_shipping, total_items_value • Rules: Pre-aggregate shipping_fee from gold.fact_orders by customer_id. Pre-aggregate item_price from gold.fact_order_items (joined to orders for customer_id) by customer_id. Join the two summaries by customer_id and sort by customer_id ASC.
Handling Missing Data: NULL, COALESCE & Blank Strings
Clean NULL and blank emails cleanly using COALESCE and NULLIF. • Expected Columns: contact_id, full_name, contact_email • Logic: Trim whitespace and lowercase valid emails. Treat '' (empty string) as missing using NULLIF(..., ''). Replace missing emails with 'no-email@on-file.invalid'. Order by contact_id ASC.
Bronze → Silver → Gold: The Data Prep Line
Deduplicate bronze.orders_events to keep only the latest status per order. • Expected Columns: order_id, customer_id, status, amount • Rules: Exclude rows where amount <= 0. Partition by order_id and order by updated_at DESC. Keep rn = 1 and order final output by order_id ASC.
Architecture & Modeling
DUAL VERIFIER ACTIVELakehouse Medallion architecture, Delta Lake DDL, SCD bi-temporal joins, and partition pruning.
Delta Lake DDL & Partitioning Strategy
Write the CREATE OR REPLACE TABLE silver.core_balances DDL statement in Delta Lake. • Target Schema: account_id STRING NOT NULL balance_date DATE NOT NULL ledger_balance DECIMAL(18,2) NOT NULL available_balance DECIMAL(18,2) NOT NULL currency STRING NOT NULL • Integrity Constraints: Primary key constraint on (account_id, balance_date) RELY. • Storage Strategy: USING DELTA, PARTITIONED BY (balance_date). • Uniqueness Criterion: The DDL must declare decimal precision DECIMAL(18,2) for financial balances, declare the composite primary key constraint on (account_id, balance_date) with RELY, and partition by (balance_date). In addition, verify that no duplicate (account_id, balance_date) combinations exist in the target dataset. Key Concepts: Declarative Constraints (RELY): Informational metadata informing the query planner of primary key uniqueness without write-time locking overhead. Partition Pruning: Physical directory segregation allowing monthly audit queries to prune 91.7% of annual ledger data.
SCD Type 2 Temporal Joins: Fix the £8M Cash ISA Discrepancy
Write an SCD Type 2 effective-date temporal join query connecting core balances to the product catalog via account master data. • Complete Join Path: 1. From silver.core_balances b 2. Join silver.core_accounts a ON b.account_id = a.account_id 3. Join silver.product_catalog p ON a.product_code = p.product_code AND b.balance_date BETWEEN p.effective_from AND p.effective_to • Expected Columns: b.account_id, b.balance_date, b.ledger_balance, p.category_l1 • Filtering & Boundaries: Filter for snapshot date b.balance_date = '2026-05-31'. Enforce that balance_date falls inclusively between p.effective_from and p.effective_to. • Expected Reconciliation Result: All 3,000 Cash ISA accounts must be accurately classified under 'Savings' with £8,000,000.00 reconciled. Key Concepts: SCD Type 2 Temporal Join: Joining facts to historical dimension states using transaction snapshot dates (BETWEEN effective_from AND effective_to) rather than system recording time. Join Path Integrity: Traversing relational keys from balance snapshot (account_id) to account metadata (product_code) to product dimension.
Medallion Standardization View (Bronze to Silver)
Create the conformed standardizing view silver.crm_std over bronze.crm_customers. • Expected Columns: crm_id, full_name, email_std, phone_std, dob, postcode_std, country_code • Explicit Transformation Rules & Examples: email_std: lower(trim(email)). Example: ' John.Doe@Example.com ' -> 'john.doe@example.com' postcode_std: upper(regexp_replace(postcode, ' ', '')). Example: 'sw1a 1aa' -> 'SW1A1AA' phone_std: concat('+', regexp_replace(phone, '[^0-9]', '')). Example: '(020) 7946-0123' -> '+02079460123' Null handling: Preserve null values without throwing errors. Key Concepts: Medallion Conformance: Standardizing dirty bronze data types into uniform silver views prior to enterprise entity resolution.
CDE & Governance
Critical Data Element identification, harm scoring, System of Record certification, and RACI matrices.
CDE Harm Scoring & Budget Verification
Write an audit aggregation query against gov.cde_register that counts certified CDEs with harm_score >= 4 and an identified System of Record. • Expected Columns: count(*) AS total_cdes, count(system_of_record) AS cdes_with_sor • Acceptance Criteria: Filter for records where harm_score >= 4 AND system_of_record IS NOT NULL. Assert that exactly 12 distinct CDEs qualify using a HAVING clause (HAVING count(*) = 12). Example Qualifying CDE: ledger_balance (harm score = 5, System of Record = 'Core Banking Ledger'). Example Non-Qualifying Field: customer_nickname (harm score = 1, System of Record is null). Key Concepts: Critical Data Element (CDE): An attribute essential for regulatory returns, balance sheet reporting, or capital adequacy calculation. System of Record (SoR): The authoritative source system with legal and architectural provenance over an attribute's lifecycle. BCBS 239: Basel Committee on Banking Supervision standard 239 for risk data aggregation.
Assign CDE Accountability & Certify System of Record
Write an UPDATE statement against gov.cde_register assigning single named accountability and certifying the System of Record for CDE-007. • Target Record: cde_id = 'CDE-007' (silver.core_balances.ledger_balance). • Assigned Accountability: Set data_owner to 'helen.vance@globaldynadatumbank.example' and system_of_record to 'Core Banking Ledger'. • RACI Roles Clarification: Accountable (A): Single named individual (helen.vance@globaldynadatumbank.example) with veto authority and regulatory signing liability. Responsible (R): Data engineering team building and operating ingestion pipelines. Consulted (C): Finance and regulatory compliance subject matter experts. Informed (I): Downstream BI and analytics consumers. Key Concepts: PRA (Prudential Regulation Authority): The UK statutory regulator supervising banks, building societies, and credit unions. System of Record (SoR): Authoritative system holding the primary, legally binding state of financial balances.
Automated Governance Compliance Scan
Write a governance compliance audit query comparing gov.cde_register c against system.information_schema.columns col. • Expected Columns: c.cde_id, c.table_name, c.column_name, c.data_owner • Join & Filter Logic: Join gov.cde_register c to system.information_schema.columns col on c.table_name = col.table_name AND c.column_name = col.column_name. Flag any CDE where c.data_owner IS NULL OR c.data_owner NOT LIKE '%@globaldynadatumbank.example%'. The query must identify unowned columns as well as invalid third-party ownership domains. Key Concepts: Automated Governance Scan: Continuous schema inspection asserting ownership metadata compliance prior to production promotion. Fail-Closed Governance: Architectural security stance where missing or invalid ownership metadata blocks production deployment.
Metadata & Glossaries
Business glossaries with anti-examples, Unity Catalog automated column tagging, and drift discovery.
Adding Governance Warnings to Databricks Column Comments (The £78M Discrepancy)
Write the COMMENT ON COLUMN silver.core_balances.ledger_balance SQL command. • Target Column: silver.core_balances.ledger_balance • Documentation Acceptance Criteria: Must explicitly cite business glossary identifier GLOSS-FIN-0012. Must provide an explicit anti-example warning prohibiting the substitution of available_balance for statutory regulatory and balance sheet calculations. • Runtime Compatibility: Databricks Runtime 16.1+ or Databricks SQL warehouse. Key Concepts: Active Governance: Embedding definitions, compliance rules, and anti-examples directly into the catalog metadata where SQL users work. Anti-Example: A negative documentation guideline explicitly specifying what NOT to do to prevent dangerous semantic calculation defects.
Programmatic Column Tagging in Unity Catalog
Write the ALTER TABLE silver.core_balances ALTER COLUMN ledger_balance SET TAGS (...) DDL command. • Target Column: silver.core_balances.ledger_balance • Tag Specifications: Set cde.flag = 'true', cde.id = 'CDE-007', and cde.tier = 'Restricted'. • Enforcement Note: Tags serve as declarative metadata; security firewalls, dynamic masking policies, and audit linters consume these tags to enforce governance and column protection policies. Key Concepts: Unity Catalog Column Tagging: Declarative key-value metadata attached directly to catalog column definitions, powering automated compliance and security policies.
Audit Untagged Columns (Fail-Closed Discovery)
Write an audit query joining system.information_schema.columns c with system.information_schema.column_tags t to discover untagged columns. • Expected Columns: c.table_catalog, c.table_schema, c.table_name, c.column_name • Acceptance Criteria & Filter Logic: Join on catalog, schema, table, and column matching t.tag_name = 'cde.tier'. Filter for c.table_schema = 'silver'. Assert where t.tag_value IS NULL (or tag record is missing), detecting all unclassified columns. Key Concepts: Fail-Closed Architecture: Security principle where absence of verified classification metadata defaults to maximum restriction and triggers immediate audit alerting.
Lineage & BCBS 239
Auditable Source-to-Target (S2T) mapping, cross-system joins, and Basel Committee regulatory traceability.
Building an Auditable Source-to-Target (S2T) Row
Write an INSERT INTO gov.s2t statement registering hop HOP-DEP-008. • Values to Insert: hop_id: 'HOP-DEP-008' cde_id: 'CDE-007' source_table: 'bronze.core_balances' source_column: 'ledger_balance' target_table: 'silver.core_balances' target_column: 'ledger_balance' transform_logic: 'CAST(balance AS DECIMAL(18,2))' git_hash: 'git:7f3a9b' (simulated 7-character Git commit SHA) steward: 'david.chen@globaldynadatumbank.example' Key Concepts: BCBS 239: International standard mandating complete aggregate risk reporting and data traceability. S2T Mapping: Authoritative catalog documenting data transformation logic, source provenance, and technical steward accountability.
Harvesting AST Column Lineage in Databricks
Write a column lineage query against system.access.column_lineage. • Expected Columns: source_table_full_name, source_column_name, target_table_full_name, target_column_name • Acceptance Criteria: Filter where target_table_full_name = 'gold.deposits_return' AND target_column_name = 'reported_gbp'. • Directional Lineage Note: Upstream queries trace from a target backward to its feeder sources; downstream queries trace forward from a source to its dependent consumers. Key Concepts: AST Lineage: Programmatic lineage harvested by the SQL compiler analyzing the logical query plan at execution time. End-to-End Traceability: Proof of provenance connecting board-level regulatory disclosures to underlying ledger entries.
Downstream Blast Radius Impact Analysis
Write an impact analysis query against system.access.column_lineage to discover downstream consumers. • Expected Columns: target_table_full_name, target_column_name • Acceptance Criteria: Filter where source_table_full_name = 'silver.fx_rates' AND source_column_name = 'rate'. Return distinct target table and column names ordered alphabetically. Key Concepts: Blast Radius Analysis: Identifying all downstream consumers and data products vulnerable to upstream schema alterations.
Entity Resolution & MDM
Deterministic customer matching, Jaro-Winkler phonetic similarity, and survivorship golden record rules.
Candidate Pair Blocking on Postcode & Date of Birth
Create the candidate pair blocking view silver.candidate_pairs matching silver.crm_std and silver.cob_std. • Concept for Learners: Blocking partitions data using shared demographic keys (postcode_std and dob) so that only plausible customer pairs are compared, pruning 99%+ of Cartesian comparisons before expensive fuzzy matching. • Expected Columns: a.crm_id, b.cust_no, a.full_name AS crm_name, b.full_name AS cob_name, a.email_std AS crm_email, b.email_std AS cob_email, a.phone_std AS crm_phone, b.phone_std AS cob_phone, a.postcode_std, a.dob • Acceptance Criteria: Join silver.crm_std a and silver.cob_std b on a.postcode_std = b.postcode_std AND a.dob = b.dob. Key Concepts: Candidate Blocking: Partitioning strategy that reduces candidate pairs by 99%+ by requiring strict equality on blocking keys prior to fuzzy scoring.
Weighted Similarity Scoring (Resolving £63M in Duplicates)
Write a similarity scoring query against silver.candidate_pairs to identify high-confidence duplicate entities. • Expected Columns: crm_id, cust_no, score • Scoring Weights & Criteria: Email match: CASE WHEN crm_email = cob_email THEN 40 ELSE 0 END Phone match: CASE WHEN crm_phone = cob_phone THEN 30 ELSE 0 END Postcode presence: CASE WHEN postcode_std IS NOT NULL THEN 15 ELSE 0 END Date of Birth presence: CASE WHEN dob IS NOT NULL THEN 10 ELSE 0 END Levenshtein Name Distance <= 2: CASE WHEN levenshtein(lower(crm_name), lower(cob_name)) <= 2 THEN 5 ELSE 0 END • Configured Threshold: Filter where composite score >= 70. Order by score DESC. Key Concepts: Weighted Probabilistic Matching: Scoring multi-attribute evidence to classify candidate entity pairs with high statistical confidence.
Attribute Survivorship with max_by()
Create the golden record view gold.customer_golden aggregating matched customer records. • Expected Columns: entity_id, full_name, email, phone, postcode • Survivorship Rules: Group by entity_id. full_name: max_by(full_name, source_priority) (Core Banking system priority 2 > CRM priority 1). email: max_by(email, updated_at) (latest contact timestamp wins). phone: max_by(phone, source_priority). postcode: max_by(postcode, updated_at). • Attribute-Level Rationale: Surviving attributes independently ensures that verified KYC legal names are preserved from the core ledger while fresh contact details are captured from digital channels. Key Concepts: Attribute Survivorship: Granular business rules determining the winning attribute value for each golden entity field. max_by(col, order_col): Spark SQL function returning the value of col corresponding to the maximum value of order_col.
Quality & Assertions
ISO 8000 quality rules, completeness null checks, and temporal consistency assertions in Delta Lake.
Codifying ISO 8000-61 Quality Dimensions (Semantic Accuracy)
Write a Semantic Accuracy assertion query against silver.core_balances to detect unauthorized overdraft breaches. • Expected Columns: account_id, balance_date, ledger_balance • Acceptance Criteria & Boundary Rules: Filter for accounts where ledger_balance < -5000.00 (exceeding the £5,000 authorized retail overdraft limit). Order results by ledger_balance ASC to prioritize the most severe balance sheet violations. Severity 1 Classification: In banking operations, balance violations exceeding customer contracts are critical accounting defects requiring immediate ledger freezes. Key Concepts: ISO 8000-61 / DAMA Dimensions: Rigorous international taxonomy for enterprise data quality measurement. Semantic Accuracy: Degree to which data accurately reflects real-world business constraints and valid transactional limits.
Delta Live Tables (DLT) Quality Expectations
Write a DLT streaming table definition for silver.core_balances_clean declaring tiered expectation constraints over STREAM(bronze.core_balances). • Tiered Expectations Specification: Constraint valid_account: EXPECT (account_id IS NOT NULL) ON VIOLATION FAIL UPDATE Constraint within_overdraft_limit: EXPECT (ledger_balance >= -5000.00) ON VIOLATION DROP ROW • Architectural Note: Discarding invalid rows (DROP ROW) prevents corrupt balance calculations, while identity nulls halt the update to prevent orphan records. Key Concepts: DLT Expectations: Declarative quality rules embedded in streaming pipelines. Fatal vs. Drop Row Violations: Halting execution on critical structural failures versus filtering individual non-fatal records.
Automated DQ Scorecard & Trust Badge Query
Write a trust badge evaluation query against gov.dq_results for the data product gold.deposits_return. • Expected Columns: product_name, total_records, passed_records, dq_score, trust_tier • Scoring & Tier Logic: dq_score = round((passed_records 100.0) / total_records, 2) trust_tier: dq_score >= 98.0 -> 'Certified' dq_score >= 90.0 AND dq_score < 98.0 -> 'Conditional' dq_score < 90.0 -> 'Uncertified' Filter for product_name = 'gold.deposits_return'. Key Concepts: Data Trust Badge: Institutional certification of a data product's compliance and operational readiness.
Circuit Breakers & RCA
Automated pipeline circuit breakers, threshold alerting, and root-cause blast radius forensics.
Ingestion Circuit Breaker for Delayed Payment Feeds
Write a freshness circuit breaker evaluation query against bronze.payment_feed_audit. • Expected Columns: feed_name, latest_feed_ts, circuit_breaker_status • Circuit Breaker Evaluation Logic: Group by feed_name. latest_feed_ts = MAX(received_at). circuit_breaker_status: Return 'CIRCUIT_BREAKER_TRIPPED' when MAX(received_at) < CURRENT_TIMESTAMP INTERVAL 4 HOURS, else 'FEED_HEALTHY'. Filter for feed_name = 'bacs_inbound'. Key Concepts: Data Circuit Breaker: Automated safety valve arresting pipeline DAG execution upon upstream data freshness or volume anomalies.
5-Whys Incident Post-Mortem Verification
Write a post-mortem review query joining gov.incident_postmortems p and gov.incident_log i for incident ISS-2026-001. • Expected Columns: p.why_level, p.finding, p.prevention_control • Acceptance Criteria: Join on p.incident_id = i.incident_id. Filter where p.incident_id = 'ISS-2026-001'. Order results by p.why_level ASC (returning all 5 levels from symptom to root cause). Key Concepts: 5-Whys Root Cause Analysis (RCA): Iterative interrogation technique tracing superficial symptoms back to fundamental architectural defects. Severity 1 (S1): Critical operational outage impacting statutory regulatory reporting or core customer operations.
Data Delivery Agreement (DDA) Temporal Assertion
Write a temporal assertion query over silver.product_catalog to detect date interval violations. • Expected Columns: product_code, effective_from, effective_to, prev_to, has_temporal_violation • Temporal Partitioning & Ordering: Must partition window check by business key: OVER (PARTITION BY product_code ORDER BY effective_from). Inspect preceding record closing date: LAG(effective_to) OVER (PARTITION BY product_code ORDER BY effective_from) AS prev_to. Flag violation: effective_from > effective_to OR effective_from <= prev_to. Key Concepts: Data Delivery Agreement (DDA): Formal operational contract between data producers and consumers specifying SLA bounds. Temporal Disjointness: Absolute mathematical guarantee that validity ranges for an entity never overlap.
Security & Privacy
Dynamic PII column masking, GDPR right-to-erasure tombstoning, and Unity Catalog tag policies.
3-Tier Classification Model Audit (Fail-Closed)
Write an audit query against gov.classification to detect all non-compliant column classifications. • Expected Columns: table_name, column_name, security_tier • Acceptance Criteria & Filter Logic: Return all records where security_tier IS NULL OR security_tier NOT IN ('Public', 'Internal', 'Restricted'). Order results by table_name, column_name. Key Concepts: 3-Tier Security Taxonomy: Standardized classification policy mapping data assets to concrete access controls: Public (open), Internal (authenticated staff), and Restricted (strictly regulated PII/financial balances). Fail-Closed Policy: Defaulting unclassified assets to immediate violation status.
Dynamic Data Masking (DDM) for Customer PII
Write the SQL function CREATE OR REPLACE FUNCTION gov.mask_email(email STRING). • Function Logic & Privileges: Check whether the executing user is a member of user group 'compliance_officers'. If true, return raw email; otherwise return masked email redacting username characters with asterisks (using regexp_replace). • Catalog Attachment Note: In Unity Catalog, masking functions are attached to columns via ALTER TABLE silver.crm_customers ALTER COLUMN email SET MASK gov.mask_email;. Key Concepts: Dynamic Data Masking (DDM): Runtime redaction applied during query evaluation based on user session role. GDPR Article 25: Principle of data protection by design and default requiring technical controls embedded into data platforms.
Row-Level Security (RLS) Regional Partitioning
Write the row filter function CREATE OR REPLACE FUNCTION gov.filter_branch_region(branch_id STRING). • Evaluation Logic: Return true if current_user() is a member of 'national_treasury'. OR return true if branch_id = (SELECT branch_id FROM gov.user_branch_mapping WHERE user_email = current_user()). Else return false (fail-closed principle: unmapped users receive no row visibility). • Attachment Note: Attached via ALTER TABLE silver.core_accounts SET ROW FILTER gov.filter_branch_region ON (branch_id);. Key Concepts: Row-Level Security (RLS): Automated table-level filter evaluating per-row visibility based on user session identity.
Data Contracts & SRE
Bitol ODCS v3.0.2 schema contracts, freshness error budgets, and producer-consumer SLAs.
Machine-Readable ODCS v3.0 YAML Contract
Author a valid Bitol ODCS v3.0.2 YAML data contract for deposits_return. • Contract Specifications: apiVersion: v3.0.2 kind: DataContract id: urn:datacontract:meridian:deposits_return Dataset Model: gold.deposits_return with property ledger_balance having logicalType: number Quality assertions and freshness SLA guarantees. Key Concepts: Open Data Contract Standard (ODCS): Vendor-neutral YAML specification (bitol.io) standardizing data product contracts.
SRE Error Budget & Release Freeze Calculation
Write an SRE error budget query against gov.pipeline_runs for pipeline 'deposits_return'. • Expected Columns: pipeline_name, total_runs, failed_runs, budget_burn_pct, release_policy • Mathematical Formulation: Filter for run_date >= CURRENT_DATE INTERVAL 90 DAYS for pipeline_name = 'deposits_return'. total_runs = count(*). failed_runs = sum(CASE WHEN is_sla_breach THEN 1 ELSE 0 END). budget_burn_pct = round(failed_runs / 0.45 100, 2). release_policy: Return 'FREEZE_NON_CRITICAL_RELEASES' when budget_burn_pct >= 100.0, else 'BUDGET_HEALTHY'. Key Concepts: Service Level Objective (SLO): Contractual reliability percentage target for pipeline delivery. Error Budget: Maximum permissible downtime before code deployments are halted to protect system stability.
Automated Schema Drift Gate in CI/CD
Write a schema signature fingerprint query against system.information_schema.columns. • Expected Columns: table_name, column_count, schema_hash • Deterministic Fingerprint Logic: Filter for table_schema = 'silver' AND table_name = 'core_balances'. schema_hash = md5(concat_ws(',', sort_array(collect_list(concat(column_name, ':', data_type))))). column_count = count(*). Key Concepts: Schema Drift: Unannounced modifications to source table structures causing pipeline outages. Deterministic Schema Fingerprint: Digest verifying schema parity between CI/CD contracts and live Lakehouse catalogs.
AI Readiness & EU AI Act
EU AI Act Article 10 compliance, bias audit assertions, and LLM embedding provenance metadata.
Point-in-Time 'As-Of' Joins (Zero Target Leakage)
Write a point-in-time feature aggregation query joining silver.credit_applications a through silver.core_accounts acc to silver.core_transactions t. • Expected Columns: a.application_id, a.customer_id, a.decision_date, coalesce(sum(t.amount), 0.00) AS debit_volume_90d • Temporal Boundary: Join on a.customer_id = acc.customer_id AND acc.account_id = t.account_id AND t.txn_date BETWEEN a.decision_date INTERVAL 90 DAYS AND a.decision_date. Group by a.application_id, a.customer_id, a.decision_date. Key Concepts: Target Leakage: Feature contamination introducing post-decision observations into historical model training data. EU AI Act Article 10: Regulatory guidance ensuring high-risk AI training data is temporally sound, relevant, and representative.
GDPR Art. 6 Lawful Basis Gate Filter
Write an AI governance gate filter query over silver.credit_applications enforcing Global DynaDatum Bank's lawful basis policy. • Expected Columns: application_id, customer_id, decision_date, loan_amount, lawful_basis • Acceptance Criteria: Filter where lawful_basis IN ('contract', 'legal_obligation', 'legitimate_interest'). Exclude records processed under revocable consent or unverified legal grounds. Key Concepts: GDPR Article 6: European privacy standard defining six lawful grounds for processing personal data. Compliance Gate: Architectural pipeline barrier ensuring legally contaminated records never reach model training.
Population Stability Index (PSI): Detect Feature Drift & Trigger Retraining
Write a statistical PSI monitoring query against silver.feature_drift_stats. • Expected Columns: feature_name, round(sum((actual_pct expected_pct) ln(actual_pct / expected_pct)), 4) AS psi_value, CASE WHEN sum((actual_pct expected_pct) ln(actual_pct / expected_pct)) >= 0.25 THEN 'SCHEDULE_MODEL_RETRAINING' ELSE 'STABLE' END AS drift_action • Acceptance Criteria: Group by feature_name. Filter for feature_name = 'utilisation_6m'. Mathematical Note: PSI formula: sum((actual_pct expected_pct) ln(actual_pct / expected_pct)). In production, percentages are represented as fractions (0.0 to 1.0) and zero buckets are smoothed with small epsilon values. Key Concepts: Population Stability Index (PSI): Statistical metric quantifying shift between baseline and production feature distributions (Global DynaDatum Bank policy triggers retraining at PSI >= 0.25).
TICKIT Marketplace
16-LAB CAPSTONETwo-sided ticket marketplace dimensional modeling, two-fact grains, role-playing dimensions, and fraud forensics (synthetic curriculum adapted from open TICKIT benchmarking schema).
Grain, Keys and the Two-Fact Model
Write an analytical audit query against raw.sales and raw.listing respecting their distinct business grains. • Expected Columns: eventid, total_listings, total_sales_txns, total_tickets_sold, gross_merchandise_value • Aggregation Logic: Group by eventid. total_listings = count(distinct l.listid) total_sales_txns = count(distinct s.salesid) total_tickets_sold = sum(s.qtysold) gross_merchandise_value = sum(s.pricepaid) • Core Learning Principle: Pre-aggregating listings and sales separately at event grain prevents Cartesian explosion and eliminates revenue duplication. Key Concepts: Business Grain: The fundamental atomic operational unit represented by an individual table row. Two-Fact Model: Dimensional architecture keeping inventory listings and sales transactions in distinct fact tables to prevent Cartesian fan-out.
Build the TICKIT Star Schema
Write the CREATE OR REPLACE TABLE gold.fact_sales DDL statement in Delta Lake. • Target Schema Columns: sales_sk BIGINT NOT NULL, salesid INT NOT NULL, listid INT NOT NULL, buyer_sk BIGINT NOT NULL, seller_sk BIGINT NOT NULL, event_sk BIGINT NOT NULL, date_sk INT NOT NULL, qtysold INT NOT NULL, pricepaid DECIMAL(10,2) NOT NULL, commission DECIMAL(10,2) NOT NULL. • Integrity Constraints: PRIMARY KEY (sales_sk) RELY (informational constraint guiding query planning). • Storage Optimization: USING DELTA, CLUSTER BY (date_sk, event_sk). Key Concepts: Surrogate Keys: System-generated integer keys insulating analytical schemas from upstream operational key reassignments. Liquid Clustering: Modern Delta Lake clustering optimizing read performance without manual partition management.
SCD Type 2 Seller Dimension: Historical Sales Attribution
Write an 'as-of' point-in-time attribution query connecting gold.fact_sales s to gold.dim_user_scd2 u. • Expected Columns: s.salesid, s.seller_id, u.city AS seller_historical_city, u.state AS seller_historical_state, s.saletime, s.pricepaid • Temporal Boundary: Join on s.seller_id = u.user_id AND s.saletime BETWEEN u.effective_from AND u.effective_to. Key Concepts: Point-in-Time Dimension Attribution: Resolving seller operational jurisdiction and tax nexus at historical transaction moment rather than contemporary state.
Role-Playing Dates and Seasonality
Write a monthly seasonality trend query joining gold.fact_sales s to role-playing date dimension gold.dim_date_sale d on s.date_sk = d.date_sk. • Expected Columns: d.year, d.month, total_tickets, gross_revenue, prev_month_gross • Metric Calculations: Group by d.year, d.month. total_tickets = sum(s.qtysold) gross_revenue = sum(s.pricepaid) prev_month_gross = LAG(sum(s.pricepaid), 1) OVER (ORDER BY d.year, d.month) Order by d.year, d.month. Key Concepts: Role-Playing Dimension: Reusing a single dimension table under multiple semantic aliases (e.g. sale date vs. event date).
Seller Ranking by State Using Window Functions
Write a state-level seller ranking query joining gold.fact_sales s to gold.dim_user_seller u on s.seller_sk = u.user_sk. • Expected Columns: u.state, u.userid AS sellerid, sum(s.pricepaid) AS gross, state_rank • Ranking Logic: Group by u.state, u.userid. state_rank = RANK() OVER (PARTITION BY u.state ORDER BY sum(s.pricepaid) DESC) Order by u.state ASC, state_rank ASC. Key Concepts: Partitioned Window Ranking: Computing ordinal ranking partitioned across business or geographic territories.
Inventory Sell-Through & Event Funnel Conversion
Write an inventory sell-through query joining pre-aggregated listings and sales to gold.dim_event. • Expected Columns: e.eventid, e.eventname, l.listed_tickets, coalesce(s.sold_tickets, 0) AS sold_tickets, sell_through_rate • Pre-Aggregation Logic: Subquery l: Aggregate gold.fact_listing by event_sk to get listed_tickets = sum(numtickets). Subquery s: Aggregate gold.fact_sales by event_sk to get sold_tickets = sum(qtysold). Join to gold.dim_event e on event_sk. sell_through_rate = round(coalesce(s.sold_tickets, 0) 100.0 / l.listed_tickets, 2) Order by sell_through_rate DESC. Key Concepts: Grain Alignment: Pre-aggregating disparate fact tables to a common grain before joining to eliminate Cartesian multiplication.
Bronze Ingestion and Schema Evolution
Write the CREATE TABLE IF NOT EXISTS bronze.users DDL statement in Delta Lake. • Schema Columns: userid INT, username STRING, firstname STRING, lastname STRING, city STRING, state STRING, email STRING, phone STRING, _ingest_ts TIMESTAMP, _source_file STRING, _batch_id STRING. • Storage Engine: USING DELTA. • Operational Note: In Databricks Delta Lake, schema evolution is typically enabled on write operations using options like mergeSchema = 'true' or in streaming ingestion using WITH SCHEMA EVOLUTION. Key Concepts: Schema Evolution: Dynamically appending newly detected columns into Delta Lake tables without throwing write exceptions.
Silver Conform, Dedupe and MERGE
Write an idempotent MERGE INTO silver.sales statement sourcing from deduplicated bronze sales. • Deduplication & Merge Logic: Filter bronze with ROW_NUMBER() OVER (PARTITION BY salesid ORDER BY _ingest_ts DESC) = 1. Match target silver.sales t on t.salesid = s.salesid. WHEN MATCHED THEN UPDATE SET - WHEN NOT MATCHED THEN INSERT Key Concepts: Idempotent Ingestion: Guaranteeing that reprocessing an ingestion batch produces identical, consistent target state.
Gold Marts, Time Travel and CDF
Enable CDF via ALTER TABLE gold.fact_sales SET TBLPROPERTIES and query table_changes(). • TBLPROPERTIES: Set 'delta.enableChangeDataFeed' = 'true'. • Expected Columns: sales_sk, salesid, pricepaid, commission, _change_type, _commit_version. • Query Filter: Query table_changes('gold.fact_sales', 1) where _change_type = 'update_postimage'. Key Concepts: Change Data Feed (CDF): Built-in Delta Lake streaming capability exposing insert, update, and delete row events.
Data Contract and Quality Assertions
Author a valid Bitol ODCS v3.0.2 YAML contract for gold.fact_sales. • Contract Declarations: apiVersion: v3.0.2 kind: DataContract id: urn:datacontract:tickit:sales server: tickit-prod dataset: gold.fact_sales with column sales_sk having logicalType: integer, primaryKey: true Key Concepts: Open Data Contract Standard (ODCS): Industry standard for defining declarative, machine-readable data contracts.
PII, Masking and Row-Level Security
Write the SQL definitions for dynamic masking function gov.mask_email and row filter function gov.filter_state. • gov.mask_email(val STRING): Use regexp_replace to mask username characters before @ with asterisks. • gov.filter_state(row_state STRING): Verify row_state against current_user() assignment in gov.user_state_assignment. Key Concepts: Dynamic Masking & Row Filtering: Enforcing granular data minimization and jurisdictional access directly in the Lakehouse.
Financial Reconciliation: Sales to Payout Settlement
Write a financial reconciliation query joining gold.fact_sales s to raw.payout p on salesid. • Expected Columns: gross_sales, gross_payout_settlement, reconciliation_difference, commission_leakage_count • Pre-Aggregation Note: To prevent fan-out when multiple payout tranches exist per sale, payouts should be aggregated to salesid grain before calculating final variance. • Reconciliation Math: gross_sales = sum(s.pricepaid) gross_payout_settlement = sum(p.seller_payout + p.platform_fee) reconciliation_difference = sum(s.pricepaid) sum(p.seller_payout + p.platform_fee) commission_leakage_count = sum(CASE WHEN s.pricepaid <> (p.seller_payout + p.platform_fee) THEN 1 ELSE 0 END) Key Concepts: Financial Reconciliation: Proving complete ledger balance between marketplace sales and bank disbursements.
Social Graph Co-Attendance: Event Companion Discovery
Write a social graph co-attendance query joining silver.friend f with silver.sales for each person. • Expected Columns: person_a, person_b, count(DISTINCT a.eventid) AS events_together • Graph Canonicalization Logic: Canonical pairs: LEAST(a.personid, f.friendid) AS person_a, GREATEST(a.personid, f.friendid) AS person_b. Symmetry breaking: Filter a.personid < f.friendid. Event co-attendance: Match a.eventid = b.eventid. Group by person_a, person_b. Key Concepts: Canonical Undirected Edges: Using LEAST/GREATEST with symmetry breaking to prevent duplicated bipartite graph pairs.
Fraud Indicators: Price Anomalies & Identity Collisions
Write a fraud forensic detection query identifying scalping anomalies and identity collisions. • Expected Columns: ep.listid, ep.sellerid, ep.priceperticket, ep.avg_event_price, round(ep.priceperticket / ep.avg_event_price, 2) AS price_ratio • Detection Logic: Window benchmark: avg(priceperticket) OVER (PARTITION BY eventid) AS avg_event_price. Identity collision: Join silver.person_ssn on s1.personid <> s2.personid AND s1.ssn = s2.ssn. Scalping anomaly: Filter ep.priceperticket > 1.5 ep.avg_event_price. Order by price_ratio DESC. Disclaimer: All identities, numbers, and transactions are synthetic benchmarking data. Key Concepts: Sybil Identity Collisions: Detecting multiple front accounts operated by a single entity sharing tax identifiers.
Marketing and Finance 360
Write the Category Profitability 360 query joining gold.fact_sales s to gold.dim_event e and gold.dim_category c. • Expected Columns: c.catgroup, c.catname, total_transactions, gross_merchandise_value, platform_revenue, net_seller_payout • Financial Formulas: Group by c.catgroup, c.catname. total_transactions = count(s.sales_sk) gross_merchandise_value = sum(s.pricepaid) platform_revenue = sum(s.commission) net_seller_payout = sum(s.pricepaid s.commission) (GMV minus platform fee take) Order by gross_merchandise_value DESC. Key Concepts: Category 360 Rollup: Executive dimensional reporting evaluating GMV and take rate across entertainment categories.
TICKIT Marketplace 360
Author the master reconciliation query joining gold.fact_sales s to gold.dim_date_sale d and raw.payout p. • Expected Columns: d.year, d.qtr, total_tickets_sold, gross_sales_revenue, commission_earned, seller_payout_settled, reconciliation_variance • Quarterly Rollup Math: Group by d.year, d.qtr. total_tickets_sold = sum(s.qtysold) gross_sales_revenue = sum(s.pricepaid) commission_earned = sum(s.commission) seller_payout_settled = sum(p.seller_payout) reconciliation_variance = sum(s.pricepaid) (sum(s.commission) + sum(p.seller_payout)) Order by d.year ASC, d.qtr ASC. Key Concepts: Capstone Financial Audit: Reconciling gross sales, earned platform fees, and settled merchant bank payouts.
Two Ways to Validate Your Work
DynaDatum provides two distinct validation pathways so you can test your solutions rapidly in your browser or against a live cloud cluster.
1. Browser-Based Validation
CLIENT-SIDE • 0s LATENCY • RUNS IN YOUR BROWSERGet immediate feedback on your solution structure, DDL statements, required schema constraints, and temporal window clauses directly inside your browser tab.
2. Live Databricks Verification
DIRECT REST 2.0 • BRING YOUR OWN WORKSPACEFor supported challenges, execute your solution against your own Databricks environment (Free Community Edition or cloud instances) via official REST API.
Everything Is Free — Just Sign In with Google
All 52 challenges, 3 forensic capstones, and verification tools are 100% free on DynaDatum. Simply sign in with your Google account to save progress and verify solutions.
| Feature / Capability | Community Edition ($0 / Free with Google Sign-In) |
|---|---|
| Hands-On Practice Labs | All 52 Labs Across 11 Tracks (100% Free) |
| Browser-Based Validation | Included |
| Live Databricks Cluster Verification | Unlimited on All 52 Labs (100% Free) |
| Offline Jupyter Notebooks (.ipynb) | All 46 Production Notebooks (100% Free) |
| Guided Forensic Capstones | All 3 Capstones (Global DynaDatum Bank, DynaDatumKart & TICKIT 360) |
| Bitol ODCS v3.0 Data Contracts | Full Generator & CI/CD Verifier |
| Practitioner Completion Certificate | Verifiable Digital Credential (Free) |
Ready to Build Real Data Engineering Skills?
Stop following passive video tutorials. Diagnose production outages, fix bi-temporal date drift, implement machine-readable data contracts, and build verifiable portfolio experience today.