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

Home -> Community -> Usenet -> c.d.o.server -> constraint question

constraint question

From: eugene kim <eugene1977_at_hotmail.com>
Date: Sun, 08 Sep 2002 23:48:21 +0000
Message-ID: <alfu81$3vd$1@newsreader.mailgate.org>

hi..
i'm a beginner sql programmer..

if there's a better place to ask fundemantal sql questions like this.. pls inform me,,

my question is,

create table teams(

        team_id integer primary key,
        school_id integer references schools,
        sport varchar(100),
        gender char

);

if ( school_id, sport, gender) uniquely identifies a team entity just like team_id can uniquely do so.

is it better to have a constraint such as (school_id, sport, gender) unique
in my table?

well that will prevent users to insert duplicate data into table..

so i guess it's better to have the constraint instead of forcing application programmer to check the condition..?

thank you Received on Sun Sep 08 2002 - 18:48:21 CDT

Original text of this message

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