List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:December 29 2004 10:33am
Subject:Re: unique key <-> primary key
View as plain text  
Hello,

> RE:
> > And columns in primary keys must be NOT NULL.  Columns in unique
> > keys can be NULL (if they are NOT NULL, then the unique key is
> > functionally the same as a primary key).
>
> OK, thanks guys for the explanation.
>
> Then the result of mysqldump table definition part:
>
> UNIQUE KEY HONstid (HONstid,HONname)
>
> means that I have two unique keys:
> HONstid
> and also the
> (HONstid,HONname) combination?

No, as far as I can tell, this means you have a unique constraint
named "HONstid" for columns HONstid,HONname

> This does not make too much sense; if I can have only one HONstid in my
> table, then of course i can have only one kind of (HONstid,HONname)
> combination. In the actual table, I have multiple occurences of values
> (HONstid,HONname)in the HONstid column, i.e. it does not seem like
> HONstid in itself was a unique key. Only the (HONstid,HONname)
> combination is unique.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com

Thread
unique key <-> primary keyGaspar Bakos28 Dec
  • Re: unique key <-> primary keyMartijn Tonies28 Dec
    • Re: unique key <-> primary keyPaul DuBois28 Dec
      • Re: unique key <-> primary keyGaspar Bakos28 Dec
  • Re: unique key <-> primary keyMartijn Tonies29 Dec
  • Re: unique key <-> primary keyMartijn Tonies29 Dec