Keys

Posted By on October 3, 2014


Download PDF
Database Scheme
Query Languages

Keys

  1. The notions of superkey, candidate key and primary key all apply to the relational model.
  2. For example, in Branch-scheme,
    • {bname} is a superkey.
    • {bname, bcity} is a superkey.
    • {bname, bcity} is not a candidate key, as the superkey {bname} is contained in it.
    • {bname} is a candidate key.
    • {bcity} is not a superkey, as branches may be in the same city.
    • We will use {bname} as our primary key.
  3. The primary key for Customer-scheme is {cname}.
  4. More formally, if we say that a subset of is a superkey for , we are restricting consideration to relations in which no two distinct tuples have the same values on all attributes in . In other words,
    • If and are in , and
    • ,
    • then .

 

Database Scheme
Query Languages

Download PDF

Posted by Akash Kurup

Founder and C.E.O, World4Engineers Educationist and Entrepreneur by passion. Orator and blogger by hobby

Website: http://world4engineers.com