MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Quentin Bennett Date:February 6 2001 9:30pm
Subject:RE: PK, SK, FK . . . ?
View as plain text  

Do you mean that the table has two unique indices, or that the primary index
has two columns?

Either way, it is easy to define this in mysql:

create table foo (
col1 varchar(20) not null,
col2 int not null,
col3 smallint not null,
primary key(col1, col2),
unique second_idx(col1, col3));

Hope this helps


-----Original Message-----
From: John Halladay [mailto:John.halladay@stripped]
Sent: Wednesday, 7 February 2001 09:36
To: MySQL List (E-mail)
Subject: PK, SK, FK . . . ?

Terribly simple question, but I'm fairly new at this.

I'm building a database based off a model built in MS Access.  The table
that I'm currently working on appears to have two Primary Keys, although I'm
assuming one of them must be secondary.  How would I specify this in
creating the table in MySQL?  Would I need to create a composite key, etc.?


John Halladay
BISYS - Commission Accounting
Phone: 801.532.6660 x7973
Fax: 801.533.7879
Life   LTC   Annuities   Variable   Disability

Before posting, please check:   (the manual)           (the list archive)

To request this thread, e-mail <mysql-thread64400@stripped>
To unsubscribe, e-mail
Trouble unsubscribing? Try:

The information contained in this email is privileged and confidential
and intended for the addressee only. If you are not the intended 
recipient, you are asked to respect that confidentiality and not 
disclose, copy or make use of its contents. If received in error 
you are asked to destroy this email and contact the sender immediately. 
Your assistance is appreciated.
PK, SK, FK . . . ?John Halladay6 Feb
  • RE: PK, SK, FK . . . ?Cal Evans6 Feb
RE: PK, SK, FK . . . ?Quentin Bennett6 Feb