O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

E r model

3.269 visualizações

Publicada em

Publicada em: Educação, Tecnologia, Negócios

E r model

  1. 1. Entity Relationship Model Presented By Swati Patil
  2. 2. Introduction <ul><li>A model is an abstraction process that hides details not required </li></ul><ul><li>Data model is a collection of conceptual tools for describing data and data relationships </li></ul><ul><li>The abstraction levels : Physical Level, Logical level and View Level </li></ul><ul><li>There are three various types of models </li></ul><ul><li>Object Based Logical Model – Used for describing data at logical and view levels. </li></ul><ul><li>Record Based Logical Model </li></ul><ul><li>Physical Model </li></ul>
  3. 3. Basic Concepts of E-R Model: <ul><li>It is high level conceptual model which is based on perception of real world </li></ul><ul><li>It consists of set of basic objects called as entities and of relationships among these objects. </li></ul><ul><li>It helps in database design and also helps to represent the overall logical structure of a database </li></ul><ul><li>It helps to represent the meaning of data . </li></ul>
  4. 4. Three notations of E-R Model – Entity sets, relationship sets and attributes <ul><li>Entities: </li></ul><ul><li>It is the basic object of the ER model which is a “thing” in the real world and independent existence i.e it is distinguishable from other objects. </li></ul><ul><li>An entity may be an object with a physical existence, for e.g. a particular person–car, house or employee or it may be an object with a conceptual existence e.g a company, job or a university course. </li></ul><ul><li>An entity set is a set of entities of same type that share same properties or attributes. </li></ul><ul><li>For e.g - Employee Entity set </li></ul><ul><li>Customer entity set </li></ul><ul><li>Each individual member of an entity set is called extension of entity set. </li></ul>
  5. 5. <ul><li>Attributes </li></ul><ul><li>Each entity is described by a set of properties called as attributes. For e.g person entity described by person name, person age, person address. </li></ul><ul><li>Attributes are descriptive properties of each member of an entity set. A particular entity will have a value of its attributes. It is this value of the attribute of each entity that is stored in the database. </li></ul><ul><li>For each attributes, there is set of permissible values for that attributes called as domain of attributes. For e.g Domain for employee number attributes of employee entity is the set of all positive integers. </li></ul>
  6. 6. Types of the attributes <ul><li>Simple or atomic and composite attributes . </li></ul><ul><li>Those attributes that is not divisible into subparts. Composite attributes are opposite to simple which can be divided into smaller subparts. For e.g employee name is composite attributes as it can be divided into subparts as first name, middle name and last name. These sub parts are turned to simple attributes since they can not further sub divided. </li></ul>
  7. 7. Composite attributes forms a hierarchy for e.g address
  8. 8. <ul><li>Single valued and multi valued attributes </li></ul><ul><li>Attributes that have single value for particular entitiy called as single valued attributes. For e.g Age is a single valued attribute of a person. </li></ul><ul><li>The attributes that have a set of values for particular entity are called as multi valued attributes. For e.g College degrees </li></ul>
  9. 9. <ul><li>Multi valued attributes may have lower and upper bound on the number of values for an individual entity. </li></ul><ul><li>For e.g in case of bank offering accounts to customers, if customer is allowed to hold maximum three accounts in the bank, then account no. becomes multi valued attribute with upper bound 3 </li></ul>
  10. 10. <ul><li>Stored and derived attributes: </li></ul><ul><li>An attribute value can be derived from the value of another attributes, then it is said to be derived attributes. </li></ul><ul><li>For e.g From an attribute birth date. The age can be derived for an employee birth date so age is derived attributes and birth date is stored attribute, </li></ul><ul><li>E.g. no of employees of the department can be derived by counting the no. of employees related to that department. </li></ul>
  11. 11. <ul><li>Null attributes: </li></ul><ul><li>A null value is used when an entity does not have value for an attribute. </li></ul><ul><li>For e.g Telephone no. </li></ul>
  12. 12. <ul><li>Relationship and relationship sets: </li></ul><ul><li>It is association between several entities. For e.g we can define relationship between an employee E1 and the department in which he works say D1. So this becomes relationship between an entity set employee and entity set department. </li></ul>
  13. 13. Mapping Cardinalities: <ul><li>It represents the number of relationship instance that an entity can participate in. i.e the number of entities to which another entity can be associated via a relationship set. </li></ul><ul><li>It is useful for binary relationship. </li></ul>
  14. 14. Types of Mapping Cardinalities: <ul><li>one to one – </li></ul><ul><li>An entity in A is associated with at most one entity in B and entity B is associated with at most one entity in A . </li></ul><ul><li>For e.g employee, department two entities and manages is relationship among these entities </li></ul>
  15. 15. <ul><li>For e.g employee, department </li></ul>
  16. 16. <ul><li>One to Many : </li></ul><ul><li>An entity in A is associated with many entities of B and an entity in B can be associated with at most one entity in A. For e.g. Department and employees are two entity set and works in is relationship </li></ul>
  17. 17. <ul><li>One to Many </li></ul>
  18. 18. <ul><li>Many to one: </li></ul><ul><li>An entity in A is associated at most in entity B and entity in B can be associated any number of entities A. </li></ul><ul><li>For e.g Student and class are two entity sets and studying in is the relationship </li></ul>
  19. 19. <ul><li>Many to One </li></ul>
  20. 20. <ul><li>Many to Many: </li></ul><ul><li>An entity in A is associated with any no. of entities B and an entity in B is associated with any no. of entities in A. </li></ul><ul><li>For e.g Employees and project are two entity sets and works in is the relationship </li></ul>
  21. 22. Participation: <ul><li>The participation of an entity set E in a relationship set R, is said to be total if every entity in E participates in at least one relationship in R. </li></ul><ul><li>If only some entities of E participates in R, then participation of entity set E in R is said to be partial. </li></ul><ul><li>For e.g Customer borrow Loan </li></ul>
  22. 23. <ul><li>Super key or Primary Key: </li></ul><ul><li>It is a set of one or more attributes that taken collectively allows us to identify uniquely and entity in the entity set for e.g customer no in customer entity </li></ul><ul><li>Weak entity set: </li></ul><ul><li>An entity may not have enough attribute that can uniquely identify each member of the set such entity set are called weak entity set. </li></ul><ul><li>An entity set that has a primary key is called is strong entity set. </li></ul><ul><li>The strong entity set corresponds to weak entity set is also called identifying owner. The relationship that a weak entity type to its owner or strong entity is called identifying relationship of weak entity. </li></ul>
  23. 24. Notations used for E-R diagram:
  24. 27. <ul><li>Mapping cardinality is indicated by direct line </li></ul><ul><li>Or undirected line </li></ul><ul><li>Foe e.g Consider Customer ( Cust –name, SSN, address) </li></ul><ul><li>Account ( acc-no, balance) </li></ul>
  25. 33. <ul><li>Thank You </li></ul>