Last answered:

07 Dec 2022

Posted on:

05 Dec 2022

0

WHY DOES A PRIMARY KEY HAVE DUPLICATE VALUES

Hi,

So I decided to try grouping by result by salary and not emp_no but I got a result showing me duplicate values for the emp_no I remember that PK are not supposed to have duplicate values in a column, so I am wondering why this is different.

Thanks

image.png

1 answers ( 0 marked as helpful)
Instructor
Posted on:

07 Dec 2022

0

Hi Oyindamola!
Thanks for reaching out!

In this case we have a composite primary key - it consists of more than 1 column. So, the idea is that the combination of columns should be unique, but some of the columns can have duplicates. I attach a
screenshot.
image

Hope this helps.
Best,
Tsvetelin

Submit an answer