Take the 2-minute tour ×

I have a weak entity and it has an id as its primary key and also has another attribute (author_id) which has to refer to another entity's (Author's) primary key.

So my question is this: can a weak entity have a composite key (id, author_id)?

share|improve this question
What do you mean by "weak" entity?? –  marc_s Oct 15 '11 at 21:12
weak entity is an entity that requires another entity for its own existance. for example, we have an entity called author and another entity called paper. here paper is a weak entity because without authors papers can not exist. –  user997248 Oct 15 '11 at 21:17
@user997248, not quite. A "weak entity" is one whose primary key includes a key for another entity. This is a concept in ER modelling but it is of little or no significance in relational modelling and for that reason it is often ignored. –  sqlvogel Oct 16 '11 at 9:50
@sqlvogel Do you mean that one should convert weak entities to strong entities by adding a surrogate key to them instead? kinda like this ? Are there any real use cases where one should prefer a weak entity explicitly? –  Songo Jan 6 '13 at 23:49
add comment

1 Answer

If Id is a key then (Id, Authorid) can't possibly be a key in the same table. No key is ever a subset of another because keys by definition should be irreducibly unique.

The answer to your question is yes. A weak entity may have a composite key.

share|improve this answer
add comment

Your Answer


