Saturday, May 8, 2021

E.R model

                E.R MODEL

E.R model stands for an Entity-Relationship model.ER model stands for an Entity-Relationship model. It works around real-world entities and the associations among them. At view level, the ER model is considered a good option for designing databases. (ER Modeling) is a graphical approach to database design.





 Entity

   An Entity is a thing or object in real world that is distinguishable from surrounding environment . An entity may be any object, class, person or place. In the ER diagram, an entity can be represented as rectangles.

    An Entity is an object of Entity Type and set of all entities is called as entity set 
An entity set is a collection of similar types of entities. An entity set may contain entities with attribute sharing similar values.  

        For example:-

   A Students set may contain all the students of a school; likewise a Teachers set may contain all the teachers of a school from all faculties. Entity sets need not be disjoint.

Attributes

The attribute is used to describe the property of an entity. Attributes are the properties which define the entity type. For example, Roll No, Name, DOB, Age, Address, Mobile No are the attributes which defines entity type Student.

Types of Attributes

  • Simple attribute − Simple attributes are atomic values, which cannot be divided further. For example, a student's phone number is an atomic value of 10 digits.

  • Composite attribute − Composite attributes are made of more than one simple attribute. For example, a student's complete name may have first_name and last_name.

  • Derived attribute − Derived attributes are the attributes that do not exist in the physical database, but their values are derived from other attributes present in the database. For example, average salary in a department should not be saved directly in the database, instead it can be derived. For another example, age can be derived from data_of_birth.

  • Single-value attribute − Single-value attributes contain single value. For example − Social_Security_Number.

  • Multi-value attribute − Multi-value attributes may contain more than one values. For example, a person can have more than one phone number, email_address, etc.

No comments: