Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Question : About redundancy

Re: SQL Question : About redundancy

From: Greg Teets <teetshd_at_ucbeh.san.uc.edu>
Date: 1997/09/14
Message-ID: <341c34a1.167017136@news.ececs.uc.edu>#1/1

This is not redundant(at least not for our purposes). The student idfield in the courses table would be a foreign key. The foreign key is what lets the two tables relate to each other. With the use of the key field you are avoiding the redundancy of having to put the student's name and other info from the student table into the courses table.

Perhaps a more efficient way is to just list the course numbers and description in the courses table. Then make a third table registration_results, with just the student id, course number, and grade fields.

The primary key in this table would be a combination of the student_id and course_number columns, with both those columns being foreign keys referenced to the appropriate parent tables.

Greg Teets
Cincinnait

On Sat, 13 Sep 1997 23:48:11 -0500, Srinivasan Vinod <vks7584_at_tntech.edu> wrote:

>Hello
>
>My question goes like this. Suppose I need to create a database to
>retrieve all the courses taken by a student in a term. Lets say I
>created a table that deals with student information and it has a primary
>key which is a student ID. I have a course table describing all the
>courses. If I need to relate these two, do I need to create a table that
>has a students id and all the courses taken by that student. If I do
>that, I am repeating the ID number in one column in case a student takes
>more than one course. How do I avoid this redundancy? Is this normal or
>is there anyway that I can avoid this redundant data in one column..
>
>I am a beginner and just started learning database. Please do advice and
>mail me at vks7584_at_tntech.edu.
>
>vks
Received on Sun Sep 14 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US