Primary Keys

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When you create a primary key in a table and you have several other tables
and forms that use the tables, is the primary to be identified on each table
that is created so that they all link together? And should each form and
subform be bound?
 
Thomas

A primary key in a table is a way for that table to uniquely identify its
rows.

If you have normalized your data structure, there's only a small likelihood
(in a one-to-one relationship) that two tables' unique row identifiers would
have ANY relationship to each other.

More like is the scenario where one table acts as a "parent", with
(potentially) multiple "child" records in another table. In this scenario,
the primary key of the parent table gets stored AS A FOREIGN KEY in the
child table. This is considered a "one-to-many" relationship.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Jeff said:
If you have normalized your data structure, there's only a small likelihood
(in a one-to-one relationship) that two tables' unique row identifiers would
have ANY relationship to each other.

I'm not sure what you are trying to say here. Two tables are either
related to each other (in a foreign key relationship) or they are not;
there is no middle ground. Perhaps using the terms 'referenced' and
'referencing' is better than the more ambiguous 'relationship' (see
below).

Given that one table is referencing another in a (foreign key)
one-to-one relationship, how can you know the probability of
coincidence between identifier values without knowing the (difference
between the) cardinality of *both* tables?
where one table acts as a "parent", with
(potentially) multiple "child" records in another table. In this scenario,
the primary key of the parent table gets stored AS A FOREIGN KEY in the
child table. This is considered a "one-to-many" relationship.

A FOREIGN KEY can also used to model a one-to-one relationship with the
addition of a unique constraint in the 'child' table.

FWIW the standard terms are 'referencing' for 'child' and 'referenced'
for 'parent'; the correct mental model can aid comprehension <g>.

Jamie.

--
 
Jamie

My fingers overpowered my brain ... the small likelihood referred to a
non-1-to-1 relationship between tables, and allow for the possibility of a
multi-field natural unique row identifier. ... or maybe I was just getting
statistical...<g>

Jeff
 
Back
Top