MySQL Forums
Forum List  »  Newbie

Do I need to convert 'Unique ID' to 'Primary Key'
Posted by: Tim Hutchinson
Date: October 03, 2017 01:44AM

Morning all,
I have a multi-table database - each table starts with an ID column - an integer set to Unique, not null, auto increment and this has been working fine as a key field and allows me to utilise foreign keys, identify specific rows for deletes, etc.

I was new to SQL when starting the project and I am now realising there is a difference between the method I used, and specifying a column as a Primary Key, although I am not 100% sure I understand the difference.

Do I need to alter my tables to specifically state that the first column is a 'Primary Key' and what benefits will I get?
Many thanks,
Tim

Options: ReplyQuote


Subject
Written By
Posted
Do I need to convert 'Unique ID' to 'Primary Key'
October 03, 2017 01:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.