Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Again, ditto's to Perrin.

There is a number of good database tutorials on this site.

But to add: If you use normalised tables the way Perrin has suggested, where the student table has an ID which is used in the table of exams take to link back to the student, and also in the exam questions answered then you can flexibly add and/or delete form teh questions answered and other tables without having to backtrack through the other tables.

Putting in a 'multi-attribute' record (such as questions answered in your description), might have been okay in a system like Pick, which supported just this trick, but not in an RDBMS.

So you would need a table for STUDENT, a table for EXAM, a table for QUESTION and an ANSWER table which ties together student and question.

In this way you can then get all of the data you want with a series of fairly simple SQL constructs using JOINs to get the final result set. Any of the good books on MySQL (MySQL Reference Manual, from O'Reilly, MySQL by DuBois from SAMS are my two favourties and the MySQL Cookbook also from O'Reilly is very useful too) will give you an entre into SQL queries.

jdtoronto


In reply to Re: SQL database architecture by jdtoronto
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-16 19:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found