A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Table relationship question



 
 
Thread Tools Display Modes
  #1  
Old February 1st, 2010, 01:44 AM posted to microsoft.public.access.tablesdbdesign
terry w
external usenet poster
 
Posts: 7
Default Table relationship question

hi to all

I'm fairly new at this but making great progress. I'm really struggling
with part of a database I'm working on for a soccer club. Most of the work
is done (contacts, registration, etc) but there is a part of the db that is
giving me tons of trouble. This has to do with timetabling / scheduling.

Basically, kids can sign up for classes that run in a Session (Fall,
Winter, Spring, etc). Some of these classes run once a week at set times
(eg, Tiny Tots), others run multiple times a week at varying times (eg,
Junior Kicks). (this is deternmined by the level and age of the class
members.) To complicate things, there are other higher-leveled classes that
run in a full-year session (eg, Comp Stars A). Finally, there are some
students that sign up for a multi-hour camp sessions that run all on one day.

I'm really not sure what is the best way to relate my tables. I've
experimented with...

a) A master table called tblEvents, that is linked to a number of other
tables. (tblstudent, tblSession, tblClass, tblDates, etc.)

b) A master table called tblEvents that is linked to other tables that are,
in turn, linked to others. (for example, tblEvents links to tblClass, but
tblClass is now linked to tblSession, tblDates, etc.)

Here's my questions:
1) are there any general guidelines or advice from the experts for this sort
of thing?

2) are there any good schemas laying out this type of scheduling situation?
I've been looking without a lot of success.

One of the things that is important to our coaches is that the tables be set
up in such a way that I can easily print timetables for, say, a given week.

much appreciated
Terry


  #2  
Old February 1st, 2010, 08:52 PM posted to microsoft.public.access.tablesdbdesign
Mr. B[_4_]
external usenet poster
 
Posts: 171
Default Table relationship question

Terry,

From your post I am assuming that any one student may be signing up for more
that one class, especially if you consider this possibility over a longer
period of time. Therefore, you will have a situation where multiple students
can sign up for mupltiple classes. This creates what is referred to as a
many-to-many relationship.

To create a many-to-many relationship between tables, you create a third,
intermiderary, table. This table only needs to have fields that will hold
the foreign key values from the other tables that you are linking together.

For example if you want to link multiple students to multiple classes, you
would simple have a table with fields like:

StudClassLinkID - unique record identifier for each record in this table
StudentId - ID value of the key field from the Students table
ClassId - ID value of the key field from the Classes table.

These fields would be filled in for each link between each studend and each
class that one student signed up for.

I hope this will at least provide you with a starting point.

-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm


"terry w" wrote:

hi to all

I'm fairly new at this but making great progress. I'm really struggling
with part of a database I'm working on for a soccer club. Most of the work
is done (contacts, registration, etc) but there is a part of the db that is
giving me tons of trouble. This has to do with timetabling / scheduling.

Basically, kids can sign up for classes that run in a Session (Fall,
Winter, Spring, etc). Some of these classes run once a week at set times
(eg, Tiny Tots), others run multiple times a week at varying times (eg,
Junior Kicks). (this is deternmined by the level and age of the class
members.) To complicate things, there are other higher-leveled classes that
run in a full-year session (eg, Comp Stars A). Finally, there are some
students that sign up for a multi-hour camp sessions that run all on one day.

I'm really not sure what is the best way to relate my tables. I've
experimented with...

a) A master table called tblEvents, that is linked to a number of other
tables. (tblstudent, tblSession, tblClass, tblDates, etc.)

b) A master table called tblEvents that is linked to other tables that are,
in turn, linked to others. (for example, tblEvents links to tblClass, but
tblClass is now linked to tblSession, tblDates, etc.)

Here's my questions:
1) are there any general guidelines or advice from the experts for this sort
of thing?

2) are there any good schemas laying out this type of scheduling situation?
I've been looking without a lot of success.

One of the things that is important to our coaches is that the tables be set
up in such a way that I can easily print timetables for, say, a given week.

much appreciated
Terry


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.