Ticker

6/recent/ticker-posts

Keys in Database model(DBMS)

 KEYS:-

     

key is defined as a single attributes or combination of two or more attributes which is used to identify one or more instances of 
the set.


Types of keys:--


Primary key:----Primary key is a key which is used for uniquely identify records in the table.It is the first key which is used to identify  only one instance of an entity uniquely.
Primary key cannot contain NULL value .


super key:--super key is the single or multiple attributes in the table used for identification .Super key is a set of an attribute which can uniquely identify a tuple. Super key is a superset of a candidate key.


Candidate key:--candidate key is also a super key having no repeated attributes and set of attributes that uniquely identify row in the table. The candidate keys are as strong as the primary key. IN order to select the candidate keys from the set of super key, we need to look at the super key set.


Foreign keys:--Foreign key are the column of the table ,used to point  the primary key of another table. Basically foreign key is used for link two tables.


It means the columns of one table points to the primary key attribute of the other table. It further means that if any attribute is set as a primary key attribute will work in another table as a foreign key attribute ,
Used for creating and maintaining the relationship between the two relations.    



Post a Comment

1 Comments

Drop your comment here....