7. ENTITY RELATIONSHIP MODELLING
7.3: Attributes
Attributes are the characteristics that describe entities and relationships. For example, a Student entity may be described by attributes including:
-
- student number
- name
- first name
- last name
- address
- date of birth
- gender
An Invoice entity may be described by attributes including:
-
- invoice number
- invoice date
- invoice total
A common convention for naming attributes is to use singular nouns. Further, a naming convention may require one of:
-
- All characters are in upper case.
- All characters are in lower case.
- Only the first character is in upper case.
- All characters are lower case, but each subsequent part of a multipart name has the first character capitalized
Using the last convention mentioned, some examples of attribute names:
-
- lastName for last name
- empLastName for employee last name
- deptCode for department code
- prodCode for product code
- invNum for invoice number
In practice a naming convention is important, and you should expect the organization you are working for to have a standard approach for naming things appearing in a model. A substantial data model will have tens, if not into the hundreds, of entity types, many more attributes and relationships. It becomes important to easily understand the concept underlying a specific name; a naming convention can be helpful.
There are many ways we can look at attributes including whether they are atomic, composite, single-valued, etc. We consider these next.