Design problems

D

Debbie

I am trying to create a database to store the classes that
students have taken and their grade if they have taken the
class.
My first thought is to have 3 tables:
Student: studentID, Name, address, etc.
Course: courseID, title, credits
Enrollment: courseID, term, studentID, grade

When set up in this manner, I either get duplicate records
or I only see the courses that the student has a grade
for. (when doing queries)

Any suggestions?
 
T

TC

I am trying to create a database to store the classes that
students have taken and their grade if they have taken the
class.
My first thought is to have 3 tables:
Student: studentID, Name, address, etc.
Fine. Define StudentID as the primary key. This table stores values that are
common to the student, regardless of any course or result.
Course: courseID, title, credits
Fine. Define CourseID as the primary key. This table stores values that are
common to the course, regardless of any students on it.
Enrollment: courseID, term, studentID, grade
Fine. Define the first three fields as the (so-called "composite") primary
key. This table stores values that are specific to a particular student in a
particular term of a particular course; for example, the grade that got,
that term, for that course.

When set up in this manner, I either get duplicate records
or I only see the courses that the student has a grade
for. (when doing queries)

Read-up on "outer joins". Then show us the SQL text of your queries.

HTH,
TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top