mysql - Database Design - Is redundancy better than adding more relationship? -


hi wonder 1 of these database designs better:

i have shopping db, has 2 tables: categories , brands. both of tables have columns: name, description, , image_url.

so okay keep duplicate column? or should create table stores information?

to visualize better, here's chart

the redundant one

| categories    |    | brands        |  | - name        |    | - name        | | - description |    | - description | | - image_url   |    | - image_url   | 

or adding new table?

| categories    |    | informations  |      | brands        |  |               |--->| - name        |<-----|               | | - info_id     |    | - description |      | - info_id     |                      | - image_url   | 

thanks

in case it's not same information. it's category_name, category_description, brand_name , brand_description.

creating table keep generic information many things bad idea.

when comes discussion (de)normalisation it's considered better design normalise data , start such design. data evolves , grows might necessary de-normalise tables data retrieval can faster @ cost of storage space , risk of loosing data consistency.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -