I don’t think the database is well designed, but I know the database design is not from you. ;-)
I can understand why there are three tables, and I actually agree that’s a must, if you want to make the price-product info fully normalized.
But the data in price-type table should be only used for two purposes:
- As a data integration reference, we can use it to check and make sure all price-id’s in all other tables are valid, i.e. there is row in this table for that price-id.
- Store the visual presentation for each price-id, for example, if you want to print some report, instead of showing the less meaningful price-id, you may want to show the price type.
But to use price-type as part of unique keys elsewhere is a bad idea. Only price-id should be used for that purpose.
In the product-price table, instead of storing price-type, should storing price-id, and form unique index together with product-id.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.