For each attribute there is a set of permitted values

Info icon This preview shows pages 11–13. Sign up to view the full content.

View Full Document Right Arrow Icon
For each attribute, there is a set of permitted values, called the domain or value set of that attribute. The domain of attribute customer-name might be the set of all text strings of a certain length. A database thus includes a collection of entity sets, each of which contains any number of entities of the same type. The following figure shows part of a bank database that consists of two entity sets: customer and loan: customer customer-street customer-name customer-city customer-id loan amount loan-no customer customer-id customer-name customer-street customer-city loan loan-no amount customer-id customer-name customer-street customer-city 321-12-3123 Jones Main Harrison 321-12-3124 Smith North Rye 119-15-4569 Hayes Dupont Harrison 123-45-6789 Adams Spring Princeton customer loan-no amount L-17 1000 L-23 500 L-46 9000 L-12 30000 loan Figure (c): Relation instances of customer and loan . Figure (a): E-R diagram notations for entity sets and attributes. Figure (b): Alternative E-R diagram notations.
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8 Types of Attributes An attribute, as used in the E-R model, can be characterized by the following attribute types: 1. Simple and Composite Attributes Attributes that cannot be divided into subparts are called simple attributes. For example, telephone-no , salary etc. Attributes that can be divided into subparts are called composite attributes. For example, the composite attribute address can be divided into attributes street-number , street- name and apartment-number . 2. Single-valued and multivalued attributes Attributes that have a single value for a particular entity are called single-valued attributes. For example, customer-name , salary etc. Attributes that have multiple values for a particular entity are called multivalued attributes. For example, an employee may have multiple telephone numbers. So, the attribute telephone-no is a multivalued attribute. 3. Derived Attributes If the value of an attribute can be derived from the values of other related attributes or entities, then that attribute is called a derived attribute. The attribute from which another attribute is derived is called the base or stored attribute. The value of a derived attribute is not stored, but is computed when required. For example, if an entity set employee has two attributes date-of-birth and age , then the attribute age is a derived attribute and the attribute date-of-birth is the base or stored attribute. Relationship Sets A relationship is an association among several entities. For example, we can define a relationship that associates customer Hayes with loan L-15. This relationship specifies that Hayes is a customer with loan number L-15. A relationship set is a set of relationships of the same type. For example, consider the two entity sets customer and loan . We define the relationship set borrower to denote the association between customers and the bank loans that the customers have. The following figure depicts this association: customer customer-street customer-name customer-city customer-id loan amount loan-no Figure: E-R diagram for customer and loan
Image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern