What are the different types of attributes in an ER model?
EasyConceptER Model
Answer
Attributes are classified by their structure, by how many values they hold and by how their values are obtained.
- Simple vs composite: a simple attribute cannot be divided, such as
age; a composite attribute has parts, such asname(first, last) oraddress(street, city, pin). - Single-valued vs multivalued: a single-valued attribute has one value per entity, such as
dob; a multivalued attribute can have several, such asphones, and is drawn as a double oval. - Stored vs derived: a derived attribute is computed from another one, such as
agefromdob, and is drawn as a dashed oval. - Key attribute: uniquely identifies the entity, such as
emp_id, and is underlined.
Example: Employee(emp_id, name{first, last}, {phones}, dob, age)
emp_idis the key,nameis composite,phonesis multivalued andageis derived fromdob.- In tables,
namebecomes the columnsfirst_nameandlast_name, andphonesmoves to a separate tableemployee_phones(emp_id, phone), because a column must hold a single value.