Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2012
    Posts
    2

    Two identical tables or a little used boolean

    I have many rows of shipping prices up to a variety of weights under different zones and services.
    For each zone and service there is also an additional row which adds on a price for every additional chunk of weight beyond the maximum.

    Now I could just put in a boolean that separates the functionality of the rows but I wasnt fond of this idea because the additional weights are very few in number and would be used very rarely. So there would be an additional bit of data for every row in the table rarely doing anything.

    The alternative would be to separate those functions out in to two identical tables, I have had a look at orthogonal database design but find it difficult to work out if this would violate it. I dont think it does because they differ in function enough to stop 'overlapping meaning'.

    So I am unsure which to go with and have come to ask which would be the better choice if there is one?

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    If there is only "an" (one) additional row for each zone and service, why are you using a separate record for the additional weight? It should be in the same record.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Aug 2012
    Posts
    2
    The additional weight gets selected out then multiplied up by however much weight the package goes over the maximum by.

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Seems to me the additional weight charge is a unary attribute of the zone and service fee. So it should be stored in the same table.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •