If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Chit Chat > referential integrity violation theory question?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-10-10, 01:52
Castiel Castiel is offline
Registered User
 
Join Date: Sep 2009
Posts: 16
referential integrity violation theory question?

hey I'm learning databases @ uni and i'm a little confused abt referential integrity in this example:


There are violations on referential integrity constrains

Results (EventID, CompID, Pos, Time)


Competitors (CompID, Country, CompName, NMedals, NEventsEntered)


Records (EventID, Country, CompName)


The above is all the slide says but I'm confused about what the violation is, is the referential integrity violation in this example that the non-primary key attributes Country and CompName in the Competitors relation reference the non-primary key attributes of Country and CompName in the Records relation?
So does than mean whenever this happens (non-primary attribute of one relation referencing the non-primary attributes of another relation) that the referential integrity is violated?

Btw, this may just be a typo in the slide but in the competitors table, the Key is a combination of CompId, Country and CompName. As you can see in the above copy of the slide Country and CompName weren't underlined.

Thanks

Last edited by Castiel; 04-10-10 at 01:57. Reason: Further clarification
Reply With Quote
  #2 (permalink)  
Old 04-10-10, 05:40
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,516
not a lot to go on, is there

i'm guessing a "record" is the best time for an event (or longest distance in the case of shot put etc.)

so a record in an event is owned by a country and a competitor, and as such, the FK should be CompID

i don't see this as a violation, though -- just an incorrect design
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 04-10-10, 14:14
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
you may also want to take a look at this RI (flash) training module. Quite useful...
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On