Quantcast
Channel: Question and Answer » postgresql
Viewing all articles
Browse latest Browse all 1138

Different kinds of pricing PostgreSQL

$
0
0

I would like to hear your opinion about handling different kinds of pricing. We have a product table which looks almost like this:

+----+------+-----------+-----------+
| ID | Name | price_old | price_new |
+----+------+-----------+-----------+
| 1  | ball |   12.00   |   8.00    |
+----+------+-----------+-----------+

EDIT:

Now we would like to handle different kinds of pricing. Not only decimals (like in price_old and price_new), but also like “against any reasonable offer”. There is only one option, static price OR some kind of text. What do you think what’s best? Separate table for pricing, or extra columns. I think it’s not so smart to change price_old and price_new to varchar instead of decimal, so more kinds of pricing are available in one column… Cause it can cause trouble I guess.

Further we have different scenarios of availability of products on our site. A product can be available for 24 hours, or while stocks last. Guess it would be a good idea to have a separate table for this also? I always think it’s not a good idea to have different columns to choose from in one table, like if one column is empty use the other one. Not that flexible… But what do you guys think?


Viewing all articles
Browse latest Browse all 1138

Latest Images

Trending Articles



Latest Images