Information Technology
Data Modeling
Ads
Let’s point out a few things about the Star Schema above:
Even though a primary key value must be one of a kind in the rows of a dimension table the value can take place many times in a foreign key of a fact table, as in a many to one relationship. The many to one relationship can be present between the foreign keys of the fact table and the primary key they refer to in the dimension tables.
The star schema can hold many fact tables as well. Multiple fact tables are present because the have unrelated facts, like invoices and sales. With some situations multiple fact tables are present simply to support performance.
You can see multiple fact tables serving this purpose when they are used to support levels of summary data, more specifically when the amount is large, like with daily sales data.
Referencing tables are also used to define many-to-many relationships between dimensions. This is usually referred to as an associative table or even a cross-reference table. This can be seen at work in the sales database as well. In a sales database each product has one or more groups that is belongs to, each of those groups also contain many products.
The many-to-many relationships is designed through the establishment of a referencing table that is meant to define the various combinations of the products and groups within the organization.
We can also identify many-to-many relationships by having dimension tables with multicolumn primary keys that serve as foreign key references in fact tables.
A rough example of this would be yet again with the sale database, as we said before each product is in one or more groups and each of those grouse have multiple products, which is a many-to-many relationship.
When designing a schema for a database we must keep in mind that the design affects the way in which it can be used as well as the performance.
Due to this fact it is vital that one makes the preliminary investment in time and research they dedicate to the design a database one that is beneficial to the needs of its user. Let’s wrap things up with a few suggestions about things to consider when designing a schema:
Ads
First Page: Star Schema
GeekInterview
Popular Sections