Click here to Skip to main content
15,071,399 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i have table courses and students in my analysis every course has multiple groups that determine by user and every group has multiple students determine also by user
how can i do this in sqlserver database analyses

i created course table and students table and tabl5 as junction table between two table
but groups i cannot handle it any one can help me in this please??
Posted
Updated 30-Mar-12 17:05pm
v2
Comments
Saral S Stalin 31-Mar-12 3:13am
   
Can you please rephrase your question? I am clueless about what you want.

1 solution

All your need is a Groups table, with an ID and a description.
You then add a GroupID field to the student table and set it as a foreign key.
You can then have multiple students in any one group.
If you also need students to be in multiple groups, then you need an extra table instead of the GroupID field, which contains the StudentID and the GroupID to allow multiple students in multiple groups.
   
Comments
nagiub2007 31-Mar-12 3:19am
   
ok courses also have multiple groups what about that?
OriginalGriff 31-Mar-12 3:35am
   
Same thing as students. Either a new table if they need multiple-multiple or a field if it is multiple-single.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900