Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2010
    Posts
    29
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Partial Dependencies?

    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.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,986
    Thanks
    79
    Thanked 4,432 Times in 4,397 Posts
    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.

  • #3
    New Coder
    Join Date
    Oct 2010
    Posts
    29
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    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!

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,986
    Thanks
    79
    Thanked 4,432 Times in 4,397 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •