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  
Hi,

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

Quentin

-----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.?

Thanks.

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


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <mysql-thread64400@stripped>
To unsubscribe, e-mail
<mysql-unsubscribe-quentin.bennett=infinity.co.nz@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

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.
Thread
PK, SK, FK . . . ?John Halladay6 Feb
  • RE: PK, SK, FK . . . ?Cal Evans6 Feb
RE: PK, SK, FK . . . ?Quentin Bennett6 Feb