Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder thindrakhya's Avatar
    Join Date
    Jun 2007
    Posts
    90
    Thanks
    8
    Thanked 0 Times in 0 Posts

    databse design problem

    hi everyone

    I am designing the databse fro the students who will register on the site .

    Each students will have some more persons working under them
    theat student leader will then assign ids to Perons

    so there will be group of say n number of persons working uder them.
    Now the work will be divided between the persons like say money , project parts , transport , items to be bought

    for single case , i desined two tables
    users ---------ID , name
    balance sheet --------------project id , item id ,..........
    users-person -----------leaderid , personID , itemid


    Things are good if there is only 1 students
    LIke person A boght books with item iD 1 and is related to learserid 1
    but in case of more students leader the value of ItemID will not be unique Leader 1 can have itemid 1 and leader 2 can also have itemid 1

    Should i have to create new table leader{x} balance sheet and leader{x} every time the leader is registed so that all are separated.
    Is this solution good to create new table every time

    or i have to fill all the details of 100s of students in two tables only

    I don't know which solution is more practicle

  • #2
    Regular Coder
    Join Date
    May 2007
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am not sure if i understand exactly what you want but in case of users(leaders)/users-persons and items i suggest a tables like this..

    users (ID primary key auto_increment, name)
    users-persons (ID primary key auto_increment, usersID)
    items (ID primary key auto_increment, user-personsID)
    Forum for webmasters and developers
    http://www.htmlfrenzy.com
    Are you an IT expert? Join our Reward system
    www.htmlfrenzy.com/reward-system.php

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    your current design is correct, always think in terms of more rows rather than more tables.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •