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.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Please i need help

Author  Topic 

mrtanvirali
Starting Member

41 Posts

Posted - 2009-11-22 : 03:02:41
Hi,

I've to design database in which i've to manage referrals,
there will be some zones,

zone 1
As a person has 1st referral that could get sum of amount up to 11th level (referrals) (up till a person have 3 first level referrals),

zone 2
As he/she gets 4th referral (1st level) that will move to the next zone there he/she can get sum of amount unlimited levels

and so on uptill 5th zones (options same like zone 2)


Please I need help, can any one help me in designing and or creation of database.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-11-22 : 12:12:25
seems like what you need is table to store zones and another one to store referal levels and their details
Go to Top of Page

mrtanvirali
Starting Member

41 Posts

Posted - 2009-11-23 : 00:35:22
yea visakah16
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-11-23 : 09:20:12
is that ok or do you want help in designing table also?
Go to Top of Page

mrtanvirali
Starting Member

41 Posts

Posted - 2009-11-23 : 11:10:55
ya i need help in designing tables,
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-11-23 : 11:26:52
can i ask what are attributes you have?
Go to Top of Page

mrtanvirali
Starting Member

41 Posts

Posted - 2009-11-23 : 12:16:19
Its starting, i've just little till because i am just waiting for the ideas about referrals storing and there payments details

for user regstration that could be,
ReferralId, DOB, FirstName, LastName, Address, City, Country, Zip/Postal, Email, Phone

for products table (currently only one item)
productid, name, description, typeid, categoryid, price and some others might be

category table
categoryid, name,description

i need help in referral storing and or managing

i think there should be a table for user referral maping and the attributes should be
UserId, ReferralId
but how can i manage up to 11th level and or unlimited levels,
Go to Top of Page

mrtanvirali
Starting Member

41 Posts

Posted - 2009-11-23 : 12:26:21
about product, that must be sell in the market (not online) as well as get referral to sell the product fruther
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-11-23 : 12:47:01
for managing levels you can have a hierarchial structure something like userid,refferalid which points to userid itself and it will roll down in hierarchial format. something like person1 refering person2, then person2 refering person3,.. then we can represent as

userid referingid
person1 null
person2 person1
person3 person2

....
Go to Top of Page

mrtanvirali
Starting Member

41 Posts

Posted - 2009-11-24 : 01:51:11
what about the payments how can i manage that, and can you give me the proper tables of it
Go to Top of Page

gaggel
Starting Member

8 Posts

Posted - 2009-12-03 : 00:42:32
Hi colleagues

I'm trying to design a db from scratch and I want to determine unique records to any table.
In some tables it is not possible to do it with just one field (column) and I need to determine 2 or more fields as one field in order to play the role of the primary key of the table.

E.g. for an application (p. key: 3) which is installed to this pc (p. key: 6) I have fix these problems:
3,6: wertyuiop (first record)
3,6: sdfghjklj (second record)
3,6: xcvbnmnm (third record)

For the same application in another pc I can have:
3,8: thjkiol (first record)
3,8: sasasas (second record)

So this combination of "Application_ID + PC_ID" can work as a primary key in detail table.

Does anyone know how can I declare it in the MS SQL?

Thank you all, for your time in advance.
Go to Top of Page
   

- Advertisement -