database - denormalization tables to 1NF -


how can denormalize 1nf.

    --------------------------------------------------     |         |         |              |             |     |         v         v              v             v ----------------------------------------------------------- |post_id|post_title|post_text|post_submited_time|user_name| -----------------------------------------------------------       ------------------------------------------------     |            |                 |               |                |            v                 v               v            --------------------------------------------------------- |comment_id|comment_text|comment_submited_time|user_name| ---------------------------------------------------------     -----------    |         |    |         v -------------------- |post_id|comment_id| -------------------- 

i want 1 table in 1 normal form when normalize result tables.

it depends on database using, because there databases postgresql can have arrays or complex dataobjects datatype in columns. comes price: can not index nor organize data. might instance become difficult find out comments user has given on posts. if take @ own stackoverflow.com profile, see benefit of keeping information separated.

you can remove 1 table however. if create foreign key post_id in comments-table have 1 table less in design yet can make use of indices need.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -