Skip to main content

E-R Diagrams in DBMS

E-R Diagrams in DBMS: Components, Symbols, And Notations: E-R diagram is the short form of “Entity-Relationship” diagram. An e-r diagram efficiently shows the relationships between various entities stored in a database. In this article, we will discuss what are ER Diagram, ER Diagrams Symbols, Notations, Their various components like Entity, Attribute and Relationship.


E-R Diagrams in DBMS: Components, Symbols, And Notations

E-R diagrams are used to model real-world objects like a person, a car, a company etc. and the relation between these real-world objects. An e-r diagram has following features:


  • E-R diagrams are used to represent E-R model in a database, which makes them easy to be converted into relations (tables).
  • E-R diagrams provide the purpose of real-world modeling of objects which makes them intently useful.
  • E-R diagrams require no technical knowledge & no hardware support.
  • These diagrams are very easy to understand and easy to create even by a naive user.
  • It gives a standard solution of visualizing the data logically.

ER Diagrams Symbols, And Notations

Er-Symbols-and-Notations
Er Diagram Symbols and Notations

Components of an E-R diagram

An E-R diagram constitutes of following Components
A. Entity:- Any real-world object can be represented as an entity about which data can be stored in a database. All the real world objects like a book, an organization, a product, a car, a person are the examples of an entity. Any living or non-living objects can be represented by an entity. An entity is symbolically represented by a rectangle enclosing its name.
Entity
Entity
Entities can be characterized into two types:
  • Strong entity: A strong entity has a primary key attribute which uniquely identifies each entity. Symbol of strong entity is same as an entity.

Strong-Entity
Strong Entity
  • Weak entity: A weak entity does not have a primary key attribute and depends on other entity via a foreign key attribute.
Weak-Entity
Weak Entity
B. Attribute:- Each entity has a set of properties. These properties of each entity are termed as attributes. For example, a car entity would be described by attributes such as price, registration number, model number, color etc. Attributes are indicated by ovals in an e-r diagram.
Attribute
Attribute
A primary key attribute is depicted by an underline in the e-r diagram. An attribute can be characterized into following types:
  • Simple attribute:- An attribute is classified as a simple attribute if it cannot be partitioned into smaller components. For example, age and sex of a person. A simple attribute is represented by an oval.
  • Composite attribute:- A composite attribute can be subdivided into smaller components which further form attributes. For example, ‘name’ attribute of an entity “person” can be broken down into first name and last name which further form attributes. Grouping of these related attributes forms a composite attribute. ‘name is the composite attribute in this example.

Composite-Attribute
Composite Attribute
  • Single valued attribute:- If an attribute of a particular entity represents single value for each instance, then it is called a single-valued attribute. For example, Ramesh, Kamal and Suraj are the instances of entity ‘student’ and each of them is issued a separate roll number. A single oval is used to represent this attribute.
  • Multi valued attribute:– An attribute which can hold more than one value, it is then termed as multi-valued attribute. For example, phone number of a person. Symbol of multi-valued attribute is shown below,
Multi-Valued-Attribute
Multi Valued Attribute

  • Derived attribute: A derived attribute calculate its value from another attribute. For example, ‘age’ is a derived attribute if it calculates its value from ‘current date’ & ‘birth date’ attributes. A derived attribute is represented by a dashed oval.
C. Relationships:- A relationship is defined as bond or attachment between 2 or more entities. Normally, a verb in a sentence signifies a relationship.
For example,
  • An employee assigned a project.
  • Teacher teaches a student.
  • Author writes a book.
A diamond is used to symbolically represent a relationship in the e-r diagram.
Relationship
Relationship
Various terms related to relationships
a). Degree of relationship:- It signifies the number of entities involved in a relationship. Degree of a relationship can be classified into following types:
  • Unary relationship:- If only single entity is involved in a relationship then it is a unary relationship. For example, An employee(manager) supervises another employee.
Unary-relationship
Unary relationship
  • Binary relationships:- when two entities are associated to form a relation, then it is known as a binary relationship. For example, A person works in a company. Most of the times we use only binary relationship in an e-r diagram. The teacher-student example shown above signifies a binary relationship.
Other types of relationships are ternary and quaternary. As the name signifies, a ternary relationship is associated with three entities and a quaternary relationship is associated with four entities.
b.) Connectivity of a relationship:- Connectivity of a relationship describes, how many instances of one entity type are linked to how many instances of another entity type. Various categories of connectivity of a relationship are;
  • One to One (1:1) – “Student allotted a project” signifies a one-to-one relationship because only one instance of an entity is related with exactly one instance of another entity type.
One-To-One
One To One
  • One to Many (1:M) – “A department recruits faculty” is a one-to-many relationship because a department can recruit more than one faculty, but a faculty member is related to only one department.
One-to-Many
One to Many
  • Many to One (M:1) – “Many houses are owned by a person” is a many-to-one relationship because a person can own many houses but a particular house is owned only a person.
Many-To-One
Many To One
  • Many to Many (M:N) – “Author writes books” is a many-to-many relationship because an author can write many books and a book can be written by many authors.
Many-To-Many
Many To Many

Comments

Popular posts from this blog

Momo suicide game

Microsoft clamps down on sick 'Momo suicide game' in 'Minecraft' Microsoft is clamping down on the sick “Momo suicide challenge,” which recently infiltrated the wildly popular online game “Minecraft.”The tech giant owns “Minecraft” developer Mojang. The vile “Momo suicide game” has been garnering attention after spreading on WhatsApp, prompting police warnings. "Momo" is a viral challenge that asks people to add a contact via WhatsApp - they are then   urged   to commit self-harm or suicide. The "game" has fueled comparisons to the sinister " Blue Whale challenge " that led to reports of suicides in Russia and the U.S, as well as the online fictional character of "Slender Man." In 2014 two 12-year-old girls in Wisconsin  attempted to kill   a classmate in an attempt to please the horror character. The Buenos Aires Times recently  reported  that police in Argentina are investigating whether “Momo” is linked to the suicide of a 12-y...

Java Functional Interfaces

  The term   Java functional interface   was introduced in Java 8. A   functional interface   in Java is an interface that contains only a single abstract (unimplemented) method. A functional interface can contain default and static methods which do have an implementation, in addition to the single unimplemented method. Here is a Java functional interface example: public interface MyFunctionalInterface { public void execute(); } The above counts as a functional interface in Java because it only contains a single method, and that method has no implementation. Normally a Java interface does not contain implementations of the methods it declares, but it can contain implementations in default methods, or in static methods. Below is another example of a Java functional interface, with implementations of some of the methods: public interface MyFunctionalInterface2{ public void execute(); public default void print(String text) { System.out.println(t...

Kali Linux 2017.2

Most Advanced Penetration Testing Distribution, Ever. New and Updated Packages in Kali 2017.2 In addition to all of the standard security and package updates that come to us via Debian Testing, we have also added more than a dozen new tools to the repositories, a few of which are listed below. There are some really nice additions so we encourage you to ‘apt install’ the ones that pique your interest and check them out. hurl  – a useful little hexadecimal and URL encoder/decoder phishery  – phishery lets you inject SSL-enabled basic auth phishing URLs into a .docx Word document ssh-audit  – an SSH server auditor that checks for encryption types, banners, compression, and more apt2  – an Automated Penetration Testing Toolkit that runs its own scans or imports results from various scanners, and takes action on them bloodhound  – uses graph theory to reveal the hidden or unintended relationships within Active Directory crackmapexec  – a post-expl...