Solved

table setup question

Posted on 2011-02-15
3
887 Views
Last Modified: 2012-05-11
I am setting up an affiliate program and need a little help setting up the tables.

Each new Affiliate can be Sponsored by one person and once an Affiliate is set up he can Sponsonr as many people he likes.

the first table is tblAffiliates with AffiliateID, Name, email and possibly SponsorID (just another AffiliateID)

the next table to set up would be tblAffiliateSponsors with AffiliateSponsorID, AffiliateID, SponsorID (this would actually be another AffiliateID. just 2 different people)

something just seems strange.

any advice on how to set this up?
0
Comment
Question by:Shawn
  • 2
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 34902854
Can a single person be sponsored by ONLY one person?

If so, then including the SponsorID field in your Affiliates table (and linking that back to the AffiliateID) should work. This is a "self-join".
0
 
LVL 1

Author Comment

by:Shawn
ID: 34902861
yes, only one person.

ah right. So when I if I want to know all the people Bob has sponsors I do a query on the same table with Bob's ID as the filter
0
 
LVL 84
ID: 34903041
Yes.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now