Sunday 28 August 2016

Elements of entity relationship model

Entities
 Object is a physical object (thing, place, person) or have an abstraction (event, concept) in the real word.  Any object that exists and can be distinguish by other object in the real word and data is collected from it and maintained. The word entity is derived from Latin “ens”.  Entities make a difference between things existence and its qualities. Entity is represented by a rectangle and the name of the entity is written inside the rectangle.
 The examples of an entity
A college system may include entities like student, teacher, class, admission. And other examples of entity are
·         A particular employee
·         A customer
·         Country
·         Furniture
·         Doctor
·         Registration
A student is an entity but in a class student Ali of a student entity is an entity instance. An entity instance is a particular member of an entity class. Through abstraction we can identify the common attributes of entity instance.
For example in a BSC class student is called as an entity and Zoya, Ahmad, Ali is a member of class so it is called an entity instance.
Set of entities with same attribute is called entity type. For example collection of all books is called entity type. All entities in entity type share common characteristics. For example every student in a class have a roll no, name, address, marks attributes.
Entity may be strong, week and associated depends on the situation.
Attributes
Every entity in an entity type has an changeable characteristics. For example student ID, student name, student address and student email are his characteristics of a student. The color of a text, the color might be red, blue, yellow. These characteristics are called attributes or property. An attribute in an entity relationship (E-R) diagram is represented by an ellipse and the name of the attribute is written inside the ellipse.
Attribute may be simple, multi-valued and derived attribute.
Set of a possible value is called attribute domain. For example the domain for gender attribute is two. The gender can be male or female. Every attribute have an attribute domain attribute domain may be a discret values (1, 2) or a range of values (0 to 6).
Attribute domain help to maintain the integrity of a database. For example data type and range constrain are domain. The data type of a student roll no is integer so it can store integer value (1, 2, 3, 4 …… 100) and data type of a student name is string it can store only alphabetic characters (A to Z or a - z).
Attribute name and domain are part of intension of the model and value of a attribute is part of extension.
Relationships

Some entities have connection with other entities. This connection is called relationship. The entities that have a connection with other entities is a called participants. The relationship may be between different entities or itself. If all the entities of entity set participate in a relationship so this relationship is called total relationship and if some entities of entity set participate in a relationship then this relationship is called partial relationship. Relationship is shown by line between entities. Relationship between entities is simple or identifying relationship.

No comments:

Post a Comment