Search code examples
database-designnormalizationthird-normal-form

Is the design on 3rd normal form?


I have a table that has an attribute category. E.g a table where I save songs which has an attribute Genre:

Songs(
ID (INT), 
Name (STRING), 
Genre: (STRING)
)

Is the table in 3rd normal form?

I mean I know it is better to save the Genrein another table and the have a relationship between tables like:

Songs(
ID (INT), 
Name (STRING), 
Genre_ID: (INT)
)

Genre(
ID (INT),
Name (String)
)

where Songs.Genre_ID = Genre.ID.

But I can not determine if the first case (with one table) does violate any rule of 3rd normal form!

Does it? If yes, which one?

Thanks, Mike


Solution

  • What are the keys? What dependencies is the table supposed to satisfy? Those are the things we need to know to answer your question.

    My guess is that ID is the only key and that ID->{Name,Genre} and that there are no other non-trivial, non-key dependencies. If that's correct then Songs is in 3NF. More importantly it is in BCNF and 5NF.

    Replacing the string attribute Genre with an integer Genre_ID has absolutely nothing to do with any normal form.