C
CS
I am building a database that will have:
tblCustomers (PK CustID)
tblPets (PK PetID 2ndKey CustID -- many pets may be owned by each customer)
tblVisits (PK VisitID 2nd Key CustID -- each customer may have many visits,
and each visit may involve many pets)
tblVisitDetails (PK DetailID 2nd Key Pet ID -- each Visit may have many
treatments/medications, details will each involve one pet and the
treatment/medication administered)
tblTreatments (PK TreatCode, price of treatment, description)
tblMedications (PK MedCode, price of medication/dos, description)
Because prices of medication and treatments change over time, and I don't
want these changes to update old invoices, I have created an append query to
create and add to tblInvoiceArchive -- this has an indexed field on DetailID
from tblVisitDetails, so that only unduplicated detail records are appended
to this table.
This does result in duplicated data in my db -- I am wondering if this is
considered an occasion where breaking the usual normalization rules is
correct?
Can I reduce duplication of the data, yet still retain the important
information for the invoices, such as calculations based on current prices,
by including all the fields that I need for a report or form (CustName,
Address, Pet Name,TreatmentDescriptions, etc.) in the query, but only having
certain key fields that append to the Invoice Archive table (such as
including only CustID, PetID, VisitID, and any fields calculated based on
the current price in the tblInvoiceArchive)?
Thanks in advance for any advice,
CS
tblCustomers (PK CustID)
tblPets (PK PetID 2ndKey CustID -- many pets may be owned by each customer)
tblVisits (PK VisitID 2nd Key CustID -- each customer may have many visits,
and each visit may involve many pets)
tblVisitDetails (PK DetailID 2nd Key Pet ID -- each Visit may have many
treatments/medications, details will each involve one pet and the
treatment/medication administered)
tblTreatments (PK TreatCode, price of treatment, description)
tblMedications (PK MedCode, price of medication/dos, description)
Because prices of medication and treatments change over time, and I don't
want these changes to update old invoices, I have created an append query to
create and add to tblInvoiceArchive -- this has an indexed field on DetailID
from tblVisitDetails, so that only unduplicated detail records are appended
to this table.
This does result in duplicated data in my db -- I am wondering if this is
considered an occasion where breaking the usual normalization rules is
correct?
Can I reduce duplication of the data, yet still retain the important
information for the invoices, such as calculations based on current prices,
by including all the fields that I need for a report or form (CustName,
Address, Pet Name,TreatmentDescriptions, etc.) in the query, but only having
certain key fields that append to the Invoice Archive table (such as
including only CustID, PetID, VisitID, and any fields calculated based on
the current price in the tblInvoiceArchive)?
Thanks in advance for any advice,
CS