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  dBforums > Database Server Software > MySQL > Table structures...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-03, 06:26
pearl2 pearl2 is offline
Registered User
 
Join Date: Nov 2003
Location: Sinapore
Posts: 187
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, 07: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, 08:01
pearl2 pearl2 is offline
Registered User
 
Join Date: Nov 2003
Location: Sinapore
Posts: 187
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, 08:09
pearl2 pearl2 is offline
Registered User
 
Join Date: Nov 2003
Location: Sinapore
Posts: 187
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On