| | |
Implementing 1:1
Please support our Database Design advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2007
Posts: 2
Reputation:
Solved Threads: 1
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
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
![]() |
Similar Threads
- help implementing singly linked list (C++)
- Implementing Random Images (Java)
- Microsoft to reinstate Java in Windows (Windows Software)
- Source code implementing Latent Semantic Indexing (Java)
- URGENT: Implementing search with multiple dissimilar MySQL tables (MySQL)
- help required for implementing project using JAVA & XML (Java)
- No Posts? (DaniWeb Community Feedback)
- Novell (Novell)
- New Testing (Windows NT / 2000 / XP)
Other Threads in the Database Design Forum
- Previous Thread: need excel help
- Next Thread: Total noob question
| Thread Tools | Search this Thread |





