2

I am a bit confused with the partial keys. 'Database System Concepts by Korth' says the following:

Although the weak entity set does not have a primary key, we nevertheless need a means of distinguishing among all those entities in the weak entity set that depend on one particular strong entity. The discriminator of a weak entity set is a set of attributes that allows this distinction to be made. The discriminator of a weak entity set is also called the partial key of the entity set.

My confusion is that if the discriminator/partial keys of weak entities are able to uniquely identify the set of attributes, then it should be called primary key, instead of partial keys, as primary keys are those which can uniquely identify all the attributes of a relation.

Also, while surfing the web, I came across a definition of partial key, which says:

'A partial key is a key using which all the records of the table can not be identified uniquely'

It raises a question in my mind, that suppose if a table consists of a primary key which is made up of two or more attributes, then if we pick up a single attribute from this, then will it be called partial key, as that attribute is part of a primary key, but by itself it can't uniquely identify all attributes in a relation.

Raju
  • 137
  • 1
  • 4
  • 11
  • What does "identify the set of attributes" mean? The discriminator *is* a set of attributes. It identifies a (weak) entity (given a strong entity). PS Please use text, not images/links, for text. Image textual content cannot be searched for or cut & pasted. – philipxy Feb 15 '19 at 22:22
  • Are you trying to say you are interested in the case where a discriminator happens to be unique across all rows? Because you don't make this clear. – philipxy Feb 15 '19 at 22:28
  • I got confused in the language of the book, I interpreted it as, Discriminators are a set of attributes that are able to uniquely identify the the weak entity set. My thought was that if discriminators solely are able to uniquely identify the whole set then what's the difference between them and primary key. – Raju Feb 16 '19 at 17:01

2 Answers2

2

The definition doesn't say that "the discriminator/partial keys of weak entities are able to uniquely identify" within a table. It says that one identifies a weak entity within a particular strong entity.

Technical terms only mean what they are defined to mean in a certain context of assumptions, including other definitions. You can't expect the same term to mean the same thing everywhere. You can't just look at the text of a definition & make assumptions about what situations it applies to & what its technical terms mean or even whether a word is used in a technical or everyday meaning. When someone uses a term you have to make sure that you know what they mean by it.

A relational superkey uniquely identifies a row. A CK (candidate key) is a superkey that contains no smaller superkey. A PK (primary key) is just some CK you decided to call the PK.) So being unique is not a reason to call something a PK or CK. (An SQL PK/UNIQUE is analogous to a relational superkey.)

The book method generates discriminators that are not superkeys. So we can say that it agrees with the web definition--for cases that come up in that method. But if a method allowed generation of discriminators that were CKs or PKs then its use of that textbook wording would define "partial key" to be a different sort of thing than the web definition. Such a method couldn't use (relational) "PK" for a strong id plus discriminator, because it would be a superkey but not a CK or PK. (But it could still use SQL "PK" since that approximately means primary superkey.)

philipxy
  • 14,867
  • 6
  • 39
  • 83
  • Got a bit confused with the language of the book. Now, I am clear, discriminators are a set of attributes from the weak entity set, which when combined with the primary key of the strong entity set, act as a primary key for the whole weak entity set. The line told by you that, discriminators generated are not the super-keys, absolutely makes sense. Thanks for helping. – Raju Feb 16 '19 at 17:13
1

I really think this type of descriptions stems from the very first step in any modelling process, and one which anyone with any data modelling experience would just fix without even thinking about it.

The wiki page on "Weak Entity" gives the classic example of a Header/Detail pair, where the detail by itself doesn't have a reference to the header. Think of a two page document where page one is the header, page two is the details.

By itself, page two can not uniquely identify a row, but of course anyone would automatically add the header FK so we can uniquely identify a row.

Haven't seen the book you are reading, but I think that's what its getting at. So I think all your subsequent reasoning is correct. Have a look at the wiki page for more info.

TomC
  • 2,759
  • 1
  • 7
  • 16