Entity Relationship Model
- An entity is a thing or object or person in the real world that is distinguishable from all another object.
- E.g. book, student, employee, college etc…
- An entity set is a set of entities of the same type that share the same properties or attributes.
- E.g. the set of all students in a college can be defined as entity set student.
- A relationship is an association (connection) between several entities.
- A relationship between 2 entities is called binary relationship.
- E.g. book is issued by the student where book and student are entities and issue is the relation.
- The relationship set is a set of relationships of the same type.
- Attributes properties held by each member of an entity set.
- E.g. entity is student and attributes of students are enrollment no, name, address, cpi etc
Types of attributes
- Simple attribute: It cannot divide into subparts. E.g. cpi, rollno
- Composite attribute: It can divide into subparts. E.g. name (first name-middle name- last name), address.
- Single-valued attribute: It has the single data value. E.g. enrollmentno, birthdate
- Multi-valued attribute: It has multiple data values. E.g. phoneno (may have multiple phones)
- Stored attribute: Its value stored manually in the database. E.g. birthdate
- Derived attribute: Its value derived or calculated from other attributes. E.g. age (can calculate using current date and birthdate).
- A relationship may also have attributes like an entity. These attributes called descriptive attributes.
- g. Student gets degree certificate on 14th March 2011. Student and Degree are entities, gets the certificate is a relation and certificate date is an attribute of relationship.
Recursive relationship set
- The same Entity Relationship Model set participates in a relationship set more than once then it called recursive relationship set.
- E.g. an employee entity participated in the relationship under with department entity as an employee as well manager also.