The Context of Your Business Data: Attributes » Attributes with multiple ID columns: Compound attributes

Attributes with multiple ID columns: Compound attributes

A compound attribute is an attribute with multiple columns specified as the ID column. This implies that more than one ID column is needed to uniquely identify the elements of that attribute. Generally, you create a compound attribute when your logical data model reflects that a compound key relationship is present. In the relational database, a compound key is a primary key that consists of more than one database column.

For example, a retail project has two attributes, Class and Item. Class is the parent of Item and has a one-to-many relationship with it. The values in the Item_ID column do not uniquely identify an item. The item shirt has an Item_ID of 1. However, there are different shirts, depending on the class, which includes men’s, women’s, and children’s. Therefore, to uniquely identify a man’s shirt, Item_ID and Class_ID must be grouped together, creating a compound attribute.

All of the ID forms of the compound attribute should be within the same lookup table.