|
Written by Roceller Alvarez
|
|
Sunday, 05 March 2006 |
|
The star schema (sometimes referenced as star join schema) is the simplest data warehouse schema, consisting of a single "fact table" with a compound primary key, with one segment for each "dimension" and with additional columns of additive, numeric facts.
It is called a star schema because the entity-relationship diagram between dimensions and fact tables resembles a star where one fact table is connected to multiple dimensions. The center of the star schema consists of a large fact table and it points towards the dimension tables. The advantage of star schema are slicing down, performance increase and easy understanding of data.
Example SQL: SELECT sum (f_sales.units_sold) FROM f_sales, d_customer, d_time, d_store, d_product WHERE f_sales.customer_id = d_customer.customer_id AND f_sales.date_id = d_time.date_id AND f_sales.store_id = d_store.store_id AND f_sales.product_id = d_product.product_id AND d_time.year_id = 1997 AND d_product.category_id = "tv" GROUP BY d_product.brand, d_store.country_iso_id Star Schema Diagram: 
Related Articles:
- Star and Snowflake Schema
- Star Schema
|