normalization - Designing a SQL table with hierarchy/sub-categories -


I have a table that looks like this:

ID | Keywords | Category | Sub-category Sub-sub-category Sub-sub-sub-category

Is a keyword related to only one category, sub-category, let me split it into two tables (a table table with a keyword table and parent ID) Will happen. ..e.t.c. Which means that there is no repetition, does it still need to be divided?

You only have one table mapping 1-1. To represent 1 or several or several-mapping, you must use multiple tables.

If a keyword is consistent with only one category / sub-category / sub-sub-category, then your current layout should be fine.

A Warning: If you want to search by keyword, you can have performance advantages to separate tables, it is very fast to find an integer.

The discussion of storing the keyword values ​​in another table can be some of the important advantages of using a different table in the country's names (which are mostly static) in another table (spoken) Ease of language freedom, sharp search and easy to update later [/ P>


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -