Re: Design problem and suggestions...
From: Jeff Boyce (JeffBoyce_IF_at_msn.com-DISCARD_HYPHEN_TO_END)
Date: 02/14/05
- Next message: onedaywhen: "Re: relationship help"
- Previous message: Van T. Dinh: "Re: adding a reference to the table"
- In reply to: onedaywhen: "Re: Design problem and suggestions..."
- Next in thread: onedaywhen: "Re: Design problem and suggestions..."
- Reply: onedaywhen: "Re: Design problem and suggestions..."
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Feb 2005 04:34:40 -0800
A solution to the "person-as-customer-with-one-address" and
"person-as-employee-with-another-address" is to avoid connecting an address
directly to a person-type table.
A "context" table can hold person & role. An address table can hold
addresses. A "context-address" table would hold all the valid addresses (if
more than one) for any given "context". The "Address Type" (billing,
shipping, ...) could be included in this junction table.
This way, a person could show up multiple times in different contexts, and
each context could have multiple addresses.
Jeff Boyce
<Access MVP>
"onedaywhen" <jamiecollins@xsmail.com> wrote in message
news:1108371911.126800.21880@z14g2000cwz.googlegroups.com...
>
> Jeff Boyce wrote:
> > I suspect that the reason for considering that all those roles
> mentioned as
> > roles of persons is that any system would have to handle the
> exception. You
> > mentioned that it would be rare for an employee (?nurse) to also be a
> > patient.
> >
> > I disagree, and point out that it only takes one to break a system
> that
> > doesn't handle that. How many nurses (or administrators, or doctors,
> or
> > x-ray techs) have a primary physician, who they see for wellness, for
> their
> > blood pressure or diabetes, or following a skiing accident, or ...?
> >
>
> Say this healthcare data model encompassed medial trials which are
> inevitably conducted on animals (I wish it wasn't so). Our Persons
> table now becomes a Subspecies table with columns for subspecies_type
> ('Homo sapiens sapien'), species_type ('Homo sapien'), genus_type ...
> What, did I go too far?
>
> Let's take the simpler example of the database with Customers and
> Employees tables and assume all customers and employees are people
> (although in reality they could be other legal entities such as
> companies, which would require further subclassing tables).
>
> An employee is not normally barred from being a customer; in fact, the
> relationship is often encouraged via the offer of a staff discount. So
> there appears to be scope for a Persons table to hold the data common
> the both employee and customer.
>
> The example of their address has been suggested; both customer and
> employee entities are people and need to have an address. But let's
> look closer: a customer needs a billing address and a delivery address
> whereas the employee address needs to be a home address. So they are
> not exactly the same things. An employee's address is an attribute of
> the employee, therefore should normally be found in the employee table.
>
>
> What would you use to key the Persons table? Some countries impose a
> legal requirement to key employee data by social security number but
> this information is not usually captured for customers. You can't key
> your Persons table on customer_reference because an employee may choose
> not to become a customer. (Before responding, remember an autonumber is
> a tie-breaker, not a key in itself.)
>
> Let me come at this from a practical point of view. What is the
> advantage of modelling the few common entities in a base table? I think
> a column in the Customer table to flag an employee would suffice.
>
> However, as I said before, I find this interesting. I just I don't
> see any detail about how this would be implemented. So, using Northwind
> as an example, please post details of your proposed schema e.g. the new
> Persons table and any changes to the existing Employees and Customer
> tables.
>
> Jamie.
>
> --
>
- Next message: onedaywhen: "Re: relationship help"
- Previous message: Van T. Dinh: "Re: adding a reference to the table"
- In reply to: onedaywhen: "Re: Design problem and suggestions..."
- Next in thread: onedaywhen: "Re: Design problem and suggestions..."
- Reply: onedaywhen: "Re: Design problem and suggestions..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|