I am getting trouble in designing and queries some tables.
I am supposed to design a table which contains the prices of the products as per no
and i designed such table as
suppose it may contain values like|id|product_id|qty_from|qty_to|price|
In above table for product with id=122 has following values for the given ranges1| 122 | 1 | 99 | 100 |
2| 122 | 100 | 199 | 80 |
3| 122 | 200 | + | 70 |
1 - 99 = $100
100 - 199 = $80
200+ = $70
I dont know whether such table is fit for such or not. and i feel some difficulty in querying.
Case1:
Suppose if i would like to know the price of the product with qty = 250 , how should i perform such query as it lies in the 200+ range ?
Thanks for the suggestions in advance.