table advice

I have a table tblAffiliates where people can register as affiliates. Only some of the applicants are actually accepted. With those people I need to give them an Affiliate Code.

I am thinking of setting up a second table tblAffiliateCode so the codes can be unique (and without nulls).
eg
ID    Code
1    A01
2    A02
3    A03, etc.

How would I relate the 2 tables? would I add an AffiliateID in the tblAffiliateCode table? or would it be better to add a filed in the tblAffiliates table and store the ID or Code from the tblAffiliateCode  table?
LVL 1
ShawnAsked:
Who is Participating?
 
Ephraim WangoyaConnect With a Mentor Commented:

Sorry meant to type AffiliateID

Add the field AffiliateID in table tblAffiliates and store the ID of the of the code in there
0
 
Ephraim WangoyaCommented:

You can add the field AffiliateCode in table tblAffiliates and store the ID of the of the code in there


0
 
tabishConnect With a Mentor Commented:
Add an ID like AffiliateCodeID (in your example you are calling it ID. I would prefer more self explaintory name) in tblAffiliates and store the AffiliateCodeIDs there .  

The structure of the table "tblAffiliateCode" to store code is ok. You just may want to change the name of the field from ID to AffiliateCodeID.
0
 
ShawnAuthor Commented:
thanks for clarifying.

Shawn
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.