Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > MySQL > Table structures...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-03, 07:26
pearl2 pearl2 is offline
Registered User
 
Join Date: Nov 2003
Location: Sinapore
Posts: 140
Table structures...

Hey,

I'm at the stage of planning for a database to store scores of test marks for English, Math and Science for a class of students.

Among the tables I've planned are three tables corresponding to the three subjects to store the test id, the score, the question numbers in which wrong answers were given and the date the test is taken: (note that the member_id is a foreign key in the three tables below but a primary key in a student_tbl):

english_tbl
Member_id (FK)
Test_id
Score
Wrong question IDs
Date Taken

math_tbl
Member_id (FK)
Test_id
Score
Wrong question IDs
Date Taken

science_tbl
Member_id (FK)
Test_id
Score
Wrong question IDs
Date Taken

Please pardon me if my question sounds elementary. I'm new to databases and although I've read a couple of books on the subject, I'm still groping in the dark when it comes database design.
Reply With Quote
  #2 (permalink)  
Old 12-03-03, 08:45
Mincer Mincer is offline
Registered User
 
Join Date: Sep 2003
Location: London
Posts: 56
Re: Table structures...

Quote:
Originally posted by pearl2
Please pardon me if my question sounds elementary.


And what question, pray tell, is that?

I'll guess that you're asking if that's a good way of doing it??

If it were me, I'd have a table for courses, a table for students, and a table called student_test that held the info for each test taken, whatever subject it was in.

Table StudentTest

studentID (fk)
testID (fk)
mark
dateTaken

I would make a unique key on studentID, testID and dateTaken (unless resits are not applicable, in which case just testID and studentID).

Regards,

Matt.
Reply With Quote
  #3 (permalink)  
Old 12-03-03, 09:01
pearl2 pearl2 is offline
Registered User
 
Join Date: Nov 2003
Location: Sinapore
Posts: 140
I realised I didn't have a question in my message.

But you figured what I was asking...

Thanks for advice!
Reply With Quote
  #4 (permalink)  
Old 12-03-03, 09:09
pearl2 pearl2 is offline
Registered User
 
Join Date: Nov 2003
Location: Sinapore
Posts: 140
Modified...

Test_stats
-Member_id
-Subject_id
-Test_id
-Score
-Wrong question numbers
-Date Taken

Subjects
-Subject_id
-Subject

Is the above a better table structure?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are On
Pingbacks are On
Refbacks are On