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

Home -> Community -> Usenet -> c.d.o.misc -> Integrity constraint with jointure

Integrity constraint with jointure

From: Vincent Lascaux <lascaux_cash_at_hotmail.com>
Date: 26 Oct 2004 08:26:55 -0700
Message-ID: <b82fb8aa.0410260726.6c6bc01e@posting.google.com>


Hello,

I would like to add an integrity constraint on one of my tables, but it looks like I need to create a join for that. I would like to have any feed back on how to do it, or why the design is bad, and how to change to a better one...

create table Teams (
 KeyTeam number primary key
);

create table Paths (
 NickName varchar(100) not null,
 KeyTeam references Teams not null,
 Path varchar(500),
 constraint primary key (NickName, KeyTeam)
);

create table Users (
 KeyUser number primary key,
 KeyTeam references Teams not null
);

create table Tasks (
 KeyUser references Users not null,
 NickNameOfPath varchar(100)
);

The Tasks table references the Paths table, but the foreign key is the team of the user, not the user. So I dont know how to define this relation...

Thank you

-- 
Vincent
Received on Tue Oct 26 2004 - 10:26:55 CDT

Original text of this message

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