• quote:


    Mattias: my FK question really concerns a column on a table which is a foreign key in more than one instance. It may be a foreign key on it's own to table A and part of a combined FK to table B. Admittedly this is a slightly unusual situation, but how would the naming cope with this?


    Well, if it's a partial foreign key, that is, one of several columns that together form a foreign key, then each column would be named as the coresponding columns are named in the "mother" table.

    quote:


    (another such problematic 'exception' would be self-joins).


    In the case of a self-join, I add a descriptive text to the name, after the regular column name. If T0101_CONTACT has a reference to a "mother" and a "father", these columns would be named T0101_CONTACT_mother and T0101_CONTACT_father.

    This _is_ a problem, no doubt, but the problem isn't considerably smaller with any other method. The one reason it may be a slighly bigger problem using the strict conventions is that you really expect the column to have a specific name - but it doesn't, because that would cause several columns with the same name. Using no naming conventions, that particular problem doesn't occur, because you simply don't know what the name of the field would be, unless you looked it up.

    m

    Edited by - mattias on 12/21/2001 2:22:01 PM