...

View Full Version : Partial Dependencies?



rootmath
08-02-2011, 08:23 PM
I have a Math Education Site and I currently have my "lesson" table set up as such:

id | chapter | lesson_num | title | file_name | meta | isPracticeProblems | ect..


Is this NF2 compliant? The title, file_name etc only really depend on the lesson id, not on the chapter and lesson number. Should I separate chapter and lesson number out to a separate table?


Thanks!
M.

Old Pedant
08-02-2011, 09:01 PM
Probably. Certainly should do it by strict normalization rules.

But if this is a low-volume database/table it might not be worth the trouble.

Normalization can often be tempered by practicality.

rootmath
08-02-2011, 09:27 PM
Probably. Certainly should do it by strict normalization rules.

But if this is a low-volume database/table it might not be worth the trouble.

Normalization can often be tempered by practicality.

Thanks for the response. I've been trying to read up on the basics of normalization and relational database structures and I think I might have gotten ahead of myself. The chapter number and lesson number aren't actually keys, or ids. The combination of the two are unique for every row in the lesson table.

For example: there is only one lesson with CH 1 Lesson 4 or CH 2 Lesson 1 etc etc.

Does this still mean that this table is not normalized (for my own education, not for practical matters, although I think practically I will leave them either way)

Thanks!

Old Pedant
08-03-2011, 03:37 AM
Yes, it is not normalized. <grin/>

Technically, since Chapter 1 is repeated in several records (as well as all the other chapter numbers/names), that means you should have a separate Chapters table.

But, again, it's unlikely that it is worth hassling with for this kind of example.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum