The effect of determinants on SQL

It is important to understand the effect that determinants have on the SQL that is generated. Determinants affect the grouping and aggregation of data, including other query subjects that have relationships with the query subject as well as the query subject itself.

For example, consider the following information. Each Product Line contains many occurrences of Product Type. Each Product Type contains many occurrences of Product. For Product, Product Key is a surrogate key and Product Number is a business key that is used as an attribute. Data joined on Product Key is aggregated correctly when reported by Product Line or Product Type or both.

Determinant

Key

Group by

Uniquely identified

Attributes

Product line

Product line code

Yes

Product line

Product type

Product type code

Yes

Product type

Product

Product key

Yes

Cost

Margin

Product name

Product number