0
Can't we have two primary keys in a table?
4 Respuestas
+ 3
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)
);
Source: https://stackoverflow.com/questions/217945/can-i-have-multiple-primary-keys-in-a-single-table?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
+ 2
Primary keys are meant for making each row(or record) of data unique. Having two primary key is useless since one is enough to find data. If you don't have a single primary key you can use multiple fields as combined primary key for identifying a group(row) of data.
+ 2
thank you guys