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 > Database Concepts & Design > Implementation of a cross reference???

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-06-11, 10:26
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
Implementation of a cross reference???

I am being asked for implementation of a cross reference table to be used in a way that I have never seen before. Thought I would see what you all think of this and see if you have suggestions on a better implementation of such. Thanks for any replies.

Here is the situation. We have a policy header table, which contains a foreign key for insurance type. This table has a child table called policy coverage and it contains a coverage code as part of its primary key, which is a foreign key to a coverage code table. They are wanting an XREF tabe of insurance types and coverage codes. What they plan on doing is they get the insurance type entered into the policy header. Then they want to look at the XREF table to see what coverages apply for that insurance type. Then insert the appropriate coverage code into the policy coverage table. Essentially, implementing a wierd sort of programmatically/rdbms controlled RI, where 1 part of the key is carried in one table and the other carried in another table.

I have included a picture of the model in the attached BMP, policy coverage. As I said this implementation seems a bit hokey to me. I've got a couple of ideas, but the one that most strikes me is in the second BMP file, with corrected in the name.

Dave Nance
Attached Images
File Type: bmp policy coverage.bmp (750.1 KB, 15 views)
File Type: bmp policy coverage corrected.bmp (750.1 KB, 17 views)
Reply With Quote
  #2 (permalink)  
Old 04-06-11, 10:34
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
first diagram looks fine to me

what's hokey about it?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 04-06-11, 11:51
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
As I said the way half the key from the cross reference was in header table and the other half of the key from the cross reference is held in the code table. So maintaining data integrity is half RDBMS and the other half is programmatic. With the corrected version I am ensuring that the coverage code is actually linked with the proper insurance type, rather than ensuring that the coverage code is valid, but not neccessarily linked with the insurance type. By replacing the coverage code, with the surrogate key from the cross reference table, I would now ensure that the coverage is indeed linked to the insurance type.
Dave
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