1

Im new to databases and I'm struggling to get my head around third normal form (3NF). I have been given a csv file where each record has fields song, album, artist and numerous tags. I have put the data in a database and want to know if it's in 3NF. The headings of the tables I have inserted the data into are below:

  1. | Track_Id | Track_Name | Track_Artist | Track_Album |

  2. | Tag_Id | Tag_Name |

  3. | Track_Id | Tag_Id |

I believe the candidate keys in the first table are Track_Id and the combination of {Track_Name, Track_Artist, Track_Album}.

I know alternatively I could have a separate song table with a foreign key pointing to an album table which in turn has a foreign key making a reference to an artist table, but is this necessary?

closed as off-topic by mustaccio, LowlyDBA, James Jenkins, John Eisbrener, McNets Oct 21 at 19:13

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – mustaccio, LowlyDBA, James Jenkins, John Eisbrener, McNets
If this question can be reworded to fit the rules in the help center, please edit the question.

  • "But is this necessary?" is not a question that can be easily answered. You are talking about scope of the code not the coding of the solution. – RLF Feb 23 '17 at 18:41
0

If Track_Id and (Track_Name, Track_Artist, Track_Album) are candidate keys, with no other partial or transitive dependencies, then the table is in 3NF. Think about this - can Track_Name determine Track_Album or Track_Artist, or can Track_Album determine Track_Artist? If not, it's in 3NF.

If the other two tables have candidate keys, they'll be in 3NF.

Not the answer you're looking for? Browse other questions tagged or ask your own question.