Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> General question about CHECK constraints.
Hi all,
This is a general db design question that I have been pondering for a while.
If you have a field that is going to have a definite known number of values in advance i.e.
Gender(M, F, U), it's better to use a check constraint than have a gender table obviously.
My question is at what point does it become "better" to have a foreign key and not use a check constraint.
Month(Jan, Feb... Dec)?
LettersInAlphabet(A, B, C....Z)?
CountryCodes(AU, AS.... ZM)?
DayOfYear(1,2,3.... 366)?
WordsInSmallDictionary(Aardvark,..... Zygote)? Say 5000 entries?
TIA. Paul...
-- plinehan __at__ yahoo __dot__ __com__ XP Pro, SP 2, Oracle, 9.2.0.1.0 (Enterprise Ed.) Interbase 6.0.1.0; When asking database related questions, please give other posters some clues, like operating system, version of db being used and DDL. The exact text and/or number of error messages is useful (!= "it didn't work!"). Thanks. Furthermore, as a courtesy to those who spend time analysing and attempting to help, please do not top post.Received on Wed Jun 21 2006 - 17:30:50 CDT