Results 1 to 2 of 2

Thread: Primary Key

  1. #1
    Join Date
    Jun 2012

    Unanswered: Primary Key

    Hi Everyone,
    I want to know difference between auto increament value which we can we as primary key ,and one which we have defined primary key .


  2. #2
    Join Date
    Sep 2009
    San Sebastian, Spain
    A primary key is any field or set of fields that uniquely identify a row where each field is not null. A primary key can either be an auto incremented value where a new incremented value is provided by MySQL if it is left NULL or can be populated during the INSERT statement or it can based on any field that will uniquely identify the record. Consider the following:

    A table employee where there is an employee id and a name. The employee id is the primary key. This can either be populated during the INSERT statement or if it is left NULL and the field is auto increment then MySQL will assign an incrementing number as a default.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    Follow me on Twitter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts