• goodguy (5/22/2010)


    In the real world, physical cash-sale receipts show details of products purchased, thus solving the need to refer to an underlying invoice. In RDBMS, this is not easy to implement, as it causes redundancy.

    Let me break the news for you 🙂 it is easy to implement and causes no redundancy at all 😉

    Do not confuse what you see printed in a piece of paper with the underlying data model. A proper ER model would include what finally will be implement as a ReceiptTable (1 row per receipt), a InvoiceTable (1 row per invoice) and a ProductSoldTable (1 row per product sold per transaction).

    Would you like to work on the relationships?

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.