Data Model: Basic Building Blocks

Database Systems Design, Implementation, and Management, 6e
Chapter 2: Data Models

ISBN: 061921323X Author: Peter Rob, Carlos M. Coronel
copyright © 2005 Course Technology

2.2 Data Model Basic Building Blocks

The basic building blocks of all data models are entities, attributes, and relationships. An entity is anything, such as a person, place, thing, or event, about which data are to be collected and stored. Entities may be physical objects such as customers or products. But entities may also be abstractions such as flight routes or musical concerts.

An attribute is a characteristic of an entity. For example, a CUSTOMER entity would be described by attributes such as customer last name, customer first name, customer phone, customer address, and customer credit limit. The attributes are the equivalent of fields in file systems.

A relationship describes an association among (two or more) entities. For example, there is a relationship between customers and agents that may be described as “an agent can serve many customers and eachcustomer may be served by one agent. Data models use three types of relationships: one-to-many, many-to-many, and one-to-one. Database designers usually use the shorthand notations 1:M, M:N, and 1:1 for them, respectively. (Although the M:N notation is a standard label for the many-to-many relationship, the label M:M may also be used.) The following examples illustrate the distinctions among the three.

1. One-to-many (1:M) relationship. A painter paints many different paintings, but each one of them is painted by only one painter. Thus the painter (the “one”) is related to the paintings (the “many”). Therefore, database designers label the relationship “PAINTER paints PAINTING” as 1:M. Similarly, a customer (the “one”) might generate many invoices, but each invoice (the “many”) is generated by only a single customer. The “CUSTOMER generates INVOICE” relationship would also be labeled 1:M.
2. Many-to-many (M:N or M:M) relationship. An employee might learn many job skills, and each job skill might be learned by many employees. Database designers label the relationship “EMPLOYEE learns SKILL” as M:N. Similarly, a student can take many classes, and each class can be taken by many students, thus yielding the M:N relationship label for the relationship expressed by “STUDENT takes CLASS.”
3. One-to-one (1:1) relationship. A retail company’s management structure may require that each one of its stores be managed by a single employee. In turn, each store manager—who is an employee—only manages a single store. Therefore, the relationship “EMPLOYEE manages STORE” is labeled 1:1.

Note that in the preceding discussion of relationships we have identified each relationship in both directions. That is:

1. One CUSTOMER can generate many INVOICEs.
2. Each of the many INVOICEs is generated by only one CUSTOMER.

In the next section you will learn the importance of properly identifying the nature and type of relationships.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License