Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Esanders323
Starting Member
2 Posts |
Posted - 2013-11-03 : 22:22:14
|
I have a database that contains a few tables such as person, staff, member, and supporter. The person table contains information about every staff, member, and supporter. The information it contains is name,address,email, and telephone. I also created an id that is the primary key. My issue is that I also have an primary key ID for staff, member, and supporter. For instance, in the person table is John with id 1.He is a supporter so in the supporter table is pID(for person id)to reference back to John with all his information and ID(for supporter ID).pID references to the person table and every person has an ID incremented by 1 starting at 1. supporter ID is for every supporter and also starts at 1 and is incremented by 1.Is it possible to have in the supporter table pID = 1 and supporter ID = 1? Another person may have a pID = 26 and supporter ID = 5. Or will supporter ID have to be different than the pID and be something like "sup"? So you would have pID = 1 and supporter ID = sup1 or pID = 26 and supporter ID = sup5Thanks! |
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2013-11-03 : 22:54:17
|
plausible =P |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-11-04 : 00:24:07
|
you can use separate id values for both supporter and person. similarly for staff,member etceach of those tables will have pid as foreign key which will refer back to their person details.so record of pID = 26 and supporter ID = 5 means its 5th supporter whose is actually 26th person. there's no issue with that------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
Esanders323
Starting Member
2 Posts |
Posted - 2013-11-04 : 00:49:20
|
Great thank you for the clarification! |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-11-04 : 02:32:53
|
you're welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
|
|
|
|
|