I understand that a primary key is a column that uniquely identifies every row in a database table. Therefore you can have only one primary key in your entity. However, in my textbook it an entity contains its own PK and another PK that is also a foreign key from the related entity. My question is if you are sharing a primary key then can you have more than one? If so, do the 2 primary keys form a one primary key? Or are they on their own individual identifiers for that entity.

For example, the PK of COURSE entity is also a foreign key and a PK of the CLASS entity. Also, CLASS entity now has 2 PKs.
I understand that a primary key is a column that uniquely identifies every row in a database table.
No, a primary key is a set of columns that, in combination, uniquely identify every row in a database table. A primary key of one column is just the simplest kind of primary key.
you can have only one primary key in your entity
Yes, but please avoid mixing conceptual model terminology (entities) with physical model terminology (columns and tables). Entities and tables aren't the same thing, relationships map to tables too.
in my textbook it an entity contains its own PK and another PK that is also a foreign key from the related entity
CLASS has a single composite PK, not two PKs. The combination of (CRS_CODE, CLASS_SECTION) identifies each row, but either column on its own may contain duplicate values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With