ER-Diagram | DBMS

ER Diagram

ER Diagram is a graphical representation of database by using some specific symbols and components. All the components are given bellow. For know about ER Model

Entity

Entity are real word object that are distinguish from other real word object on the basis of their property or attribute.

Example:
  • Entity set - Teacher,Like Shailendra,Amrit etc..
  • Entity set - Student,Like Ram, shyam etc..

Attribute

Attribute describe the property of entity set.

Example: For Teacher entity, Attributes are name,dob,age,phoneno,contact etc.

Type of Attribute

  1. Composite Attribute

    Those attribute which are further decomposable .

    Name(Firstname,Middle name,Last name)

    Address (House No,Street,City)

    Attribute that are further decomposable into subpart are called composite attribute.But attribute that are not further decomposable are known as simple attribute.

    Example of simple attribute are Salary, Marks etc.

  2. Single valued and Multi valued Attribute

    Attribute that posses only one value are called single valued attribute.

    Example : Date of Birth of any person is single valued because every person have only one valid date of birth.
    But attribute that posses more than one value are called multi valued attribute.
    Example : Phone No. because a person have more than on phone numbers.

  3. Stored and Derived Attribute

    Stored attribute are the attribute that need to store physically on the storage. Example DOB etc.
    But derived attribute are the attribute that are derived from stored attribute using some mathematical calculation. Example age (because we can derive age from DOB)

  4. NULL Attribute

    NULL attribute are those attribute which we store NULL value.

Entity Set


There are two type of entity sets

  1. Strong Entity Set
  2. Week Entity Set

Strong Entity Set

Entity set in which primary key is easily identified than such entity set are known as strong entity set. Example Student

Week Entity Set

Entity set in which primary key is not available than such entity set are known as week entity set. Example local guardian.
Week entity set are made by the support of strong entity set. Example local guardian of student.Here local guardian(week entity) and student (strong entity)

Relationship

Relationship are possible in tables.We can establish relation between entities sets.

Type of Relation

  1. Unary Relation

    Those relation in which only one entity set is participated.

  2. Binary Relation

    Those relation which contain two entity set are called binary relation.

  3. Ternary Relation

    Those relation in which three entity set are participated.

Cardinality Set

It is a specific number of instances of entity.

There are two type of cardinality

  1. Minimum Cardinality
  2. Maximum Cardinality

Minimum Cardinality Set

The minimum cardinality of a relationship is the minimum number of instances of entity Y that may be associated with each instance of X.

Maximum Cardinality Set

The maximum cardinality of a relationship is the minimum number of instances of entity Y that may be associated with each instance of X..

Basic Type of Cardinality Set are

  1. 1:1 - One to one relationship
  2. 1:M - One to many relationship
  3. M:1 - Many to one relationship
  4. M:M - Many to many relationship (It is very rare)

Let we know how to find Entity and Attribute for creating any schema by taking an example.

Example 1. Find out entities and attributes for company publish magazine.
  1. Entity : Magazine

    Attributes:
    • Name
    • Frequency of magazine

  2. Entity : Categories

    Attributes:
    • Weak
    • Year

  3. Entity : Price

    Attributes:
    • MRP

  4. Entity : No of Pages

    Attributes:
    • PageNo

  5. Entity : Employ

    Attributes:
    • EmpId
    • Name
    • Address
    • ID
    • DOB
    • Gender
    • PhoneNo
    • Designation
    • Salary
    • Qualification
    • Date of joining
    • facilities

  6. Entity : Distributor

    Attributes:
    • DistNo
    • Name
    • Gander
    • PhoneNo
    • Deposited Amt or Security Deposit
    • Status of Distributor
    • Coverage area of distributor
    • Balance

  7. Entity : Subscribers

    Attributes:
    • SubcNo
    • Name
    • Address
    • PhoneNo
    • DOB
    • ID
    • Duration
    • SubcLanguage

  8. Entity : Contributor

    Attributes:
    • CodeNo
    • Name
    • Address
    • PhoneNo
    • DOB
    • ID
    • Language
    • Magzine name
    • Initial Amt

  9. Entity : Department

    Attributes:
    • Sales
    • Purchase

  10. Entity : Language Type

    Attributes:
    • Lang Name

and More......


Example 2. Find out entities and attributes for car service station.
  1. Entity : Car

    Attributes:
    • Models
    • Model Name
    • Servicing Change
    • CC
    • Standard
    • No of Gears

  2. Entity : Mechanics

    Attributes:
    • Mechanics Id
    • Name
    • Address
    • Uniform Color
    • Date of Joining
    • Salary

  3. Entity : Spare Parts

    Attributes:
    • PartNo
    • Part Color
    • Part Name
    • Price
    • Weight
    • Size
    • No of Parts

  4. Entity : Customer

    Attributes:
    • CustId
    • Name
    • Gander
    • PhoneNo
    • CarRegNo
    • KeyNo
    • DateofServive

and More......

No comments:

Post a Comment