Help with relationships/table desgin?

ahuvas

Registered User.
Local time
Today, 08:30
Joined
Sep 11, 2005
Messages
140
Hi

I've been working with access on a small scale for a long time, creating databases so I can track information about studies etc just for me. I'm pretty handy with VBA etc but have not put a lot of effort into creating normalized relationships but now need to work on a database that I need to share with someone and want to make sure that I am doing the right thing.

I need to track information about patients attending a series of education sessions. Each patient attends 4 sessions. At the first session, the patient fills out their personal information, as well as a questionnaire about their knowledge. This questionnaire is presented in the identical form at the next two sessions. At the fourth session, the patient fills out the knowledge questionnaire, as well as a second questionnaire.

Can I get by with having only two tables - patient info table and session data table i.e.?

Table 1
ID
FirstName
Surname
Age...
and so on...


Table 2
ID
PatientID
Q1
Q2
Q3
..and so on...


The table would be joined at ID (Table 1) and patient ID (Table 2). The primary key of table 1 would be ID. Is the primary key of table 2 a combination of ID and PatientID? Im so confused now that I am trying to learn the basics after the more advanced capabilities. :banghead:

My other issue is that not all the questions in table 2 relating the the questionnaire 2 will be completed during sessions 1-3, only session 4.

Is anyone able to help get me started?
 
The simplest way is that T2 has a primary key that is made up of 2 fields, PatientID and SessionID, where SessionID is between 1 and 4. You might also want a simple counter field in T2 also, Indexed-NoDuplicates, just so you can keep track of how many sessions there have been overall.
It shouldn't matter that not all Questions are answered in each session, just make sure those fields have Required set to No.
 
Thanks - so I wasn't off the mark. I will prepare a sample database and upload it in the next day or two.

Many thanks!
 

Users who are viewing this thread

Back
Top Bottom