7. ENTITY RELATIONSHIP MODELLING

7.3.4: Multi-Valued Attributes

Now, suppose someone proposes to track each employee’s university degrees with an attribute named empDegree. Certainly, many employees could have several degrees and so there are multiple values to be stored at one time. Consider the following sample data for three employees: each employee has a single employee number and phone number, but they have varying numbers of degrees.

empNum

empPhone

empDegree

123

233-9876

333

233-1231

BA, BSc, PhD

679

233-1231

BSc, MSc

Figure 7.10: Employees number, phone, degrees

For a given employee and point in time, empDegree could have multiple values as is the case for the last two employees listed above. In this case we say the attribute is multi- valued.

Multi-valued attributes are illustrated in an ERD with a double-lined oval.

image
       Figure 7.11: Employee degrees shown as multi-valued

We can use multi-valued attributes to (at least) document a requirement, and at a later time, refine the model replacing the multi-valued attribute with a more detailed representation. The presence of a multi-valued attribute indicates an area that may require more analysis; multi-valued attributes are discussed again in Chapter 10.

 

Exercises

1) Consider the employee entity type.

 

2) Suppose the company needs to track the names of dependents for each employee. Show the dependent name as a multi-valued attribute.

 

3) Modify your ERD to show empDependentName as a composite multi-valued attribute comprising first and last names and middle initials.

 

4) Create an ERD that avoids the multi-valued attribute empDegrees in the previous example. Hint: Consider including another entity type and a relationship for keeping track of degrees.

License

Share This Book