Jump to content

Teams and group tables


xionhack

Recommended Posts

Hello. I have an organization where the members are grouped in teams, which have a team leader, and big groups, which have a group leader.

 

It goes like this, one member can only have one team, meaning one team leader. One team (team leader) takes care of 1 or more than 1 members. 1 team can have 1 or 2 team helpers.

 

Each team is part of 1 group. Each group have a group leader. The group leader is in charge of 1 or more than 1 group leaders.

 

The way i have the tables set up is as follows:

 

Member Table : member_id, name, group_id, team_id, helper_id

Team Table: team_id, team_leader, team_helper, team_helper2

Groups Table: group_id, group_leader

 

 

I dont know if thats the best way to do it, I actually  feel its not even close. Does anybody has any input? Thanks!

Link to comment
https://forums.phpfreaks.com/topic/208615-teams-and-group-tables/
Share on other sites

As long as you have table joins it should be correct. The blueprint you have seems ok.  Maybe you can also use a "rank" column. Something like this..

 

Members: member_id, name, rank, group_id, team_id

 

Groups: group_id, group_name

 

Teams: team_id, team_name, group_id

 

 

And you can query by ranks. For example..

 

$rank = "team_leader";

...."SELECT member_id FROM Members WHERE rank = '$rank'"

 

I think there may be more flexibility if you store the rank in the Members table

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.