Q1. What is the difference between a fact table and a dimension table in a data warehouse?
A fact table stores measurable, quantitative data — the metrics of a business process like sales transactions, page views, or order amounts. Each row represents a business event and contains numerical measures plus foreign keys to dimension tables. A dimension table stores descriptive attributes that contextualise the facts — date, product, customer, location. The star schema joins fact tables to dimension tables; the snowflake schema normalises dimension tables further. Fact tables are typically large (millions of rows), dimension tables are smaller but wider. This separation enables fast OLAP queries via slicing and dicing.