|
Posted by Steve Jorgensen on 10/13/05 04:26
On Tue, 11 Oct 2005 20:03:49 GMT, "Tom" <nospam@yahoo.com> wrote:
>Hi,
>
>Is there a reason for using one and only one column as the key?
>I find it hard to enforce the integrity of the database with this design.
>
>for example,
>let's say the [company]-[employee]-[sale] tables.
>company A has an employee B.
>employee B makes a sale C.
>
>If employee B moves to another company, the sale C in the [sale] table will
>move along with employee B to the new company.
>This doesn't look correct to me.
How does this problem relate to the use of logical vs surrogate keys? The
real, problem is that this model does not track what company the sale is made
for, and traversing the employee doesn't tell what company that is, it tells
what company the employee who made the sale -currently- works for. [sale]
needs its own direct link to [company] if that information needs to be
retrieved later.
Navigation:
[Reply to this message]
|