|
|
|
|
|
|
|
|
Attributes can come in different types....
Example: age - can be derived from "birth date".
Note: never store derived attributed in the database, you introduce unnecessary redundance....
Values of key attributes can be used to identify an entity uniquely
Example:
I.e.: NULL == NULL result is FALSE (because NULL means "unavailable", so we don't know the outcome of the equality comparision, thus resulting is FALSE)
Next up: the R (Relationship) in the ER-model
|
|
In other words:
This is the main reason why a relation is not used in ER modeling (content of relations must change in database, e.g., more kids are born to parents)...
Instead, ER-modeling uses the concept of relationship
So a relationship type R consists of all possible subset of the cartesian product E1 x E2 x ... x En
|
to model a part of the real world.
E.g., A tire compnay Good-year will call a tire an entity, because it manufacture tires and will need to maintain a lot of information on tires (e.g., how (components) to make it, where it is made, etc - these information will be needed to compute cost/earning for the company)
On the other hand, a car manufacturer - like Honda - would most likely look at a tire as an attribute of a car : it does not care how or where the tire is made, all Honda needs to know is the make of the tire
THAT Accord car has four Good-Year 700 tires
Otherwise, the object is modeled as an attribute