FOUNDATIONS-3: Facts vs. Dimensions: Combining Orders & Customers
Track: Analytics Foundations • Difficulty: Beginner • Mastery Points: 100 PTS
Business Problem Scenario
In a well-designed data warehouse, we split data into two kinds of tables: Fact tables (things that happen, like orders) and Dimension tables (who/where/what, like customers). Your manager wants to know total sales per city, but city lives in gold.dim_customers while order amounts live in gold.fact_orders.
Engineering Objective
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
Target Table: gold.fact_orders (order_id, customer_id, order_amount), gold.dim_customers (customer_id, full_name, city)
Verification & Architecture Insights
Fact tables store measurable events (orders, payments), while Dimension tables store descriptive context (customers, cities, products). Joining them cleanly lets you slice metrics by any business attribute.