| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: The fable of DEMETRIUS, CONSTRAINTICUS, and AUTOMATICUS
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 - 13:52:50 CDT
![]() |
![]() |