WalzoneInterview Prep
📞 Interviewing soon? Practice with a realistic AI mock phone interview — it calls you, then scores you. First 15 min FREE →

SQL Server · Advanced · question 41 of 100

What is the difference between a star schema and a snowflake schema in data warehousing?

📕 Buy this interview preparation book: 100 SQL Server questions & answers — PDF + EPUB for $5

In data warehousing, a star schema and a snowflake schema are two common ways to model the relationships between tables. Both schemas are used to organize data for efficient querying and analysis.

In a star schema, there is one central fact table that contains the core data that is being analyzed. This fact table is surrounded by dimension tables, each of which contains a specific category of attributes related to the core data. Each dimension table is connected to the fact table through a foreign key relationship. The fact table contains numerical measures, such as sales or profits, whereas the dimension tables contain descriptive attributes, such as time, geography, or product details.

In contrast, a snowflake schema is a variation of a star schema where the dimension tables are further normalized. This means that some dimension tables are broken up into additional dimension tables, creating a more complex and detailed schema. For example, a dimension table for products may have separate tables for categories and subcategories. This results in a more normalized schema that can be more flexible and maintainable, but potentially slower to query due to the additional tables and relationships.

In summary, a star schema is a simpler, denormalized schema that is easier to understand and query, while a snowflake schema is a more complex, normalized schema that is more flexible and maintainable. Choosing between the two depends on the specific needs of the data warehouse and the trade-off between simplicity and flexibility.

Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic SQL Server interview — then scores it.
📞 Practice SQL Server — free 15 min
📕 Buy this interview preparation book: 100 SQL Server questions & answers — PDF + EPUB for $5

All 100 SQL Server questions · All topics