Download presentation
Presentation is loading. Please wait.
1
Entity Relationship Model
Introduction:- The E-R model was introduced by P.P. Chen not only E-R model but also corresponding diagramming techniques. In a database management system (DBMS), a group of similar information or data, which is of interest to an organization is called an entity. Components of E-R Models:- The E-R model consist of the following major components: a) Entity b) Attributes c) Relationships d) Key attributes
2
Entity:- An entity is a class of persons, places, objects, events or concepts about which we need to collect and store data Persons:- Employee, customer, student, supplier etc. Place:- Branch office, Building, Room etc. Objects:- Book, machine, vehicle etc. Events:- Sale, Reservation, Registration, Order etc. Concepts:- Qualification, account, course, stock etc. The instance of an entity is a single occurrences of that entity. Example:- The entity EMPLOYEE may have multiple instances or occurrences such as Raj, Mohan, Shiva, etc.
3
Entity Set :- An entity set is the collection of entities of the same type Example: the set of all employees of an organization can be called as the entity set employee. The set of all persons who are customer at a given bank, can be called as the entity set Customer Attributes:- Each Entity can have a number of characteristics. The characteristics of an entity are called attributes Example:-an entity, say client, can have characteristics like Name address, phone number, balance due etc. Some attributes can be logically grouped into super attributes called compound attribute. Example:- An Employee’s name is a compound attribute consisting of first _name, middle_ name, and last_ name
4
Relationship:- There types of relationships exist among entities these are; One-to-one One-to-many Many-to many One-to one relationship(1:1):-Relationship is an association only between two entities. Example: University each department has only one head of the department this is shows one-to-one relationship between department and the person as head. Department Person
5
One-to-many Relationship(1:M):-
When one entity is related to more than one entity. Example:-father may have many children but a child has one father. Another example two entity set namely courses and teacher. If assume that more than one course is taught by one teacher. Then relationship is one-to-many between teacher and courses. Father Children Teacher courses 1:M Relationships example Many-to-many relationship (M:M):- A entities that may have relationship among each other Example:-one customer may buy many items and one item may be bought by many customers. Another example is that a student can take many courses in a university, and many students can register for a given course. Customers Items Students Courses M:M Relationship example
6
Key Attribute:- SYMBOLS OF E-R MODEL:
The key attribute is an attribute that uniquely identifies an entity in the entity set. Example:- Employee_ code can be the key attribute for the entity set employee because it uniquely identifies each employee entity SYMBOLS OF E-R MODEL: E-R modeling use the following symbols: Name Symbol Meaning Representing entity sets Rectangle Representing attributes Oval Representing relation ship among entity sets Diamond Links attributes to entity sets and entity sets to relationship Line
7
ERD:- Attributes Cust_ name Cust_ No Date Acc_ no Balance Customer
Cust_ Acct Customer Account State City Entity sets Entity_ Relationship Diagram for customer account
8
E-R diagram:- Customer _name Customer _State Amount Loan_ number
Customer _id Customer _City borrower Loan Customer E-R diagram corresponding to customer and loan
10
Strong and weak Entities:
There are two types of entities namely, dependent entities also called weak entities and independent entities also called strong entities or regular entities. A weak entity set does not have sufficient attributes to from a primary key A weak entity set type is represented by a double outline rectangle Example:-Consider an entity set type marks which represents the marks obtained by a students. Now the existence of entity type student Example:- Suppose a student say ‘Swati” Can have Many instances of marks say Eng_ marks, Sci_ marks, Maths_ marks etc. related to it. If the instance “Swati” is deleted, than all the entity marks dependent upon Swati.
11
Student Marks Marks is dependent (weak) entity that is dependent on entity student Strong Entity:- An entity set which has a primary key is termed as a strong entity set. Example:- the entity employee and student are strong entity because they have the primary keys Emp_no and Adm_no. Adm_no Emp _no Employee Student
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.