Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: composite key and further logical constraint
On Thu, 18 Sep 2003 17:46:32 GMT, "Canny" <carolyn.derrick_at_gnb.ca>
wrote:
>Using Oracle version 9.2
>
>create table mytable
>(busid number(4) ,
> corpid varchar2(30),
> corptype number(4),
> CONSTRAINT mytable_pk PRIMARY KEY (busid, corpid)
> )
>
>How can we ensure that for each busid there is only one corpid with
>corptype=1? It is ok for a busid to have many cases of corpid of corptype 2
>or corptype 3.
It sounds a lot like you're trying to shoehorn two different kinds of facts into one table. That's generally not a good idea.
In simple English, what are you really trying to model?
-- Mike Sherrill Information Management SystemsReceived on Fri Sep 19 2003 - 09:27:10 CDT
![]() |
![]() |