Design Sixth Normal Form

I have the following tables:

Blogs { BlogName } BlogPosts { BlogName, PostTitle } 

Blog entries are simulations of essence and relationships at the same time, which is incorrect according to 6nf (according to the third manifest).

In 6nf it will be:

 Blogs { BlogName } Posts { PostTitle } BlogPosts { BlogName, PostTitle} 

If I wanted to order blog entries in nbr order (just an example), this would be a different table

 BlogPostsSorting { BlogName, PostTitle , SortOrder } 

Do I have it right?

+6
source share
2 answers

sqlvogel is correct in this answer .

With the exception of this small detail: whether blogs are redundant or not, it depends on whether you want / need to force the restriction that all blog tuples must have at least one corresponding BlogPost tuple. You have not indicated anything to make this clear.

The same applies to your third relvar posts, except that in this case it is unlikely that it could be valid for PostTitle to exist without it appearing as the name of at least one BlogPost.

If you need a SortingOrder repository as an extra depends on whether there can be BlogPosts that do not require sort order. If this cannot be the case, then your SortingOrder relvar will simply replace BlogPost. If possible, then you may have two reverses; or, alternatively, you can still have SortingOrder reverse and hack your way through the case of messages without ordering using a dummy value (for example, always -1).

+4
source

What are the keys of your tables? Based on the column names, I assume that only {BlogName, PostTitle} can be the BlogPosts key. In this case, BlogPosts is already in 6NF - it does not have nonprime attributes and therefore cannot be decomposed. The relvar and relvar blogs will be redundant - you don't need them.

Blog posts are a simulation of an entity and a relationship at the same time that is invalid according to 6nf (according to the third manifest)

Can you tell me where, in your opinion, the third manifesto says this is not valid. I am sure that this is not so, but I would like to know how you came to this conclusion.

+6
source

Source: https://habr.com/ru/post/897984/


All Articles