1.

Give a suitable example of a table with sample data and illustrate Primary and Candidate keys in it.

Answer»

A table may have more than one such attribute or a group of an attribute that identifies a row/ tuple uniquely, all such attribute(s) are known as Candidate keys. Out of the Candidate keys, one is selected as Primary key.

Table: Stock

IDItemQty
101Pen560
102Pencil780
104CD450
109Floopy700
105Eraser300
103Duster200

Id = Primary key Id and Qty = Candidates Keys



Discussion

No Comment Found