Re: Assign Foreign key



On Mar 4, 11:31 am, "Allen Browne" <AllenBro...@xxxxxxxxxxxxxx> wrote:
ReadingsTbl should have its own primary key field - typically an autonumber.
The symbol field cannot be primary key in this table, since it can occur
many times.

I think the most likely candidate is a compound (no pun intended) key
of (symbol, Readdate). A key should prevent duplicate data; just
adding an autonumber would allow duplicates to be created e.g.

INSERT INTO ReadingsTbl (symbol, Read1) VALUES ('FE'. 1.1)
;
INSERT INTO ReadingsTbl (symbol, Read1) VALUES ('FE'. 1.1)
;
INSERT INTO ReadingsTbl (symbol, Read1) VALUES ('FE'. 1.1)
;
etc

In summary, a foreign key is ... a field in one table
that links to the primary key of another table

No, the OP has the point: *generally* it is the 'primary key' however
RI can be enforced using any 'unique' constraint (a.k.a. key).

a one-to-one relation, which is rare.

Not at all. The classic example is human relationships where in
marriage it is polygamy (one to many) that is the rare case and
monogamy (one to one) that by far the most common across cultures.

Jamie.

--


.



Relevant Pages

  • Re: Foreign Language in Menu items
    ... I forgot to say that I plan to make foreign language for reports too. ... understand how the primary key could duplicate data in it. ... You could select New Query, add no tables, and switch Query Design View to ...
    (microsoft.public.access.formscoding)
  • Re: Foreign Language in Menu items
    ... understand how the primary key could duplicate data in it. ... You could select New Query, add no tables, and switch Query Design View to ... CtrlProperty TEXTNOT NULL, ...
    (microsoft.public.access.formscoding)
  • Re: Foreign Language in Menu items
    ... You have taught me how to make table starting from SQL view. ... filling the data it was rejected because my concept of multiple primary key ... One issue maybe when I fill in the Korean, or Japanese language which are ... understand how the primary key could duplicate data in it. ...
    (microsoft.public.access.formscoding)
  • Re: Foreign Language in Menu items
    ... understand how the primary key could duplicate data in it. ... I can make the table's fields with their primary key, ... The other thing is the VBA Public Sub LanguageControls() a module? ... I think this can only be done in a .mdb file, ...
    (microsoft.public.access.formscoding)
  • Over 500 Tasks; Yes/No in project?
    ... I have a table that has over 500 records and those records have a 'taskId' ... Each project has it's own ID also as the primary key. ... My concern is that I don't duplicate data already available in tables and ... a master plan for the project of what tasks are in this project. ...
    (microsoft.public.access.tablesdbdesign)