Hi, I need some help regarding on my created table...I already created table in my database with 5 columns but i forgot to put PK on my table and i want to have 3 PK on my table is this possible in one table with 3 PK,if it is possible can you please help me how to put PK on my table.
Thank you in advance.
You can have only one PK on a table, but you can define more unique indexes on the same table.
So you would have one PK and two unique indexes.
Just to be complete: you can also have a PK on three columns.
Read this page of the manual to see how you can add the PK/indexes to an existing table: http://dev.mysql.com/doc/refman/5.5/en/alter-table.html
To be a bit more precise, a primary key, is the same as a unique key but the columns must also be marked as NOT NULL.
This topic is now closed. New replies are no longer allowed.