locked
manage Referrals Zone wise (Trees & Hierarchies in SQL) RRS feed

  • Question

  • hello,

    I am working on MLM type application, In this I've 4 Zones i.e
    L zone, I zone, N zone and X zone,
    zone will change after every 4th referral e.g. in L zone user have 3 referrals as he will refer 4th referral he'll move to I zone.

    My question is how can i manage / store referrals? to find out that a user has referred to Mr. ABC in ? zone (whether L zone, I zone, N zone and or X zone)

    curently i've
    user information (userid, name, email and some other info) and
    user_referral_Mapping (userid, parentid, depth, lineage)
    quote:
    I am following
    http://www.sqlteam.com/article/more-trees-hierarchies-in-sql

    http://intelligent-enterprise.informationweek.com/001020/celko.jhtml;jsessionid=ZYDIR0EQKZOFDQE1GHPSKH4ATMY32JVN?_requestid=489639
    If I am the parent user and i've referred 4 users in 1st Zone,
    and after that i moved to 2nd Zone and there i also referred 3 users and so on,

    now i want to know that which users fall in 1st Zone and which one users fall in 2nd Zone.
    • Edited by mrtanvirali Monday, March 8, 2010 11:15 AM cnange font size
    Monday, March 8, 2010 11:13 AM

Answers

  • With my little understand I am just answering your query:
     
    Have the following tables:
    1. User - user details
    2. UserReferal - user and user referral user information
    3. UserHeirarchy - populate this table in your preferred frequency so that the new Zone changed user information will be inserted (based on zone referrals), move the history with a flag.
     
    - Ananth Ramasamy Meenachi www.msarm.com
     
    "mrtanvirali" wrote in message news:c1fb3b3c-4d6b-4b65-be72-f16cb8ea1024...
    hello,

    I am working on MLM type application, In this I've 4 Zones i.e
    L zone, I zone, N zone and X zone,
    zone will change after every 4th referral e.g. in L zone user have 3 referrals as he will refer 4th referral he'll move to I zone.

    My question is how can i manage / store referrals? to find out that a user has referred to Mr. ABC in ? zone (whether L zone, I zone, N zone and or X zone)

    curently i've
    user information (userid, name, email and some other info) and
    user_referral_Mapping (userid, parentid, depth, lineage)
    quote:
    I am following
    http://www.sqlteam.com/article/more-trees-hierarchies-in-sql

    http://intelligent-enterprise.informationweek.com/001020/celko.jhtml;jsessionid=ZYDIR0EQKZOFDQE1GHPSKH4ATMY32JVN?_requestid=489639
    If I am the parent user and i've referred 4 users in 1st Zone,
    and after that i moved to 2nd Zone and there i also referred 3 users and so on,

    now i want to know that which users fall in 1st Zone and which one users fall in 2nd Zone.

    --- Hope this helps. Ananth Ramasamy Meenachi http://www.msarm.com
    Tuesday, March 9, 2010 11:29 PM