Entity, Relationship, and Attribute
Entities
- Generally described by a noun
- 'thing which can be distinctly identified' -Chen
- Can be "weak" by relying on another entity to have a unique identifier
Generalization
- Generalizations
- Broad terms such as people
- Supergroups
- Specializations
- Narrower terms such as students or faculty
- Subgroups
Relationship
- Usually described as verbs or verb phrases
- A link or association between entities
Attribute
- Properties and characteristics of entities
- Data member
- Can be multi or single valued
- Can be derived (dashed lines)
- Can be calculated from another attribute, but not usually modified directly
Composite
- Simple/Atomic
- Cannot be broken down further
- Composite/group
- Could possibly be broken down into sub attributes
ER Diagrams
Entities
- Boxes
- Weak entities - double boxes
Attributes
- Ovals
- Derived - Dashed
- Multivalued - double oval
- Primary Key - underlined
Mapping
Multivalued
- Create a new table
- The table will contain a column for a key and the attribute
- It should be named entity_attribute
- Each row will contain the key of its entity followed by a value
STUDENT
student_number |
name.first |
name.last |
54561231 |
John |
Doe |
54561232 |
Jane |
Doe |
STUDENT_SCHOOL |
|
|
student_number |
school |
54561231 |
U. Alabama |
54561231 |
UF |
54561232 |
UCF |
Composite
- The composite attribute will become known as the qualifier
- A column will be created for each atomic attribute in the relationship
- Each column will be named qualifier.atomic using dot-notation
name.first |
name.last |
Address |
John |
Doe |
123 main st |
Jane |
Doe |
222 2nd street |