Chap2 - Table Relationship and Data Models
Chap2 - Table Relationship and Data Models
Models
Yunkai Liu, Ph.D.
Gannon University
What is “Data Model”
• What we have so far is a collection of independent tables which share
no connections or relationships. NOT data model.
• Star Schema
Practice (cont)
• AW_Product_Lookup AW_Product_Subcategories
• AW_Product_Subcategories AW_Product_Categories
• Snowflake
Manage and Edit Relationship
• Please edit the relations between AW_Sales AW_Calendar
• Change from the order_date into stock_date
• And change back
Active vs Inactive Relationship
• Add another relationship AW_Sales AW_Calendar
• Using Stock_date vs date
• Back to Relationship
• Note, we cannot connect AW_Returns with AW_Sales. M-M relationship error
• We have to relate AW_Returns with other tables like AW_Sales.
Report
• Click “Report” Drag “ProductName” and “OrderQuantity” into
report Drag “ReturnQuantity” into “Value” under Visualization
• Case 1
• Remove “ProductName”
• Drag “SaleTerritoryKey” under AW_Territory Table into “Value”
• Case 2
• Remove “SaleTerritoryKey”
• Drag “TerritoryKey” under AW_Sale Table into “Value”
• Case 3
• Remove “TerritoryKey”
• Drag “TerritoryKey” under AW_returns Table into “Value”