Database Reference
In-Depth Information
record in a table; you often see the terms instance, record, and row used
interchangeably in data modeling. For our purposes, an instance occurs in
an entity, and a row or record occurs in a physical table or view.
It is often tempting to think of entities as tables (there is often a one-
to-one relationship between entities and tables), but it's important to re-
member that a logical entity may be represented by multiple physical
tables or a single table may represent multiple entities. The purpose of an
entity is to identify the various pieces of data whose attributes will be
stored in the database.
One way to identify what qualifies as an entity is to think of entities as
nouns. Entities tend to be objects that can be referenced as a noun; orders,
cars, trumpets, and telephones are all real-world objects, and therefore
they could be entities in a logical model. It's crucial to accurately identify
the entities in your model, and it's a large part of the early design effort.
When choosing entities, you should first concern yourself primarily
with the purpose of the entity and worry later about the attributes and
other details (we talk about attributes in the next section). As part of the
requirements gathering process (detailed in Chapter 5), interviews with
users and other key stakeholders will reveal the common nouns used
throughout the business, and therefore the key entities. Once you begin
designing the model, you will use your notes to identify the entities you will
need. You must take care to filter your notes and use only the information
that is relevant to the current project.
Attributes
For each entity, there are specific pieces of information that describe it.
These are the attributes of that entity. For example, suppose you need to
create an entity to store all the pertinent information about hats. You name
the entity Hats, and then you decide what information, or attributes, you
need to store about hats: color, manufacturer, style, material, and the like.
When you construct a model, you define a collection of attributes that
stores the data for each entity. The definition of an attribute is made up of
its name, description, purpose, and data type (which we talk about in the
next section).
Be wary of attaching attributes to one entity that actually belong to an-
other entity. One common mistake is to convert data from physical docu-
mentation (such as printed spreadsheets or manuals) into entities and
 
 
Search WWH ::




Custom Search