Data models
Data model is a collection of conceptual tools for describing data, data relationships, data semantics, and consistency constraints.
E-R Model:
- The entity-relationship (E-R) data model is based on a perception of a real world that consists of a collection of basic objects, called entities, and of relationships among these objects.
- An entity is a “thing” or “object” in the real world that is distinguishable from other objects. For example, each person is an entity, and bank accounts can be considered as entities.
- Entities are described in a database by a set of attributes.
- For example, the attributes account-number and balance may describe one particular account in a bank, and they form attributes of the account entity set. Similarly, attributes customer-name, customer-street address and customer-city may describe a customer entity.
- An extra attribute customer-id is used to uniquely identify customers (since it may be possible to have two customers with the same name, street address, and city).
- A unique customer identifier must be assigned to each customer.
- A relationship is an association among several entities. For example, a depositor relationship associates a customer with each account that she has.
- The set of all entities of the same type and the set of all relationships of the same type are termed an entity set and relationship set, respectively.
- The overall logical structure (schema) of a database can be expressed graphically by an E-R diagram.