tags:

views:

57

answers:

1

I have an entity group and another entity as members.One particular group may have a number of members but a particular member belongs to one particular group only.In short i have a one to many relationship between group and member.How should i go about adding the relationship in my data model class.

Thanks in advance

+1  A: 

For your data model (ERM) You will want a foreign key in the member table pointing to the group table. eg:

Group table definition:

CREATE TABLE GROUP ( grp_id int, grp_name varchar(100) )

CREATE TABLE MEMBER ( mbr_id int, mbr_grp_id int, mbr_name varchar(100) )

... foreign key for mbr_grp_id ...

Russell