If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Group and team leaders

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-30-10, 19:34
xionhack xionhack is offline
Registered User
 
Join Date: Apr 2010
Posts: 7
Group and team leaders

Hello. I am trying to make a php application that will get the data from a mysql database. The database is to store some members information. Something important to know, is that every member, is part of a team, and every team is part of a group. Every team has a team leader and maybe a team helper. Every Group has a group leader.

I am not sure how to go about it in the best way. I have thought about different solutions.

Table Members : member_id, name, group_id, team_id, is_team_leader, is_group_leader, is_team_helper.

OR

Table Members : member_id, name, team_id
Table Groups : group_id, group_leader_id (will be the member_id of a member)
Table Teams: team_id, team_leader_id, team_helper_id

Does anybody have a better way to do it? Thanks!
Reply With Quote
  #2 (permalink)  
Old 05-01-10, 13:09
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
What are you actually using this for? This looks like a homework assignment, as real organizations can't work with such specific and inflexible rules. The lack of context makes it hard to apply common sense to your design.

But some problems with the first example are pretty obvious: you can have two members be marked as group leader for the same group.

The second example seems problematic because it doesn't actually say which team is part of which group, except obliquely by saying that some member is the leader and forcing you to infer the team that way.

Does each team really have to have a leader? This means your UI must handle the bootstrapping problem, which isn't hard but does require extra UI design to create a new team at the same time as its first member.
Reply With Quote
  #3 (permalink)  
Old 05-01-10, 13:53
xionhack xionhack is offline
Registered User
 
Join Date: Apr 2010
Posts: 7
Hello. Thank you for your answer. Actually yes, its for a real organization.

Every group has a group leader, every team has a team leader and maybe a team helper. Every team is part of a group. Every member is part of a team.
Reply With Quote
  #4 (permalink)  
Old 05-12-10, 09:27
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
You're just repeating yourself.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On