Thursday, July 23, 2015

Entity Relationship diagram

     
      Fig: E-R diagram corresponding to customers and loans



Fig shows an example of an entity-relationship diagram. Such a diagram must have the following criteria:

·         Entities represented by rectangles (e.g. customer and loan)
·        Attributes of an entity represented by ellipses (e.g. loan_number and amount attributes for the entity loan)
·        Relationship sets represented by diamonds (e.g. borrows relationship set.)
·        Primary key attribute of an entity set underlined (e.g. primary key customer_id underlined for entity customer)
·        Links joining diamond relationship set to entities. (e.g. there are links joining the entities to the borrows relationship to complete the E-R diagram.)
·        Fig depicts a binary relationship between the two entities customer and loan. The cardinality ratio from customer to loan is one-to-many because a customer can borrow many loans from the bank but one loan from the bank can belong to one customer assuming the loan is not joint i.e, an individual loan.



 

No comments:

Post a Comment