Attributes: Course (Course - Id, Title, Credits)
Attributes: Course (Course - Id, Title, Credits)
Attributes: Course (Course - Id, Title, Credits)
An entity is represented by a set of attributes, that is descriptive properties possessed by all members of an entity set. Example: instructor = (ID, name, street, city, salary ) course= (course_id, title, credits) Domain the set of permitted values for each attribute Attribute types: Simple and composite attributes. Single-valued and multivalued attributes Example: multivalued attribute: phone_numbers Derived attributes Can be computed from other attributes Example: age, given date_of_birth
Composite Attributes
One to one
One to many
Note: Some elements in A and B may not be mapped to any elements in the other set
Many to one
Many to many
Note: Some elements in A and B may not be mapped to any elements in the other set
Keys
A super key of an entity set is a set of one or more attributes whose values uniquely determine each entity. A candidate key of an entity set is a minimal super key ID is candidate key of instructor course_id is candidate key of course Although several candidate keys may exist, one of the candidate keys is selected to be the primary key.
E-R Diagrams
Roles
Entity sets of a relationship need not be distinct Each occurrence of an entity set plays a role in the relationship The labels course_id and prereq_id are called roles.