PDA

Click to See Complete Forum and Search --> : Database Design


Lechugas
Sep 28th, 2000, 04:07 PM
Hi to all. I am trying to make a database but I cannot find out how
to build it. The problem I have is that I must store several values
according to a date and a Title. For example, suppose I will store a
test for students. I will need as a primary key the date of the exam
or the title of it. Then I will have to store all the questions for that
exam, do you get the point? I do not know how to explain it... let me
think... I mean, for each test (ie for each day) there will be many
questions (only numbers, I will have the questions in another table) so
how can I do to store a lot of questions for one day. Obviously, I want
to store, for instance, 3 examns, so I wil have to store the questions
for each exam. How can I achieve this? Do you understand?

Thanks

RIVES
Sep 29th, 2000, 06:51 AM
Ok. here...

Reference tables...

r_questions
question_code char(3)
question_desc varchar(100)

Primary key on question_code

r_titles
title_code char(3)
title_desc varchar(30)

Primary key on title_code

t_exam
exam_date char(8) --'MMDDYYYY'
title_code char(3) FK on r_titles
question_code char(3) FK on r_questions

Primary key on exam_date, title_code, question_code

Tonio169
Sep 30th, 2000, 06:05 AM
i don't fully understand your question.. but here's what i think it is:

Tables:

tblExams
Fields:
ExamDate (PrimaryKey)

tblQuestions
Fields:
ExamDate (ForeignKey)
ExamNumber
ExamQuestion
ExamTitle

xmin
Sep 30th, 2000, 07:34 AM
Hi, Lechugas, I don¡¯t quite understand what you mean, either. Do you want to build:
1. a database with two tables one of which is used to store the Exam Paper (the problem numbers) and the other the date and title; and
2. another with one (or more, if the problems are classified) table to store the problems?

Or:
Only one database with all the above-mentioned tables?