• CELKO (8/29/2014)


    How about something like Coupon types? What would you use there? I am certainly not going to use the description of the type (PercentageDiscount, FreeShipping, BOGO, etc).

    A type is an attribute, measured on an enumeration scale. It is not an identifier, so it cannot be key.

    It seems to me reasonable to interpret Sean as referring to a column whose domain is a Coupon Descriptions (or Coupon Type Names if you would rather call them that) and it seems to me to require a considerable degree of unreasonableness to interpret him differently.

    I know that the SQL standard doesn't include such domains, but it is easy enough to define such a domain using a varchar type and a check constraint, or alternatively with an auxiliary table enumerating the values and having an interger (or tinyint, smallint, or bigint) surrogate key with the domain being represented in other tables by an integer column with a foreign key reference to the auxiliary table.

    Tom