Re: Database Design - Relationsships

From: Lennart Jonsson <lennart_at_kommunicera.umea.se>
Date: 20 Sep 2002 11:49:11 -0700
Message-ID: <6dae7e65.0209201049.26db6439_at_posting.google.com>


patrike_at_tigerline.com (Patrik) wrote in message news:<1b8a7ffa.0209192204.224fc758_at_posting.google.com>...
> *Primary Key
>
> TimeLog Customers Projects
> --------- -------- -----
> *TimeLogID *CustomerID *ProjectID
> CustomerID ProjectNo
> ProjectID CustomerID
>
> You can enter a record in the timelog table without having a project
> e.g. an employee may do a job for a customer that does not have any
> project numbers.
>
> I want to make sure if the user picks a project it is a project that
> has the same customerid as the entered customerid in other words: a
> Time log entry should not be able to have one customerid and a project
> with another customerid. I know how to prevent this in the GUI but I
> want to prevent it in the database design.
>
> How should these tables be structured?
>
> /Patrik

One way is to remove customerid from timelog, and instead have a "no particular project' entry for each customer in the projects table.

just a thought
/Lennart Received on Fri Sep 20 2002 - 20:49:11 CEST

Original text of this message