Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> constraint question
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