hi all,
in studying database design and replies to my posts, it appears that most designs use date_from and date_to fields to determine whether a record is current of archive.
My database design accommodates customer and address record archiving. Meaning that work orders point to customer/address records that where current at the time the work order was created but may not be current now, due to some customer data change, thus insuring archival integrity between the work orders and customer/addresses they are attached to. However, i rely on the last customer_address table record to be the current customer record as apposed to using date_from and date_to fields to determine which customer_address table record is the current record.
To maintain workorder/customer archival integrity, a typical schema has three tables to handle the many to many relationship between the customer and address tables and provide for archival integrity:
1. the customer table
- customer id
- first name
- last name
- phone
- email address
2. the address table
- address id
- street
- city
- state id
- zipcode
3. the customer_address table
- customer id
- address id
-
date_from -
date_to - address type code
My questions are:
1. What is the advantage of using the date_from and date_to concept over relying on the last record in the customer_address table to determine a current customer & address table records?
2. Why does the customer_orders table customer_id point to the customers table as apposed to the customer_address table?
3. Wouldn't the customer_orders table customer_id pointing to the customer_address table accomplish the same goal of the customer_orders record pointing to the current customer_address record at the time the customer order was created?
Your advise is appreciated.