Skip to main content

Conceptual Design ER Model

ER Model


An Entity–relationship model (ER model) describes the structure of a database with the help of a diagram, which is known as Entity Relationship Diagram (ER Diagram). An ER model is a design or blueprint of a database that can later be implemented as a database. The main components of E-R model are: entity set and relationship set.
What is an Entity Relationship Diagram (ER Diagram)?

An ER diagram shows the relationship among entity sets. An entity set is a group of similar entities and these entities can have attributes.

In terms of DBMS, an entity is a table or attribute of a table in database, so by showing relationship among tables and their attributes, ER diagram shows the complete logical structure of a database. Lets have a look at a simple ER diagram to understand this concept.

Here are the geometric shapes and their meaning in an E-R Diagram. 


We will discuss these terms in detail in the next section(Components of a ER Diagram) of this guide so don’t worry too much about these term

  • 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 an entity in a relationship sets.

Componant of ER Diagram


As shown in the above diagram, an ER diagram has three main components

  • Entity
  • Attribute
  • Relationship

Entity


An entity is an object or component of data. An entity is represented as rectangle in an ER diagram.

For example: In the following ER diagram we have two entities Student and College and these two entities have many to one relationship as many students study in a single college. We will read more about relationships later, for now focus on entities.

Weak Entity


An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity is called weak entity. The weak entity is represented by a double rectangle. 

For example – a bank account cannot be uniquely identified without knowing the bank to which the account belongs, so bank account is a weak entity.

Attribute


An attribute describes the property of an entity. An attribute is represented as Oval in an ER diagram. 

There are four types of attributes


  • Key attribute
  • Composite attribute
  • Multivalued attribute
  • Derived attribute

Key attribute


A key attribute can uniquely identify an entity from an entity set. For example, student roll number can uniquely identify a student from a set of students. Key attribute is represented by oval same as other attributes however the text of key attribute is underlined.

Composite attribute


An attribute that is a combination of other attributes is known as composite attribute. For example, In student entity, the student address is a composite attribute as an address is composed of other attributes such as pin code, state, country.

Multivalued attribute


An attribute that can hold multiple values is known as multivalued attribute. It is represented with double ovals in an ER Diagram. For example – A person can have more than one phone numbers so the phone number attribute is multivalued.

Derived attribute


A derived attribute is one whose value is dynamic and derived from another attribute. It is represented by dashed oval in an ER Diagram. For example – Person age is a derived attribute as it changes over time and can be derived from another attribute (Date of birth).
E-R diagram with multivalued and derived attributes.

Relationship 


A relationship is represented by diamond shape in ER diagram, it shows the relationship among entities. 

There are four types of relationships


  • One to One
  • One to Many
  • Many to One
  • Many to Many

One to One Relationship


When a single instance of an entity is associated with a single instance of another entity then it is called one to one relationship. For example, a person has only one passport and a passport is given to one person.

One to Many Relationship


When a single instance of an entity is associated with more than one instances of another entity then it is called one to many relationship. For example – a customer can place many orders but a order cannot be placed by many customers.

Many to One Relationship


When more than one instances of an entity is associated with a single instance of another entity then it is called many to one relationship. For example – many students can study in a single college but a student cannot study in many colleges at the same time.

Many to Many Relationship


When more than one instances of an entity is associated with more than one instances of another entity then it is called many to many relationship. For example, a can be assigned to many projects and a project can be assigned to many students.

Total Participation of an Entity set


A Total participation of an entity set represents that each entity in entity set must have at least one relationship in a relationship set. For example: In the below diagram each college must have at-least one associated Student.

Extended feature of ER Diagram


The basic E-R concept can model most of database features.
But same aspect of database can be extended features.
 

There are 3 extended features


  • Specialization. 
  • Generalization
  • Aggregation. 

Specialization 


It is the abstracting process of introducing new characteristics of objects to create one
or more new classes of objects.
In simple words, specialization is a result of taking a subset of higher level entity set to form a lower level entity set, [Fig. 2.34).
Entities are expanded in Specialization.
This line implies that Doctor can also be anything else apart from permanent doctor and Consulting doctor.

Generalization


It is abstracting process of viewing set of objects as a single general class.
It concentrates on the general characteristics of consequent set while ignoring there differences.

It means generalization is the result of taking union of two or more entity sets to produce a higher level entity set.
This line implies that a doctor has to be either a permanent doctor,or consulting doctor nothing else.
Therefore the entities are limited in generalization.

Difference between Generalization and specialization


Generalization


It is bottom-top design process. 
It is union of two or more lower level entity sets to produce higher level entity set.
In this, lower level entity sets are also described by attributes and relationship of higher level entity sets.
It is used to emphasize similarities among lower level entity types
In this, every higher level entity must

Specialization


It is top-down design process.
It is subset of higher level entity set to form lower level entity set.
Lower level entity sets may have different attributes and may participate in relationship that do not apply higher level entity set. 
It is used to emphasize distinction between higher level and lower level entity set.
It allows for the possibility Of more low also be a lower level entity.

Aggregation 


It is the process of combining information on objects so that the higher level objects can be abstracted.
In any entity relationship diagram, we cannot form a relationship among the entities and their relationship.
Aggregation is the process which allows to do so.

Case studies


Let's consider "General Hospital" where the operations are as follows: 
(a) In the hospital, many doctors are working. Their personal information is maintained because they get fixed salary per month. 
(b) The patients are admitted to the hospital into the room. They are treated by various doctors.
(c) Sometimes, patients require certain pathological tests which are actually carried out into the labs.

Star is an agency for flat booking & it has number of  builders and agents who are jointly working.A customer can get a flat for residential or commercial purpose.

If a customer is apporoched through an agent the agency and builders are giving some commision to agent.Agent shows  various sites  and flats within various location.Study the case and draw ER Diagram.

In a nursery plants are sold to the customers.These plants are flowering and non flowering only.Nutrients are given to the plant with some quqntity.Nutrients contains Pestisides,Watering and Manure.

A Movie studio wishes to institute a database to manage their files of movies actor and directors.the following facts are relevant.
Each actor has appeared in many movies.
Each director has directed many movies.
Each movie has one director or ona or more actors.
Each actor and directory may have several addresses.

Construct an ER for car insurance company that has set of customers.
Each customer owns one or more cars.
Each are associated with more cars.
Each can be associated with zeo to any number of recorded accidents.

In airport airline reservation is done.Airoplanes are owned by airline which have flight system.Passenger visits employee 
and ask for reservation.Employee checks flight system and provide reservation to the passenger.
Draw ER Diagram.

The management of Life Hospital has decided to computerize their operations.The following information is provided by management.These are resident,fulltime and consulting doctors,with various specialization.Consulting doctors visit hospital at a fixed time everyday or some days of week which varies from doctor to doctor .Patients are admitted to hospital and their main cause of admission is recorded.For accident cases additional information such as police booklet number,name of police and accident description is recorded.A patient is admitted to a room which has certain category having fixed change per day.

The given case study is of Life Hospital which has decided to computerize their operations

Consider a trucking company which is responsible for picking up shipments for warehouse of a retail chain and deliver the shipments to the individual store loaction.
A truck may carry several shipments in a single trip and deliver it to multiple stores. Draw an ER diagram for above case.

Comments

Trending⚡

Happy birthday Hardik Pandya | In C programming

  Happy birthday Hardik Pandya . Now you are  28 years old. Great achievement you have. Let's we want to talk more about Hardik pandya. He is great cricketer. Pandya is awesome. In this Blog Post we are going to wish pandya " Happy birthday using C program". Let's tune with us till end. Now we have to wish pandya, so we are going to use printf () function printing message to pandya as " Happy birthday Hardik pandya Now you are 28 years old". Hardik pandya was born on 11 October in 1993. Now we are going to declare a variable called as current_age = 2021 - 1993. It calculate current age Of Hardik pandya. See the "Happy birthday pandya" using c programming. If you liked this Blog Post then don't forget to share with your computer science learning friends. Once again " Happy birthday Hardik Pandya sir". Read also Happy Rakshabandhan wish using C program Friendship day 2021 greetings in C

What is programming explained in simple words

Hi my dear friends today in this blog post we are going to know what programming is? In simple words I will explain to you programming. Nowadays we are watching real life use of programming. How computers learn to speak, talk and do the specified complex task for us. We are all keen to know what is exactly programming? Programming is the process of creating instructions that a computer can understand and execute. These instructions, also known as code, are written in a programming language that is specific to the task at hand. The history of programming can be traced back to the mid-20th century, with the development of the first electronic computers. The first programming languages were known as machine languages, which were specific to a particular type of computer. As computers became more sophisticated, high-level programming languages were developed, such as FORTRAN and COBOL, which were easier for humans to read and write. These languages allow programmers to write code t

check number is prime or odd or even using c program

Here is the c program to check if the user entered number is prime ,even and odd. These few lines of code solve three problems. In the above program we used integer type num variable for storing user entered numbers. Then we used the IF condition statement. That's all. IF condition for even number In the First IF statement we have a logic. If the number is divided by two then the reminder should be 0 then the number is an even number else not an even number. That simple logic is implemented in the first if statement. IF condition for odd number In the second IF statement we Implemented odd number logic. We identify odd numbers just by making little change in even number logic. If the number is divided by two then the reminder should not be a zero. Then the number is odd. That's simple logic used to identify whether a number is odd or not an odd number. IF condition for prime number In the third IF condition we implemented the logic of the prime number. In this IF

Graph Data Structure

Graph A graph can be defined as a group of vertices and edges that are used to connect these vertices. A graph can be seen as a cyclic tree, where the vertices (Nodes) maintain any complex relationship among them instead of having parent child relationship. A graph G can be defined as an ordered set G(V, E) where V(G) represents the set of vertices and E(G) represents the set of edges which are used to connect these vertices. A Graph G(V, E) with 5 vertices (A, B, C, D, E) and six edges ((A,B), (B,C), (C,E), (E,D), (D,B), (D,A)) is shown in the following figure. Directed and undirected graph Graph terminology Graph Representation Directed Graph Adjancency Matrix Graph Traversal Depth first search algorithm Directed and undirected graph A graph can be directed or undirected. However, in an undirected graph, edges are not associated with the directions with them. An undirected graph does not have any edges in directions. If an edge exists between ver

How to write programs in Bhai language

Bhai Language Bhai language is fun Programming language , with this language you can makes jokes in hindi. Bhai language written in typescript. It's very funny , easy and amazing language. Keywords of this language written in Hindi . Starting and ending of the program Start program with keyword " hi bhai " and end with " bye bhai ". It's compulsory to add this keyword before starting and end on the program. You write your programming logic inside this hi bhai and bye bhai . How to declare variables in Bhai language We use " bhai ye hai variable_name" keyword for declaring variables. In javascript we use var keyword for declaring variables but here you have to use " bhai ye hai " keyword. If you are declaring string then use " " double quotes. You can use Boolean variable like sahi and galat for true and false . How to print output in Bhai language You have to use " bol bhai " keyword for