Subject Re: [firebird-support] Is correct to have a unique key restriction for names?
Author Mark Rotteveel
On Mon, 15 Aug 2011 00:03:28 -0300, Alexandre Benson Smith
<iblist@...> wrote:
> Em 14/8/2011 23:43, W O escreveu:
>> Hello everybody
>> I had unique key restrictions on the column "Name" of tables like:
>> Countries, States, Banks, etc.

Not sure if it is wise to do that; it really depends on the business rules.

A politically controversial example: two countries claim to be China (where
at least one denies the existence/independence of the other).
In The Netherlands and Belgium we both have a province called 'Limburg'.
Different banks in different countries can have the same name (for example
in the last century both The Netherlands and Germany had a
'Rafeissenbank'); or the branches of a single bank in different countries
are actually two distinct legal entities and need to be recorded as such;
there are cooperative banks where each bank is independent, but they do
share the same name (and some of the marketing and backoffice stuff).

On the other hand, not enforcing some type of rules could mean actual
duplicated data.

>> So, I can avoid duplicates.
>> What do you think, is it correct to use unique keys for that job?
>> Greetings.
>> Walter.
> It depends on the business rules...
> I don't think that a unique constraint on the Field Name of a table of
> people is ok.
> We al lknow that there is more than one John Smith in the world.

Agreed. It can lead to some nice problems if you would enforce that.