Re: The fable of DEMETRIUS, CONSTRAINTICUS, and AUTOMATICUS

From: Tony Andrews <andrewst_at_onetel.com>
Date: 19 Oct 2004 11:52:50 -0700
Message-ID: <1098211970.528688.292470_at_f14g2000cwb.googlegroups.com>


Gene Wirchenko wrote:
> 1) You have no relationship between project and task. I assumed a
> 1:N relationship.

Yes, that was what I meant to put in.

> 2) The PK for emp_proj_assignment should include projno! I assumed
> that. If the
>
> I came up with:
>
> exists
> (
> select * from emp_proj_assignment as epa
> where
> timesheet_line.projno=epa.projno and
> timesheet_line.emp_no=epa.empno
> )
> and
> billable_flag=
> (
> select billable_flag from emp_proj_assignment as epa
> where
> timesheet_line.projno=epa.projno and
> timesheet_line.emp_no=epa.empno and
> ts_date between epa.start_date and epa.end_date
> )
>
> I assume short-circuit evaluation between the two subqueries.
> Depending on how that equality operator for billable_flag works, it
> might be possible to eliminate the first subquery.

Excellent. Now let's see how Kenneth does it using only uniqueness and foreign keys, and without the aid of a safety net ;-) Received on Tue Oct 19 2004 - 20:52:50 CEST

Original text of this message