Re: Question of Table Design and Foreign Keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jason, many thanks Jason for your reply.

On Tuesday, May 31, 2005, at 11:25 AM, Jason Minion wrote:

I think the way you want to look at it is: if a record exists in
sample_attributesjoin, then it needs to reference both samples
and attributes. You don't need to worry about samples or attributes
being "off" because they don't have "enough" references, instead
you want to ensure that if a record exists (whether inserted,
updated, or references are deleted) in sample_attributesjoin
that the sample_id and attribute_id are always valid.


Yes, this is what I was thinking but just needed to ensure this was the right approach since I have a number of tables and similar circumstances. So if there is no attributes for a sample record when I join the tables and query, I will just have nothing returned for these records and no trouble with integrity, am I correct? When I up update or delete records that I have added to attributesjoin, the referential integrity of attributes and samples table is maintained using the constraints, have I got this right?

Regards,
David


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux