Does MySQL allow two primary keys on one table?
Posted
by Bharanikumar
on Stack Overflow
See other posts from Stack Overflow
or by Bharanikumar
Published on 2010-05-18T02:42:05Z
Indexed on
2010/05/18
4:10 UTC
Read the original article
Hit count: 195
CREATE TABLE Orders
-> (
-> ID SMALLINT UNSIGNED NOT NULL,
-> ModelID SMALLINT UNSIGNED NOT NULL,
-> Descrip VARCHAR(40),
-> PRIMARY KEY (ID, ModelID)
-> );
Basically, this appears to me to be creating two primary key on one table. Is that correct?
I thought that we could create a number of unique keys in one table, but only one primary key.
How is it that my system is allowing the creation of multiple primary keys?
Please advise: what are the rules governing this?
© Stack Overflow or respective owner