What is a star schema and how does it differ from a snowflake schema?

Data Warehousing Questions Medium



53 Short 38 Medium 47 Long Answer Questions Question Index

What is a star schema and how does it differ from a snowflake schema?

A star schema and a snowflake schema are both data modeling techniques used in data warehousing.

A star schema is a simple and widely used schema design in which a central fact table is surrounded by multiple dimension tables. The fact table contains the measurements or metrics of interest, while the dimension tables provide the context or descriptive attributes for the measurements. The fact table is connected to the dimension tables through foreign key relationships. This schema resembles a star shape when visualized, hence the name "star schema."

On the other hand, a snowflake schema is an extension of the star schema where the dimension tables are further normalized into multiple levels of tables. In a snowflake schema, the dimension tables are broken down into more granular tables, resulting in a more complex and normalized structure. This normalization reduces data redundancy and improves data integrity but increases the number of tables and joins required to retrieve data. The snowflake schema resembles a snowflake shape when visualized, hence the name "snowflake schema."

In summary, the main difference between a star schema and a snowflake schema lies in the level of normalization. A star schema is simpler and denormalized, with fewer tables and joins, making it easier to understand and query. On the other hand, a snowflake schema is more normalized, reducing redundancy but increasing complexity and the number of tables and joins required. The choice between these schemas depends on the specific requirements and trade-offs of the data warehousing project.