Subject | Re: [firebird-support] Is correct to have a unique key restriction for names? |
---|---|
Author | W O |
Post date | 2011-08-15T16:53:17Z |
Lester and Mark, thank you for your answers.
I have a Primary Key on the ID column of those tables and a Unique Key on
the Name column.
I want to avoid duplicates forcing the names being different. If a user want
to save a duplicate name then he/she will have a a message of advice. So,
he/she will take the appropiate means.
Greetings.
Walter.
I have a Primary Key on the ID column of those tables and a Unique Key on
the Name column.
I want to avoid duplicates forcing the names being different. If a user want
to save a duplicate name then he/she will have a a message of advice. So,
he/she will take the appropiate means.
Greetings.
Walter.
On Mon, Aug 15, 2011 at 4:06 AM, Mark Rotteveel <mark@...>wrote:
> **
>
>
> 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.
>
>
>
[Non-text portions of this message have been removed]