The other folks' comnents++... but to get you started, the obvious first guess at a database structure is this:

The tables would be (choose your own naming convention... you don't have to agree with mine): EXAM, QUESTION, ANSWER, and STUDENT, STUDENT_EXAM, QUESTION_ANSWER.

Basically, EXAM, QUESTION and ANSWER represent the abstract exam... a template for each possible student exam. The real data of interest ends up residing in QUESTION_ANSWER... this is where you ultimately say that student "Fred", on exam 3, answered "c" to question 17.

Anyway, if that is a good start for you, then good luck... if it zoomed right over your head, then you need to read yourself up a little bit on relational databases. Then read this again.

Update:
jdtoronto's reply hadn't been posted yet, when I started writing my reply... which is somewhat redundant of his (sorry, JD... typing lag).

Anyway, just want to avoid confusion: the table-names he (or she?) uses do not mean the same things as mine do. Where he says EXAM, I say STUDENT_EXAM, and where he says ANSWER, I say QUESTION_ANSWER. Maybe I would have been more clear if I had said "POSSIBLE_ANSWER and ANSWER" as opposed to "ANSWER and QUESTION_ANSWER" (respectively)... oh, well.


------------
:Wq
Not an editor command: Wq

In reply to Re: SQL database architecture by etcshadow
in thread SQL database architecture by punchcard_don

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.