What is Fact and Dimensions tables?
Asked in the technical screen stage. Data warehousing concept. Write a SQL query using the provided fact and dimension tables to summarize completed order facts.
order_month, product_category, completed_orders, and total_revenue.Unknown.order_month, then product_category.| Column | Type | Description |
|---|---|---|
| order_fact_idPK | INT | Unique order fact identifier |
| order_date_id | INT | Reference to the calendar date dimension |
| product_id | INT | Reference to the product dimension |
| quantity | INT | Number of units in the order fact |
| unit_price | NUMERIC(10,2) | Price per unit |
| order_status | VARCHAR(20) | Order lifecycle status |
| Column | Type | Description |
|---|---|---|
| date_idPK | INT | Surrogate key for the date dimension |
| calendar_date | DATE | Calendar date |
| month_name | VARCHAR(20) | Calendar month name |
| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Surrogate key for the product dimension |
| product_name | VARCHAR(100) | Product name |
| category | VARCHAR(50) | Product category |