Question Locked

Database Normalization

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is there someone who is willing to help me with normalization of a database for student courses according the first tree normal forms? please notify me. Thank you

2 replies

by tony hopkinson

Do it for you, No..

First thing to understand is you can't be 3NF, if you aren't 2NF, and you can't be 2NF if you aren't 1NF.

1NF, is really simple, each row in the table can be uniquely identified. Usually implemented as the primary key.

Ie a StudentID in the students table. You don't for instance use name, because two or more students could have the same one.

2NF is basically about lookups

If you had StudentCourses

StudentID,CourseName,CoursePrerequisites,Course...

Given more than one student is taking the course, course information is going to repeat
So have a courses Table keyed by Course ID, and then StudentCourses is just StudentID, CourseID

3NF is dependancy

Ie.
StudentCourses
CourseID, StudentID, TutorID

Given a course can have more than one Tutor, and a Tutor could teach more than one course

Waht you should have along with Tutors, is TutorCourses and take TutorID out of student courses.

Essentially when normalising you should look for repeated data in the same table or across tables that should be in one place.

Don't go mad though.

FirstNames
NameID,Name

so you don't have to store John twice for John Smith, And John Smythe is silly in that John isn't a usefully separate peice of information.

You might want to find a list of students called John, you are unlikely to ever want to know all the courses that somone with teh first Name John is taking....

HtHs

This discussion is closed to new replies.