Implementing 1:1

Reply

Join Date: May 2007
Posts: 2
Reputation: BobWeiner is an unknown quantity at this point 
Solved Threads: 1
BobWeiner BobWeiner is offline Offline
Newbie Poster

Implementing 1:1

 
0
  #1
May 31st, 2007
What is the proper way to implement a 1:0,1 relationship between tables? I have two cases where I would like to use this.

First, I need to track members of a school. Since students require more info than faculty I created two tables, Person and Student. The Student table contains a PersonID field which is unique and a foreign key to the primary key in Person. I then created a View on Person called Faculty which lists everyone that doesn't join with an entity in Student.

This is basically an inheritence problem. My solution works so far but is klunky.

The other scenario is that of managing students accounts with an third-party service. In this case, I am considering Person and Account tables and again using a LEFT JOIN to determine who has accounts.

Is there a better way to go about this? It doesn't feel right and seems like if I scale this out, I'm going to run into problems. I am using MS SQL 2005.

Any advice? Thanks!
bob
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC