Database Reference
In-Depth Information
It's not very exciting at this point. However, as we add each layer of in-
formation in the following sections, it will get significantly more compli-
cated very quickly.
Primary Keys
Now that we have entities in the model, the very next thing that needs to
be added are the primary keys for every entity. This is because relation-
ships are based on the primary keys, so we can't add the relationships until
all the primary keys are in place. Additionally, when you start creating
relationships between entities, you will add the parent's attribute to the
child's attribute list (most software does this for you when you add the
relationship).
For most entities in the MVM model, we are using a surrogate primary
key to represent the uniqueness of a record. In some cases, there is a com-
posite primary key in order to ensure data integrity; some entities have no
key except for the composite foreign key relationship between two other
entities in a many-to-many relationship. Figure 7.6 shows the entities with
their native primary keys, including the few that have no primary key.
This is slightly more interesting, although all we can see are the
ObjectID fields. However, that gives us enough structure to start adding
the relationships.
Relationships
At this point, we can start adding relationships based on our relationship
list. There is not necessarily a preferred order for adding relationships to
the model, but it's safe to say that adding the simple, zero-or-one-to-many
relationships first will speed things up greatly.
Once you have added the easier, simpler relationships, you can begin
working with more-complicated relationships, such as the many-to-many
relationships and any subtype clusters you may have. Speaking of subtype
clusters, if you review Figure 7.7, you'll see that MVM required one.
Notice that the attributes that previously had no primary key now do;
these keys are composite keys made up of the relationships to keys in the
related parent tables. At this point, we now have primary keys in every en-
tity in the model. Additionally, after you've added all the relationships,
you'll have a nearly complete picture of the data model. However, we need
to ensure that our relationships visually annotate the desired cardinality.
Search WWH ::




Custom Search