Monday, March 19, 2012

Choosing the correct data types

In a typical "Order Item" table I need to store the selling price of
the item and the percentage discount applied. I'm thinking Numeric
for the price, and Float for the percentage.
Good design, or clueless?
Thanks
EdwardI would tend to opt for Numeric/Decimal for percentage as well. Why
introduce approximate numbers? Do you even need decimal places here?
(Typically discounts are 10%, 20% etc.)
<teddysnips@.hotmail.com> wrote in message
news:e4aa5937-58af-4be0-8db0-2b582c8fd7e3@.s36g2000prg.googlegroups.com...
> In a typical "Order Item" table I need to store the selling price of
> the item and the percentage discount applied. I'm thinking Numeric
> for the price, and Float for the percentage.
> Good design, or clueless?
> Thanks
> Edward|||those will work. You could also consider using the money datatype for the
price.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
<teddysnips@.hotmail.com> wrote in message
news:e4aa5937-58af-4be0-8db0-2b582c8fd7e3@.s36g2000prg.googlegroups.com...
> In a typical "Order Item" table I need to store the selling price of
> the item and the percentage discount applied. I'm thinking Numeric
> for the price, and Float for the percentage.
> Good design, or clueless?
> Thanks
> Edward

No comments:

Post a Comment