Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database design and database integrity

Status
Not open for further replies.

AGus01

Technical User
Sep 6, 2005
54
GB
hi I have an existing table called resellers with a unique Id of ResellerId. I am being asked to add a new id for the client called PF_ID for some of these resellers.

With the following business rule:
For A single PF_ID there may be multiple partner (resellers). There may not however be multiple PF_ID associated with a single reseller.


So for example you may have:

Reseller ID New PF_ID

123 456
111 456

But you wouldn’t have


Reseller ID New PF ID

123 456
123 789

Can anyone advise me the best way to design the database to maintain the data integrity and the rule above do i need some sort of lookup table? Or can i add an id to the existing reseller table.

Sorry i have not much common sense in this regard. input appreciated.
 
erm, what is the PF_ID, sounds suspiciously like a foreign key to me, and if that is the case, then just have a foreign key relationship between the 2 tables, you can have the PF_ID nullable on the reseller table if necessary, or you can introduce a junction table if nulls aren't to your liking...

--------------------
Procrastinate Now!
 
Just put the PF_ID in the Reseller table. Requirements satisfied.

[COLOR=black #e0e0e0]For SQL and technical ideas, visit my blog, Squared Thoughts.[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top