Tuesday, July 16, 2019

ER-Diagram

                               ER-Diagram


What is Associate in Entity Entity Relationship Diagram (ER Diagram)?

An ER diagram shows the connection among entity sets. Associate in Entity entity set may be a cluster of comparable entities and these entities will have attributes. In terms of DBMS, Associate in Entity entity may be a table or attribute of a table in info, therefore by showing the relationship among tables and their attributes, the ER diagram shows the entire logical structure of info. Lets have a glance at an easy ER diagram to know this idea.

A simple ER Diagram:

In the following diagram we've 2 entities Student and faculty and their relationship. the connection between Student and faculty is several to 1 as a university will have several students but a student cannot study in multiple faculties at the identical time. The student entity has attributes like Stu_Id, Stu_Name & Stu_Addr and faculty entity has attributes like Col_ID & Col_Name.





Rectangle: Represents Entity sets.
Ellipses: Attributes
Diamonds: Relationship Set
Lines: They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses: Multivalued Attributes
Dashed Ellipses: Derived Attributes
Double Rectangles: Weak Entity Sets
Double Lines: Total participation of Associate in Entity entity during a relationship set

Components of a ER Diagram





As shown within the higher than diagram, Associate in Entity ER diagram has 3 main components:
1. Entity
2. Attribute
3. Relationship

1. Entity




An entity is Associate in Entity object or element of knowledge. Associate in Entity entity is diagrammatical as parallelogram in Associate in Entity ER diagram.
For example: within the following ER diagram we've got 2 entities Student and faculty and these 2 entities have several to at least one relationship as several students study in a very single faculty. we'll browse additional regarding relationships later, for currently specialize in entities.


Weak Entity:
An entity that can't be unambiguously known by its own attributes and depends on the link with alternative entity is termed weak entity. The weak entity is pictured by a double parallelogram. as an example – a checking account can't be unambiguously known while not knowing the bank to that the account belongs, therefore checking account may be a weak entity




2. Attribute

An attribute describes the property of Associate in Entity entity. Associate in Entity attribute is pictured as Oval in Associate in Entity ER diagram. There square measure four forms of attributes:

1. Key attribute
2. Composite attribute
3. Multivalued attribute
4. Derived attribute

1. Key attribute:

A key attribute will unambiguously establish Associate in Entity entity from Associate in Entity entity set. as an example, student roll range will unambiguously establish a student from a group of scholars. Key attribute is pictured by oval same as alternative attributes but the text of key attribute is underlined.



2. Composite attribute:

An attribute that's a mix of different attributes is understood as composite attribute. for instance, In student entity, the scholar address may be a composite attribute as associate address consists of different attributes like pin code, state, country.




3. Multivalued attribute:

An attribute that may hold multiple values is understood as multivalued attribute. it's described with double ovals in associate ER Diagram. for instance – an individual will have over one variety|telephone number|number|signal|signaling|sign}s therefore the phone number attribute is multivalued.

4. Derived attribute:

A derived attribute is one whose price is dynamic and derived from another attribute. it's described by dotted oval in associate ER Diagram. for instance – Person age may be a derived attribute because it changes over time and may be derived from another attribute (Date of birth).



3. Relationship

A relationship is described by diamond form in ER diagram, it shows the connection among entities. There ar four varieties of relationships:
1. One to One
2. One to Many
3. Many to One
4. Many to Many

1. One to One

When one instance of associate entity is related to one instance of another entity then it's known as one to at least one relationship. for instance, an individual has just one passport and a passport is given to at least one person.



2. One to Many

When one instance of associate entity is related to quite one instances of another entity then it's referred to as one to several relationship. as an example – a client will place several orders however a order can not be placed by many purchasers.



3. Many to Many
When quite one instances of associate entity is related to one instance of another entity then it's referred to as several to at least one relationship. as an example – several students will study during a single faculty however a student cannot study in several faculties at identical time.



4. 

When quite one instances of associate entity is related to quite one instances of another entity then it's referred to as several to several relationship. as an example, a may be allotted to several comes and a project may be allotted to several students.




Total Participation of associate Entity set

A Total participation of associate entity set represents that every entity in entity set should have a minimum of one relationship during a relationship set. For example: within the below diagram every faculty should have at-least one associated Student.



No comments:

Post a Comment

Search This Blog