Have multiple primary keys in a single table

composite-primary-keydatabasedatabase-designprimary-key

Can I have multiple primary keys in a single table?

Best Solution

A Table can have a Composite Primary Key which is a primary key made from two or more columns. For example:

CREATE TABLE userdata (
  userid INT,
  userdataid INT,
  info char(200),
  primary key (userid, userdataid)
);

Update: Here is a link with a more detailed description of composite primary keys.