HomePagev2 Forums SQL Discussions what is a primary key ?

Tagged: 

  • what is a primary key ?

  • Sai Chaitanya Kumbhari Chaitanya Kumbhari

    Member
    September 12, 2020 at 2:26 pm

    why one primary key is allowed for a  table ?

    what happens if we have multiple primary keys in a given table ?

     

    thank you

  • Gnana Divya

    Member
    September 12, 2020 at 3:11 pm

    Primary key must be one or none for a table, because its value is unique for each record

    It is used to connect to different tables because of unique values, name itself says that it is the 1st priority (so one for a table)

    It is like head of family, which is used to identify every tuple uniquely

  • Sai Chaitanya Kumbhari Chaitanya Kumbhari

    Member
    September 12, 2020 at 5:07 pm

    thank you its clear now

  • Badri Rajasekhar Reddy Rajasekhar Reddy

    Member
    September 12, 2020 at 5:40 pm

    Primary Key means that it’s ranked first in importance. Therefore, There can only be one key. We just take one practical example,like student table having values (Id, Name) here you have taken Id and Name as Primary Key then for every Id there is a unique name but in practice in a class may be having same names but different Id at that time there will be a problem to store that value uniquely. That’s why we need only one Primary Key in table to uniquely identify the single rows.

     

Log in to reply.

Original Post
0 of 0 posts June 2018
Now