Home Forums Database Design Relational Theory A simple example which, after 15 years of relational design work, still breaks my brain - phone numbers RE: A simple example which, after 15 years of relational design work, still breaks my brain - phone numbers

  • I certainly agree that, if you can, store things such as phone numbers in a separate table if you're going to be storing multiple of them. You might well have an application that has options to store a client's Home, Mobile, Work, Fax, and Alternate contact number. It's unlikely you're going to be needing all of those for every client to start with, so some of those columns will be "wasted" space. Also, using a different table preserves Normal Form,

    On the subject of taxes, however, at least in the UK, I would rather store the price next to item, not at the transaction total. Not all items are taxable in the UK, so storing the value (before tax) and then the tax value makes more sense. Say, for example, you purchased a Book for £10.00 and a lamp at £20.00, the total tax would be £5.00. Without it being applied to the items you wouldn't know which item(s) it applied to. However, if I said that the Book was £10.00 with £0.00 Tax (as books are tax exempt), and the Lamp was £20.00 with £5.00 tax, this makes things easier.

    This is actually, really important in my line of work in insurance. Insurance can quite often be sold as "Co-insured". This means that several Insurers are insuring the same risk, however, each will be insuring a different percentage of it. So, for example, someone might have a High Value Household that they want insured, with a (rough) Sum Insured value of £25M. A single insurer may not be happy to insure the full risk, as a result Insurer A insures 60% of the risk (£15M), while Insurer B insures the remaining 40% (£10). The tax paid applicable needs to go to the applicable insurers, so that they can pay it. Doing to value at the full transaction wouldn't help, so the premiums would be split, with a separate value for the tax in the same line. 🙂 This becomes even more important if you start bringing in brokers and sub brokers; as you introduce Commission, which may be different for different insurers (depending on the agreement).

    I'm not saying that having Tax on a separate line is wrong, I just think that depends more on type of business and where you are in the world and how tax works there.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk