Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Table relationship in sql server 2005

Author  Topic 

yasin84
Starting Member

1 Post

Posted - 2008-09-18 : 14:45:28
hi friends
am pretty new to sql server 2005 and am in a dilemma.
i have 4 tables namely:
1) pupil - containing details about the pupils
2) group - containing details about a group of pupils
3) lesson - containing details about different lessons available
4) course - containing details about courses offered

the problem is:
a pupil must be a member of a group. Now a lesson may be part of a course or may not and a course consists of a series of lessons. A group should be enrolled to a lesson or a course. How do i relate these 4 tables? Determining the primary key and foreign keys of each tables

please help me
thanking you all in advance for your kindness

Jawad Khan
Starting Member

21 Posts

Posted - 2008-09-25 : 05:13:17
Well there may be many designs. Here is a way it can be done. The image below shows the tables. The primary keys and FKs are visible.


Here is some sample data.
Go to Top of Page
   

- Advertisement -