This is actually the 15th, but I’m watching the videos from yesterday.
Homework 5 is due on March 31st.
Prof says there’s 8 videos this week. That’s 4 per class period.
A well-formed ER diagram captures entities and relationships between them, and does not require much normalization (if any).
When we normalize conman, there’s actually like 4 entities in there. The original ER diagram was doing too many different things.
When there are multiple entities, the entities may have relationships between them.
An entitiy class is an abstract thing. There may also be entity instances. For example, Jim may be an Employee.
Relationship classes vs instances, degrees, has-a
A line between entities is an entity class. Every relationship must have a verb phrase. This describes the relationship.
For example, a department has an employee.
An employee is mentored by another employee. This is a recursive relationship.
An instance is an actual relationship between entity instances.
The cross-over model: When reading a relationship class, if the description has a
/
character, read only the second description encountered in the direction of travel. For example:
Employee ———- has many/assigned to ———- Department
read as ‘employee assigned to department’
OR ‘department has many employees’
This is completely absurd, but we might be tested on it.
The degree of a relationship is how many entities participate in that relationship. A recursive employee-mentors-employee relationship has a degree of one. Employees in departments is a degree of 2.
A binary relationship is a relationship with a degree of two.
Degree | Name |
---|---|
1 | Recursive |
2 | Binary |
It looks like, in chen notation, relationships are diamonds.
In crows foot, it’s just a line between multiple tables.