Design a data warehouse that supports many-to-many relationships
There are several business scenarios that require modeling many-to-many relationships such as Customers-to-Products and Products-to-Customers. Some of these many-to-many relationship requirements arise from the need to support:
- Different perspectives for reporting and analysis
- Complex business processes
- Relational source system limitations
A data warehouse model that supports many-to-many relationships
To satisfy the Sales manager’s requirement a SQL query as shown below can be executed to select customers from the Southeast region for example:
SELECT distinct
dcust.Customer
FROM [Fact].[Sale] fs
inner join [Dimension].[Customer] dcust on dcust.[Customer Key] = fs.[Customer Key]
inner join [Dimension].City dc on dc.[City Key] = fs.[City Key]
WHERE dc.[Sales Territory] = 'Southeast'
In the query above, notice that three tables needed to be joined, [Fact].[Sales [Dimension].[Customer] and [Dimension].[City]. The [Fact].[Sales] table in this query acts as a relationship table between the two dimension tables, thus creating a many-to-many relationship.
Comments
Post a Comment