0% found this document useful (0 votes)
139 views

Star and Snowflake

The document discusses star schemas and snowflake schemas. A star schema is the simplest form of data warehouse schema, consisting of one or more fact tables connected to multiple dimension tables in a star-like shape. A snowflake schema is similar to a star schema but normalizes dimensions into multiple related tables, whereas a star schema represents each dimension with a single table, creating a more complex snowflake-like shape when dimensions have multiple levels of relationships.

Uploaded by

Rahul Chauhan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views

Star and Snowflake

The document discusses star schemas and snowflake schemas. A star schema is the simplest form of data warehouse schema, consisting of one or more fact tables connected to multiple dimension tables in a star-like shape. A snowflake schema is similar to a star schema but normalizes dimensions into multiple related tables, whereas a star schema represents each dimension with a single table, creating a more complex snowflake-like shape when dimensions have multiple levels of relationships.

Uploaded by

Rahul Chauhan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Star Schema : Star Schema is a relational database schema for representing multimensional data.

It
is the simplest form of data warehouse schema that contains one or more dimensions and fact tables.
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.

Snowflake Schema : A snowflake schema is a term that describes a star schema structure normalized
through the use of outrigger tables. i.e dimension table hierachies are broken into simpler tables.

In a star schema every dimension will have a primary key.

 In a star schema a dimension table will not have any parent table.
 Whereas in a snow flake schema a dimension table will have one or more parent tables.
 Hierarchies for the dimensions are stored in the dimensional table itself in star schema.
 Whereas hierachies are broken into separate tables in snow flake schema. These hierachies helps to
drill down the data from topmost hierarchies to the lowermost hierarchies.

==========================================================

A snowflake schema is a logical arrangement of tables in a multidimensional database such that


the entity relationship diagram resembles a snowflake in shape. The snowflake schema is
represented by centralized fact tables which are connected to multiple dimensions.

The snowflake schema is similar to the star schema. However, in the snowflake schema,
dimensions are normalized into multiple related tables, whereas the star schema's dimensions are
normalized with each dimension represented by a single table. A complex snowflake shape
emerges when the dimensions of a snowflake schema are elaborate, having multiple levels of
relationships, and the child tables have multiple parent tables ("forks in the road"). The
"snowflaking" effect only affects the dimension tables and NOT the fact tables.

Star Scehma
The star schema (also called star-join schema, data cube, or multi-dimensional schema) is the simplest
style of data warehouse schema. The star schema consists of one or more fact tables referencing any
number of dimension tables. The star schema is considered an important special case of the snowflake
schema, and is more effective for handling simpler queries.

The facts that the data warehouse helps analyze are classified along different dimensions:

 The fact table holds the main data. It includes a large amount of aggregated data, such as
price and units sold. There may be multiple fact tables in a star schema.
 Dimension tables, which are usually smaller than fact tables, include the attributes that
describe the facts. Often this is a separate table for each dimension. Dimension tables can
be joined to the fact table(s) as needed.

Dimension tables have a simple primary key, while fact tables have a set of foreign keys which
make up a compound primary key consisting of a combination of relevant dimension keys.

It is common for dimension tables to consolidate redundant data in the most granular column,
and are thus rendered in second normal form. Fact tables are usually in third normal form
because all data depends on either one dimension or all of them, not on combinations of a few
dimensions.

The facts that the data warehouse helps analyze are classified along different dimensions:

 The fact table holds the main data. It includes a large amount of aggregated data, such as
price and units sold. There may be multiple fact tables in a star schema.
 Dimension tables, which are usually smaller than fact tables, include the attributes that
describe the facts. Often this is a separate table for each dimension. Dimension tables can
be joined to the fact table(s) as needed.
Star Schemas
The star schema is perhaps the simplest data warehouse schema. It is called a star schema
because the entity-relationship diagram of this schema resembles a star, with points radiating
from a central table. The center of the star consists of a large fact table and the points of the star
are the dimension tables.

A star schema is characterized by one or more very large fact tables that contain the primary
information in the data warehouse, and a number of much smaller dimension tables (or lookup
tables), each of which contains information about the entries for a particular attribute in the fact
table.

A star query is a join between a fact table and a number of dimension tables. Each dimension
table is joined to the fact table using a primary key to foreign key join, but the dimension tables
are not joined to each other. The cost-based optimizer recognizes star queries and generates
efficient execution plans for them.

A typical fact table contains keys and measures. For example, in the sh sample schema, the fact
table, sales, contain the measures quantity_sold, amount, and cost, and the keys cust_id,
time_id, prod_id, channel_id, and promo_id. The dimension tables are customers, times,
products, channels, and promotions. The product dimension table, for example, contains
information about each product number that appears in the fact table.

A star join is a primary key to foreign key join of the dimension tables to a fact table.

The main advantages of star schemas are that they:

 Provide a direct and intuitive mapping between the business entities being analyzed by
end users and the schema design.
 Provide highly optimized performance for typical star queries.
 Are widely supported by a large number of business intelligence tools, which may
anticipate or even require that the data-warehouse schema contain dimension tables

Star schemas are used for both simple data marts and very large data warehouses.

Figure 17-2 presents a graphical representation of a star schema.

Figure 17-2 Star Schema


Text description of the illustration dwhsg007.gif

Snowflake Schemas

The snowflake schema is a more complex data warehouse model than a star schema, and is a
type of star schema. It is called a snowflake schema because the diagram of the schema
resembles a snowflake.

Snowflake schemas normalize dimensions to eliminate redundancy. That is, the dimension data
has been grouped into multiple tables instead of one large table. For example, a product
dimension table in a star schema might be normalized into a products table, a
product_category table, and a product_manufacturer table in a snowflake schema. While
this saves space, it increases the number of dimension tables and requires more foreign key joins.
The result is more complex queries and reduced query performance. Figure 17-3 presents a
graphical representation of a snowflake schema.

Figure 17-3 Snowflake Schema

You might also like