The Entity-Relationship Model. Instructor: Mohamed Eltabakh firstname.lastname@example.org. Part II. Entities with Different Attribute Types (Recap). Multivalued Attribute: major. Primitive Attribute: sNumber. Composite Attribute: address. Student entity type with all its attributes. DoB. Age.
Instructor: Mohamed Eltabakh
Multivalued Attribute: major
Primitive Attribute: sNumber
Composite Attribute: address
Student entity type
with all its attributes
Derived Attribute: Age
Attributes can be attached to Entity Sets or Relationships
Model the relationship Supplier supplies Products to Consumers
Refer to the same entity in the relationship
Recursive relationship type :Part-Subpart
There are Parts that play the role of superPart
There are Parts that play the role of subPart
Key for Movie is <title, year>
Key for Student is sNumber
We can represent key for entity type consisting of more than one attribute (e.g.: Movie)
What if we do not underline “Date” attribute ??
A student is taking “many” courses.
A course can be taken by “many” students.
One-to-Many from Customer to Loan
How : Expressed using (min, max)
quantityCardinality Constraints for Recursive Relationships
A Part may contain manysubparts
A Part can be subpart in manysuperParts
A Part can have manysubParts
A Part can be subpart for at most onesuperPart
Every Supplier supplies some Product to some Consumer
To add degree constraints, introduce a new entity set and create multiple binary relationships !!!
What is the key of this entity ???
Course number is unique only within the department
Weak entity set
Identifying entity set
Stating your assumptions in text is very important !!!
Lets interactively design a database for a hospital
Overlapping & Partial
person_id is the primary key