database design - Can I Have FK in 2NF and 3NF in Relational Schema? -


so i'm normalizing invoice, wrong include fk *inv_num* in 2nf relational schema's. have.

the * shows pk

1nf (*inv_num, inv_date, c_id, c_name,c_str,c_state,part_num, part_desc, part_quanused, part_price, lbr_num, lbr_desc, lbr_price,tax_rate)

partial dependencies

  • (c_id--> c_name,c_name,c_str,c_state)
  • (part_num--> part_desc, part_quanused, part_price)
  • (lbr_num--> lbr_desc, lbr_price)

transitive dependencies

  • (c_state--> tax_rate)

2nf customer (*c_id, c_name,c_name,c_str,c_state)

2nf part (*part_num, part_desc, part_quanused, part_price)

2nf labor (*lbr_num, lbr_desc, lbr_price)

so i'm normalizing invoice, ...

actually no, not really.

invoices temporal nature, inv_date extremely important.

in other words,
fd not {c_state} -> {tax_rate}, {c_state, inv_date} -> {tax_rate}.

fd not {c_id} -> {c_state}, {c_id, inv_date} -> {c_state}.

fd not {part_num} -> {part_price}, {part_num, inv_date} -> {part_price}.

etc, ...

so options are

  1. leave (the invoice table) (seems ok)

  2. make temporal.


it common design invoices (also purchase orders ...) "capture , freeze" relevant info @ time.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -