View Single Post
  #1  
Old November 12th, 2009, 10:26 PM posted to microsoft.public.access.tablesdbdesign
nikka
external usenet poster
 
Posts: 3
Default referential integrity and tables

I have several tables.
Let's say that Table1 is Inventory - it is a superclass table and contains
all inventory ids as its primary key and some other general info that applies
to each inventory item.
Table 2 is Car that has primary key that is a foreign key from Inventory
table.
Table 3 is Container that has primary key that is a foreign key from
Inventory table.
Table 2 and Table 3 are subclasses, they are disjoint and total in my design.
I linked primary keys in Table 2 and 3 to the primary key in Table 1, and MS
Access placed 1:1 relationship.
I need it to be 0:1 or 1:1 relationship, so that record for Table 1 is
always there for either table 2 or 3.
As of now, when I'm typing information with primary key "1" in Inventory, it
asks for the records with primary key "1" in both tables Table 2 and 3.

How do I make it, so for example, Table 1 has keys 1,2,3 where key "1" and
"2" are primary keys in Table 2, but key "3" refers to Table 3?

Is there anyway to do it just by leaving primary keys in Table 1 be a
foreign key which is at the same time a primary key in Table 2 and 3 without
creating a new attribute in Tables 2 and 3 which will be a separate foreign
key for Table 1???

Thanks