Databases Reference
In-Depth Information
Let's proceed by revisiting some terminology from Chapter 2, and introducing
some additional terminology along with some additional concepts. What we have
been loosely referring to as a ''thing'' or ''object'' in our environment that we want
to keep track of is called an entity . Remember that this is the real physical object or
event, not the facts about it. John Baker, the real, living, breathing person whom you
can go over to and touch, is an entity. A collection of entities of the same type (e.g.,
all the company's employees) is called an entity set .An attribute is a property of,
a characteristic of, or a fact that we know about an entity. Each characteristic or
property of John Baker, including his salesperson number 137, his name, city of
Detroit, state of Michigan, office number 1284, commission percentage 10, and year
of hire 1995, are all attributes of John Baker. Some attributes have unique values
within an entity set. For example, the salesperson numbers are unique within the
salesperson entity set, meaning each salesperson has a different salesperson number.
We can use the fact that salesperson numbers are unique to distinguish among the
different salespersons.
Using the structure in Figure 3.2, we can define some standard file-structure
terms and relate them to the terms entity, entity set, and attribute. Each row in
Figure 3.2 describes a single entity. In fact, each row contains all the facts that we
know about a particular entity. The first row contains all the facts about salesperson
119, the second row contains all the facts about salesperson 137, and so on. Each
row of a structure like this is called a record . The columns representing the facts
are called fields . The entire structure is called a file . The file in Figure 3.2, which
is about the most basic kind of file imaginable, is often called a simple file or a
simple linear file (linear because it is a collection of records listed one after the
other in a long line). Since the salesperson attribute is unique, the salesperson field
values can be used to distinguish the individual records of the file. Speaking loosely
at this point, the salesperson number field can be referred to as the key field or key
of the file .
Tying together the two kinds of terminology that we have developed, a record
of a file describes an entity, a whole file contains the descriptions of an entire entity
set, and a field of a record contains an attribute of the entity described by that
record. In Figure 3.2, each row is a record that describes an entity, specifically a
single salesperson. The whole file, row by row or record by record, describes each
salesperson in the collection of salespersons. Each column of the file represents a
different attribute of salespersons. At the row or entity level, the salesperson name
field for the third row of the file indicates that the third salesperson, salesperson
186, has Adams as his salesperson name attribute, i.e. he is named Adams.
One last terminology issue is the difference between the terms ''type'' and
''occurrence.'' Let's talk about it in the context of a record. If you look at a file,
like that in Figure 3.2, there are two ways to describe ''a record.'' One, which is
referred to as the record type, is a structural description of each and every record in
the file. Thus, we would describe the salesperson record type as a record consisting
of a salesperson number field, a salesperson name field, a city field, and so forth.
This is a general description of what any of the salesperson records looks like. The
other way of describing a record is referred to as a record occurrence or a record
instance. A specific record of the salesperson file is a record occurrence or instance.
Thus, we would say that, for example, the set of values { 186, Adams, Dallas, TX,
1253, 15, 2001 } is an occurrence of the salesperson record type.
Search WWH ::




Custom Search