You are on page 1of 2

Alternate key

A table can have multiple choices for a primary key but only one can be set as the primary key.
All the keys which are not set as primary key are known as alternate keys.
5. Composite key
Composite key is a combination of two or more attributes which uniquely identify rows in a
table.
6. Foreign key
Foreign key is an attribute that create a relationship between two tables. It acts as a cross
reference between two tables and a foreign key always references the primary key of another
table.
Source: (Lecture notes, 03rd January 2021)
24
A.G.D.N.Ranathunga Database Design & Development Assignment No.
01
1.7 What is normalization?
Normalization is a database design technique that reduces data redundancy and eliminates
undesirable characteristics like Insertion, Update and Deletion Anomalies. Normalization rules
divides larger tables into smaller tables and links them using relationships. The purpose of
Normalization in SQL is to eliminate redundant (repetitive) data and ensure data is stored
logically.
(guru99, 2021)
Normalization with examples
1. 1NF (FIRST NORMAL FORM)
Stu_I D Stu_name Stu_contact dob
001 KamalPer era 0774635001, 0257880480 5-Jun-97
002 NimalSilv a 0711825400, 0754848500 1 5-Jun-98
003 SamanBa ndara 0662284418, 0725845875 25-Apr-96
Table 3: example for 1NF Source: author developed
In 1NF each cell should contain a single value and each record needs to be unique.
2. 2NF (SECOND NORMAL FORM)
- It should be in first normalized form.
- Partial dependencies must be removed.
- Primary keys must be selected for separated tables.
25
A.G.D.N.Ranathunga Database Design & Development Assignment No. 01
Student Table
Stu_I D Fname Lname Stu_contact 1
001 Kamal Perera 774635001
002 Nimal Silva 711825400
003 Saman Bandara 662284418
Table 4: example for 2NF
Source: author developed
Primary Key : Stu_ID Course Table
crc_ID crc_fee crc_duration Teacher
crc00 1 Rs. 150,000.00 6 months Jehan Fernando
crc00 1 Rs. 150,000.00 6 months Jehan Fernando
crc00 2 Rs. 200,000.00 10 months Suesh Bandara
Table 4: example for 2NF Source: author devel

You might also like