foreign key, or "in" constraint?

From: <>
Date: Mon, 06 Oct 2008 20:39:17 GMT
Message-ID: <VHuGk.2205$>

Suppose you have a table with a status column, and the status can be one of "queued", "inprogress", "failed", or "completed".

This can be enforced two ways:

  1. status has a FK to a "statuses" table, and the allowed statuses are in that table.
  2. with a constraint such as status in ('queued','ip','failed','completed')

Which is more typically used? What are the pros and cons, tradeoffs, etc, of each?

Many TIA!

Mark Harrison
Pixar Animation Studios
Received on Mon Oct 06 2008 - 15:39:17 CDT

Original text of this message