Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

table advice

Posted on 2011-02-26
4
257 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:Shawn
  • 2
4 Comments
 
LVL 32

Expert Comment

by:ewangoya
ID: 34989358

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


0
 
LVL 32

Accepted Solution

by:
ewangoya earned 250 total points
ID: 34989361

Sorry meant to type AffiliateID

Add the field AffiliateID in table tblAffiliates and store the ID of the of the code in there
0
 
LVL 4

Assisted Solution

by:tabish
tabish earned 250 total points
ID: 34989444
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
 
LVL 1

Author Closing Comment

by:Shawn
ID: 34989524
thanks for clarifying.

Shawn
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Viewers will learn how the fundamental information of how to create a table.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question