0% found this document useful (0 votes)
224 views7 pages

Candidate Key Is A Minimal Super Key, Which Contains No Extra Attributes. It Is Also Called Subset of Super Key. Sid Reg - No E-Mail

The document defines and provides examples of key database concepts: - Candidate key is a minimal super key that uniquely identifies records and can include attributes like SID, Reg_No, and Email. - Primary key uniquely identifies each record, can have only one per table, and cannot contain NULL values like Reg_No. - Foreign key is an attribute in one table that is the primary key in another table, can contain NULL values, and there can be multiple like the Roll No. - Alternate key are candidate keys that are not selected as the primary key, like SID and Email if Reg_No is the primary key.

Uploaded by

ram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
224 views7 pages

Candidate Key Is A Minimal Super Key, Which Contains No Extra Attributes. It Is Also Called Subset of Super Key. Sid Reg - No E-Mail

The document defines and provides examples of key database concepts: - Candidate key is a minimal super key that uniquely identifies records and can include attributes like SID, Reg_No, and Email. - Primary key uniquely identifies each record, can have only one per table, and cannot contain NULL values like Reg_No. - Foreign key is an attribute in one table that is the primary key in another table, can contain NULL values, and there can be multiple like the Roll No. - Alternate key are candidate keys that are not selected as the primary key, like SID and Email if Reg_No is the primary key.

Uploaded by

ram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

2.

Candidate Key:
Candidate key is a minimal super key, which contains no
extra attributes. It is also called subset of super key.
Example: In the above table:
 SID
 Reg_No
 E-mail
3. Primary Key:
 Primary key is an attribute, which is uniquely
identifies each record with in a table.
 It can’t accept NULL value.
 We can have only one primary key in a table.
SID Reg_No Name Course E-mail
1 2078001 Sagar KC BIT [email protected]
2 2078002 Binod Karki CE [email protected]
3 2078003 Darshan DC BIT [email protected]
4 2078004 Sagar KC BScCSIT [email protected]

Table: tbl_student

Example: Reg_No is a primary key.


4. Foreign Key:
 Foreign Key is an attribute in the table that is
primary key in another table.
 It can accept multiple null values.
 We can have more than one foreign key in a table.
Example:
Roll No. Name Grade
1 Sita XI
2 Sarita XII

Primary Key tbl_student

Foreign Key

Reg No. Roll No English Computer Account Economics Math

207701 1 45 55 34 76 44
207702 2 76 87 55 65 76
tbl_subject
5. Alternate Key:
All the remaining candidate key which are not selected
as a primary key are called Alternate Key.
SID Reg_No Name Course E-mail
1 2078001 Sagar KC BIT [email protected]
2 2078002 Binod Karki CE [email protected]
3 2078003 Darshan DC BIT [email protected]
4 2078004 Sagar KC BScCSIT [email protected]

Example:
If we choose Reg_No as a primary key then SID and
Email will become Alternate Key.
Normalization:
Normalization is the process of breaking down
(or decomposing) a complex relation into simple relation.
Normalization reduces data redundancies and helps to
eliminate the data anomalies that result from
redundancies.
Normalization makes more flexible and easier to
maintain. E.F. Codd has introduced few rules for
normalizing the database in 1970 and these rules are
known as the normal forms.
Advantages of Normalization:
 It reduces data redundancy.
 It improves faster sorting and index creation.
 It simplifies the structure of table.
 It improves the performance of the data system.
 It avoids undesirable insertion, update and
deletion anomalies.
 When a row is added to a relation other relation
in a database should not be affected.

You might also like