Dr P Sreenivasa Kumar Professor CS&E Dept I I T Madras
Entity-Relationship (E/R) Model
Widely used conceptual level data model • proposed by Peter P Chen in 1970s Data model to describe the database system at the requirements collection stage • high level description. • easy to understand for the enterprise managers. • rigorous enough to be used for system building. Concepts available in the model • entities and attributes of entities. • relationships between entities. • diagrammatic notation.
Prof P Sreenivasa Kumar Department of CS&E, IITM
2
Entities
Entity - a thing (animate or inanimate) of independent physical or conceptual existence and distinguishable. In the University database context, an individual student, faculty member, a class room, a course are entities. Entity Set or Entity TypeCollection of entities all having the same properties. Student entity set – collection of all student entities. Course entity set – collection of all course entities.
Prof P Sreenivasa Kumar Department of CS&E, IITM
3
Attributes
Each entity is described by a set of attributes/properties. student entity StudName – name of the student. RollNumber – the roll number of the student. Sex – the gender of the student etc. All entities in an Entity set/type have the same set of attributes. Chosen set of attributes – amount of detail in modeling.
Prof P Sreenivasa Kumar Department of CS&E, IITM
4
Types of Attributes (1/2)
• Simple Attributes having atomic or indivisible values. example: Dept – a string PhoneNumber – an eight digit number • Composite Attributes having several components in the value. example: Qualification with components (DegreeName, Year, UniversityName) • Derived Attributes Attribute value is dependent on some other attribute. example: Age depends on DateOf Birth. So age is a derived attribute.
Prof P Sreenivasa Kumar Department of CS&E, IITM 5
Types of Attributes (2/2)
• Single-valued