Keys
 
 
 
  
  
   
 Next:  Query Languages
Up:  Structure of Relational 
 Previous:  Database Scheme
 
 
- 
The notions of superkey, candidate key and primary key
all apply to the relational model.
 
- 
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.
 
- 
The primary key for Customer-scheme is {cname}.
 
- 
More formally, if we say that a subset  of of is a superkey for is a superkey for , we are restricting consideration to relations , we are restricting consideration to relations in which no
two distinct tuples have the same values on all attributes in in which no
two distinct tuples have the same values on all attributes in .
In other words, .
In other words,		        	-  If  and and are in are in , and , and
-   , ,
-  then  . .
 
 
Page created and maintained by Osmar R. Zaï ane
Last Update: 
Wed Sep 20 15:45:57 PDT 1995