Modeling Categories and sub-categories

2

I am modeling an e-commerce related database and am having a question in modeling product category and subcategory tables.

At first I created two tables one of Categoria and another of Subcategoria . However, I found a article where the author says do not need to create two tables . What it basically does is in the same table include the category code in the record that will be a subcategory.

What are the advantages of making a template with two tables or one as mentioned in the article?

    
asked by anonymous 20.08.2016 / 18:14

1 answer

2

Required is not. The difference is between the normalization of data and the Delormalization of the data. / p>

Standardization aims to avoid redundancy of information and give data more consistency.

But denormalization aims at better performance (since, in some situations, high normalization can cause high performance costs).

To choose between one or the other, or even to use a little of each, depends on each project (including quantity of records, available hardware, number of users, etc.).

Recommendation from a large professional in the database area:

  

"Normalize to pain, denormalize until it works!"

     

Jason Couchman, author of the book: "Oracle 8 Certified Professional DBA Certification Exam Guide"

There are several articles on the internet on the subject!

    
20.08.2016 / 19:53