Please explain the Primary Key to me (Table Relations and Normalization)

Screen Link:
https://app.dataquest.io/m/192/table-relations-and-normalization/5/inserting-and-deleting-rows

As the previous screen has described, the wishlist_track table has two primary keys (compound primary key). As far as I know, Primary Key could not have duplicate values, however, as you can see, the wishlist_id has multiple “1” and “2” values.
So, can someone explain this to me?

wishlist_id	track_id
1	1158
1	2646
1	1990
2	3272
2	3470
1 Like

Yes this is TRUE.

In this case We have a Compound Primary Key ( When two or more columns combine to form a primary key it is called a compound primary key.), therefore the combination of the 2 fields will be the primary key 1 1158 is different from 1 2646, they have same wishlist_id but you notice the track_id is differing.

3 Likes