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

Home -> Community -> Usenet -> comp.databases.theory -> Check Constraint vs. Foreign Key Constraint

Check Constraint vs. Foreign Key Constraint

From: J Lowry Snow <jsnow_at_cs.weber.edu>
Date: 6 Aug 2001 10:18:06 -0700
Message-ID: <be820bbe.0108060918.71f3c250@posting.google.com>

My question has to do with (1)which method is faster and (2)which method better adheres to good database design.

This is my dilemma. I can't decide which method is better. For example, in the Vendors table, I can have either 4 or 5 CHECK constraints or I can create 4 or 5 tables and use Foreign Key relationships to restrict data entry. Each vendor is either a "Manufacturer" or a "Distributor". For the field VendorType, would it be better to write a check constraint ensuring the type to be entered as "Manufacturer" or "Distributor" or should I create a new table called VendorTypes and add two columns, TypeID and TypeDescription, and check the field using a Foreign Key relationship?

What are your thoughts on the CHECK CONSTRAINT versus FOREIGN KEY entity relationship?

Thanks for any input.

J Lowry Snow Received on Mon Aug 06 2001 - 12:18:06 CDT

Original text of this message

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