What Is Key And Types Of Key Explain, Explain Key In DBMS, Describe Candidate Key, Alternate Key, Primary Key, Super Key In DBMS With Examples

Key is used to identify every entity in the entity set.
Types Of Key:
Candidate Key
Alternate & Primary key
Superkey
Candidate Key
It is the minimal set of attributes that uniquely identifies any entity in entity set.
There can be more than one candidate keys in entity set.
More than one attribute can together form a single candidate key.
Suppose that a combination of customer-name and customer-street is sufficient to distinguish among members of the customer entity set.
Then, both {customer-id} and {customer-name, customer-street} are candidate keys.
Although the attributes customer-id and customer-name together can distinguish customer entities, their combination does not form a candidate key, since the attribute customer-id alone is a candidate key.
Alternate & Primary key
Alternate & Primary key is related with candidate key.
In entity set, primary key is a candidate key but only one key is the primary key & the left candidate keys are called alternate key.
AK=CK-PK
Superkey
A superkey is the superset of any candidate key.
For example, the customer-id attribute of the entity set customer is sufficient to distinguish one customer entity from another.
Thus, customer-id is a superkey.
Similarly, the combination of customer-name and customer-id is a superkey for the entity set customer.
The customer-name attribute of customer is not a superkey, because several people might have the same name.
Example: {customer-id}, {customer-name, customer-id}

0 comments:
Post a Comment
Thanks For Your Comment. We Get Back To You As Soon As Possible.