Entity- relationship model
Topic Outline
Entity-relationship model
Elements of Entity-relationship model
- Entities
- Attributes
- Relationship
The entity-relationship model was introduced by Peter Chen in 1976. ER model is a logical representation of data in an organization. The entity-relationship model is used to describe the elements of a system and their relationships.
The element of the entity-relationship model is as follows:
The entity is a person, place, object, thing, or event for which data is collected and maintained in a database. The entity is represented by a rectangle. The name of the entity is written inside the rectangle.
For example
A library system may contain data about different entities such as BOOK, Member, NAME, DEPARTMENT ETC. A university system may include entities such as STUDENT, TEACHER, DEPARTMENT, CLASS, ROLL NO, etc.
Examples of entities are as follows:
Place: CITY, PROVINCE, COUNTRY
Person: STUDENT, DOCTOR, TEACHER, PLAYER, PATIENT, ENGINEER
Object: PENCIL, TOY, VEHICLE, EQUIPMENT
Event: ADMISSION, BUY, SELL, REGISTRATION
Concept: ACCOUNT
The entity is used in different meanings that are below:
- Entity Type
The entity with the same attributes is called entity type. All entities share common characteristics. For example, the DEPARTMENT entity type is a collection of all departments and the TEACHER entity type is a collection of all teachers, etc.
- Entity Instance
The member of an entity class is also known as entity instance. Each entity instance of an entity type has its own value. For example, a TEACHER Abdullah of TEACHER entity type is an entity instance.
- Entity Set
A set of all entities of a specific entity type in the database is called an entity set. For example, the entity set TEACHER may consist of all teachers in the university. The entity set PATIENT may consist of all patients in the hospital.
- Types of Entities
- Weak Entity
A weak entity is an entity that exists if another entity exists. A weak entity depends upon the existence of another entity.
- Strong Entity
- Strong Entity
A strong entity is an entity that exists without depending upon the existence of another entity.
- Associative Entity
- Associative Entity
It associates the instances of one or many entity types with one another. The attributes of an associative entity represent the relationship between the entity instances.
The characteristics of an entity are called attributes. For example, the Name, Address, Phone no, Email of a teacher are his attributes. All instances of a specific entity class have the same attributes. For example, all teachers of the TEACHER entity class have the attributes of Name, Address, Phone no, and Email.
- Attribute Domain
It is a set of possible values for an entity. All attributes have a domain. A domain consists of a range of values or discrete values. For example, the domain for Gender attributes can be Male or Female.
- Types of Attributes
Different types of attributes are as follows:
- Simple Attribute
Attribute that can not be subdivided into a component is called simple attribute. A simple attribute is also called an atomic attribute. For example, a person can have only one gender.
- Composite Attribute
- Composite Attribute
An Attribute that can be subdivided into smaller components is called a composite attribute. For example, Address is a composite attribute because it can be divided into Country, Street, House no, City.
- Single-Valued Attribute
- Single-Valued Attribute
An attribute that contains only one value is called a single-valued attribute. For example, the Gender of a person is a single-valued attribute.
- Multi-Valued Attribute
- Multi-Valued Attribute
An attribute that contains more values is called a multi-valued attribute. The multi-valued attribute is represented by a double line oval. For example, a person can have two or more phone numbers. Similarly, a student may have different skills.
- Stored Attribute
- Stored Attribute
An attribute stored in a database is called a stored attribute. These attributes are accessed from a database.
A relationship is a logical connection between entities. Entities that participate in a relationship are called participants. A relationship may exist between different entities or between an entity and itself. For example, a relationship exists between a TEACHER and STUDENT because the teacher teaches the student.
- Total relationship
If all entities of that entity set may be a participant in the relationship, this relationship is called a total relationship.
- Partial relationship
If some entities of that entity set may be a participant in the relationship so, this is called a partial relationship.
Comments
Post a Comment
If you have any doubts, please let me know