On Wednesday 11 June 2003 08:47 pm, JJ wrote:
> I have to add group functionality to an existing database. The
> functionality required will be something like /etc/group in linux. 

How about 3 tables.  Groups, Members, and Relationships.

Table Group
  id int auto_increment
  name char

Table Member
  id int auto_increment
  name char

Table Relationship
  group_id int
  member_id int

this makes queries like:

select member.name from group,member,relationship where group.name='Group Foo' 
and relationship.group_id=group.id and relationship.member_id=member.id;

select group.name from group,member,relationship where member.name='Joe Bar' 
and relationship.group_id=group.id and relationship.member_id=member.id;

Ryan

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to