oh i see =)
but is it only the difference? i mean, what are their specific purposes?
primary key is primarily for what?
and unique key is basically for what?
im a newbie in database programming.. =)
thanks snif...
i appreciate your help.. =)
Well.. A primary key is something that is used for indexing the rows of a database. Naturally, it has to be unique. But, I guess you could have unique keys that are not necessarily primary keys. The uniqueness of the column could be a constraint of the database for example.
A person Social Insurance Number and Drivers License Number can be two unique keys that "must" be enforced at all times. But, only one of them needs to be selected as a primary key. If you don't want to, then you can introduce a surrogate key that is auto-generated by the databse system everytime you create a new row.