Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: The fable of DEMETRIUS, CONSTRAINTICUS, and AUTOMATICUS

Re: The fable of DEMETRIUS, CONSTRAINTICUS, and AUTOMATICUS

From: Tony Andrews <andrewst_at_onetel.com>
Date: 19 Oct 2004 10:25:34 -0700
Message-ID: <1098206734.946916.176220@f14g2000cwb.googlegroups.com>


Kenneth Downs wrote:
> I have just made a post where I show how to handle all of Tony's
examples
> structurally. Can you think of any that are even tougher? I would
be
> happy for the exercise in finding the limits of my hypothesis.

How about this kind of real example from my memory of a timesheet system I once worked on.

create table emp (empno primary key, ...)

create table project (projno primary key, ...)

create table emp_proj_assignment (empno references emp, start_date, end_date, projno references project, billable_flag varchar2(1) check (billable_flag in ('Y','N') primary key (empno, start_date));

create table task (taskno primary key,
billable_flag varchar2(1) check (billable_flag in ('Y','N'));

create table timesheet_line
(empno references emp,
ts_date date,
taskno references task
hours, ...);

The complex rule is:
An employee may only book time (via a timesheet_line) to a task on a project to which the employee is assigned on ts_date, and where the billable_flag on the emp_proj_assignment matches that of the task. (The trouble with complex rule examples is they are so, well, complex!) Received on Tue Oct 19 2004 - 12:25:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US