Databases Reference
In-Depth Information
Each node contains two pointers to nodes on the left and right sides. Leaf
nodes, which are the nodes located at the bottom of the index, also contain a
pointer to where the data for the key value is physically stored. To see how this
works, trace the search for a data record with the key value 92654. You search
at the root node containing index value 51247. The search value 92654 is greater
than 51247, so follow the right pointer from the root and go to the index record
with key value 82928. From here, you follow the right pointer which takes you
to the index record with key value 92654. This is the index record you are look-
ing for. The data pointer from this index record gives the physical location
needed to retrieve the data record.
SELF-CHECK
Explain the role of entities, attributes, and relationships in data
modeling.
Describe how logical entities relate to physical tables.
Explain the term referential integrity and how it is maintained in a
relational database.
3.3 Understanding Relationships
You saw some simple relationship examples in the last section. However, to
understand relationships you need to look at them in greater detail. There are
three basic relationship types:
Binary relationship: a relationship between two types of entities.
Unary relationship: a relationship with another occurrence within the
same entity.
Ternary relationship: a relationship directly involving three entity types.
The majority of the relationships in most relational databases are binary rela-
tionships. An entity can have separate binary relationships with any number of
other entities in the database. Each binary and unary relationship can also be
described as one-to-one, one-to-many, or many-to-many. These terms are
described a little later in this chapter.
This section uses examples based on a fictitious company. The company has
a sales staff that sells directly to its customers. Salespersons are assigned specific
Search WWH ::




Custom Search