Reputation: 493
I have a situation where I need to create a data model for 3 different shipping classes and the price for each category: 1st class (most expensive), 2nd class (second most expensive), 3rd class (least expensive) all depend on the total cost of the order. Each class of postage and its accompanying cost is different and based on the total order cost level (i.e. between two numbers 0-$10.00 and up). I am thinking this involves modeling 4 different tables and linking them together. Am I correct in my thinking about this or is there a simpler way to data model this?
How should I approach this?
Any help or directions to be pointed in is greatly appreciated!
Upvotes: 0
Views: 84
Reputation: 95053
You would probably have a class table:
class description 1ST 1st Class 2ND 2nd Class 3RD 3rd Class
the attributes of which would be used in the order table:
order_no class value etc 10000 2ND 13.00 ... 10010 3RD 57.00 ...
and a table to hold the fees:
class from_value fee 1ST 0.00 4.00 1ST 10.00 6.00 1ST 30.00 8.00 2ND 0.00 2.00 2ND 15.00 3.00 2ND 40.00 5.00 3RD 0.00 1.00 3RD 50.00 3.00
That should be it on first glance.
Upvotes: 1