中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

2.1 Database Systems: Database systems:Entities and Entity Sets

  • An entity is an object that exists and is distinguishable from other objects. For instance, John Harris with S.I.N. 890-12-3456 is an entity, as he can be uniquely identified as one particular person in the universe.
  • An entity may be concrete (a person or a book, for example) or abstract (like a holiday or a concept).
  • An entity set is a set of entities of the same type (e.g., all persons having an account at a bank).
  • Entity sets need not be disjoint. For example, the entity set employee (all employees of a bank) and the entity set customer (all customers of the bank) may have members in common.
  • An entity is represented by a set of attributes.
    - E.g. name, S.I.N., street, city for \customer" entity.
    - The domain of the attribute is the set of permitted values (e.g. the telephone number must be seven positive integers).
  • Formally, an attribute is a function which maps an entity set into a domain.
    - Every entity is described by a set of (attribute, data value) pairs.
    - There is one pair for each attribute of the entity set.
    - E.g. a particular customer entity is described by the set f(name, Harris), (S.I.N., 890-123-456), (street,
    North), (city, Georgetown)g.
    An analogy can be made with the programming language notion of type definition.
  • The concept of an entity set corresponds to the programming language type de nition.
  • A variable of a given type has a particular value at a point in time.
  • Thus, a programming language variable corresponds to an entity in the E-R model.

    Figure 2-1 shows two entity sets.
    We will be dealing with ve entity sets in this section:

  • branch, the set of all branches of a particular bank. Each branch is described by the attributes branch-name, branch-city and assets.
  • customer, the set of all people having an account at the bank. Attributes are customer-name, S.I.N., street and customer-city.
  • employee, with attributes employee-name and phone-number.
  • account, the set of all accounts created and maintained in the bank. Attributes are account number and balance.
  • transaction, the set of all account transactions executed in the bank. Attributes are transaction number, date and amount.

Database System Structure: