© 2026 schoolict.net (Ruwan Mangala Suraweera)
8.7 Normalisation: 0NF to 3NFසාමාන්යකරණය: 0NF සිට 3NF දක්වා
Grade 13 A/L ICT · Lesson 813 ශ්රේණිය A/L ICT · පාඩම 8
In this videoමේ වීඩියෝවේ
- Redundancy causes insert, update and delete anomalies.අතිරික්තතාව විෂමතා ඇති කරයි.
- 1NF: atomic values, no repeating groups.1NF: පරමාණුක, පුනරාවර්තන නැත.
- 2NF: remove partial dependencies.2NF: අර්ධ පරායත්තතා ඉවත් කරන්න.
- 3NF: remove transitive dependencies.3NF: සංක්රාන්ති පරායත්තතා ඉවත් කරන්න.
- A good decomposition is lossless – joins rebuild the data.හොඳ බෙදීමක් අහිමි නොවේ – join මගින් දත්ත නැවත ලැබේ.
Notesසටහන්
Syllabus 8.7. A badly designed table repeats data and suffers insert, update and delete anomalies. Normalisation splits it using functional dependencies (full, partial and transitive) through zero, first, second and third normal form.විෂය නිර්දේශය 8.7. නරක ලෙස සැලසුම් කළ වගුවක් දත්ත පුනරාවර්තනය කර ඇතුළත් කිරීමේ, යාවත්කාලීන කිරීමේ සහ මකා දැමීමේ විෂමතා ඇති කරයි. සාමාන්යකරණය ක්රියාකාරී පරායත්තතා (පූර්ණ, අර්ධ, සංක්රාන්ති) භාවිතයෙන් ශුන්ය, පළමු, දෙවන සහ තෙවන සාමාන්ය ආකෘති හරහා එය බෙදයි.
1. Redundancy and anomalies1. අතිරික්තතාව සහ විෂමතා
| OrderNoOrderNo | DateDate | CustIDCustID | CustNameCustName | ItemCodeItemCode | ItemNameItemName | QtyQty | PricePrice |
|---|---|---|---|---|---|---|---|
| 10011001 | 2026-03-012026-03-01 | C01C01 | PereraPerera | P1P1 | PenPen | 33 | 5050 |
| 10011001 | 2026-03-012026-03-01 | C01C01 | PereraPerera | P2P2 | BookBook | 22 | 200200 |
| 10021002 | 2026-03-022026-03-02 | C02C02 | SilvaSilva | P1P1 | PenPen | 55 | 5050 |
| 10031003 | 2026-03-022026-03-02 | C01C01 | PereraPerera | P2P2 | BookBook | 11 | 200200 |
| 10031003 | 2026-03-022026-03-02 | C01C01 | PereraPerera | P3P3 | RulerRuler | 44 | 8080 |
- Insert anomaly – a new item cannot be stored until someone orders it.ඇතුළත් කිරීමේ විෂමතාව – කවුරුන් හෝ ඇණවුම් කරන තුරු නව භාණ්ඩයක් ගබඩා කළ නොහැක.
- Update anomaly – Perera appears in 4 rows; changing the name in one row only makes data inconsistent.යාවත්කාලීන විෂමතාව – Perera පේළි 4 ක ඇත; එකක පමණක් වෙනස් කළොත් දත්ත අසංගත වේ.
- Delete anomaly – deleting order 1002 also loses customer Silva.මකා දැමීමේ විෂමතාව – ඇණවුම 1002 මැකීමෙන් Silva පාරිභෝගිකයා ද නැති වේ.
2. Functional dependencies2. ක්රියාකාරී පරායත්තතා
A → B means each value of A fixes one value of B. With key (OrderNo, ItemCode): full – (OrderNo, ItemCode) → Qty; partial – OrderNo → Date, CustID and ItemCode → ItemName, Price; transitive – OrderNo → CustID → CustName.A → B යනු A හි එක් එක් අගය B හි එක් අගයක් නියම කිරීමයි. යතුර (OrderNo, ItemCode): පූර්ණ – (OrderNo, ItemCode) → Qty; අර්ධ – OrderNo → Date, CustID සහ ItemCode → ItemName, Price; සංක්රාන්ති – OrderNo → CustID → CustName.
3. Normal forms3. සාමාන්ය ආකෘති
0NF has 3 orders with repeating items → 1NF: 5 rows (key OrderNo + ItemCode). Remove partial dependencies → 2NF: Order(OrderNo, Date, CustID, CustName), Item(ItemCode, ItemName, Price), OrderLine(OrderNo, ItemCode, Qty). Remove the transitive CustID → CustName → 3NF: 4 tables (Customer split off). Joining them in sqlite3 gives back exactly the 1NF rows (lossless). Cells: 40 → 37. Order totals: 1001 = Rs. 550, 1002 = Rs. 250, 1003 = Rs. 520.0NF → 1NF: පේළි 5 (යතුර OrderNo + ItemCode). අර්ධ පරායත්තතා ඉවත් කර → 2NF: Order, Item, OrderLine. සංක්රාන්ති CustID → CustName ඉවත් කර → 3NF: වගු 4. sqlite3 තුළ join කළ විට 1NF පේළි නිවැරදිව ලැබේ (අහිමි නොවේ). කොටු: 40 → 37. ඇණවුම් එකතු: 1001 = Rs. 550, 1002 = Rs. 250, 1003 = Rs. 520.
📝 3NF schema3NF ක්රමානුරූපය
Customer(CustID, CustName) Order(OrderNo, Date, CustID) -- FK CustID Item(ItemCode, ItemName, Price) OrderLine(OrderNo, ItemCode, Qty) -- PK (OrderNo, ItemCode)
Key Wordsප්රධාන පද
Sample Q&Aආදර්ශ ප්රශ්න සහ පිළිතුරු
1What is an update anomaly?යාවත්කාලීන විෂමතාව?
2Give a partial dependency in the order table.අර්ධ පරායත්තතාවක්.
3Give the transitive dependency.සංක්රාන්ති පරායත්තතාව.
4How many rows in 1NF?1NF පේළි ගණන?
5How many tables in 3NF?3NF වගු ගණන?
6Condition for 3NF?3NF කොන්දේසිය?
MCQබහුවරණ ප්රශ්න
Choose the correct answer for each question.සෑම ප්රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.
1Data with repeating groups is inපුනරාවර්තන කාණ්ඩ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Unnormalised.සාමාන්යකරණය නොකළ.
2Removing repeating groups givesපුනරාවර්තන ඉවත්
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
1NF.1NF.
3ItemCode → ItemName with key (OrderNo, ItemCode) is aItemCode → ItemName
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Part of key.යතුරේ කොටස.
4OrderNo → CustID → CustName is aCustName
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Via non-key.යතුරු නොවන හරහා.
5(OrderNo, ItemCode) → Qty is aQty
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Whole key.සම්පූර්ණ යතුර.
6The order data in 1NF has1NF පේළි
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Each item line.සෑම භාණ්ඩ පේළියක්ම.
7Losing customer Silva when order 1002 is deleted is aSilva
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Delete.මකා දැමීම.
8The 3NF design of the order data has3NF
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Customer, Order, Item, OrderLine.වගු 4.
9Which term means: “Process of organising tables to reduce redundancy and anomalies”?“අතිරික්තතාව සහ විෂමතා අඩු කිරීමට වගු සංවිධානය කිරීම” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Normalisation – Process of organising tables to reduce redundancy and anomalies.සාමාන්යකරණය – අතිරික්තතාව සහ විෂමතා අඩු කිරීමට වගු සංවිධානය කිරීම.
10Which term means: “Cannot add data without unrelated other data”?“වෙනත් දත්ත නැතිව දත්ත එක් කළ නොහැකි වීම” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Insert anomaly – Cannot add data without unrelated other data.ඇතුළත් කිරීමේ විෂමතාව – වෙනත් දත්ත නැතිව දත්ත එක් කළ නොහැකි වීම.
11Which term means: “Changing repeated data in some rows only leaves inconsistency”?“සමහර පේළිවල පමණක් වෙනස් කිරීමෙන් අසංගතතාව” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Update anomaly – Changing repeated data in some rows only leaves inconsistency.යාවත්කාලීන විෂමතාව – සමහර පේළිවල පමණක් වෙනස් කිරීමෙන් අසංගතතාව.
12Which term means: “Deleting a row also loses other needed facts”?“පේළියක් මැකීමෙන් අවශ්ය වෙනත් කරුණු නැති වීම” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Delete anomaly – Deleting a row also loses other needed facts.මකා දැමීමේ විෂමතාව – පේළියක් මැකීමෙන් අවශ්ය වෙනත් කරුණු නැති වීම.
13Which term means: “A value of one attribute set determines another attribute”?“එක් උපලක්ෂණ කට්ටලයක අගය තවත් උපලක්ෂණයක් තීරණය කිරීම” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Functional dependency – A value of one attribute set determines another attribute.ක්රියාකාරී පරායත්තතාව – එක් උපලක්ෂණ කට්ටලයක අගය තවත් උපලක්ෂණයක් තීරණය කිරීම.
14Which term means: “Attribute depends on the whole composite key”?“උපලක්ෂණය සම්පූර්ණ සංයුක්ත යතුර මත රඳා පැවතීම” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Full dependency – Attribute depends on the whole composite key.පූර්ණ පරායත්තතාව – උපලක්ෂණය සම්පූර්ණ සංයුක්ත යතුර මත රඳා පැවතීම.
15Which term means: “Attribute depends on only part of a composite key”?“උපලක්ෂණය සංයුක්ත යතුරේ කොටසක් මත පමණක් රඳා පැවතීම” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Partial dependency – Attribute depends on only part of a composite key.අර්ධ පරායත්තතාව – උපලක්ෂණය සංයුක්ත යතුරේ කොටසක් මත පමණක් රඳා පැවතීම.
16Which term means: “Non-key attribute depends on another non-key attribute”?“යතුරු නොවන උපලක්ෂණයක් තවත් එකක් මත රඳා පැවතීම” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Transitive dependency – Non-key attribute depends on another non-key attribute.සංක්රාන්ති පරායත්තතාව – යතුරු නොවන උපලක්ෂණයක් තවත් එකක් මත රඳා පැවතීම.
17Which term means: “Unnormalised data with repeating groups”?“පුනරාවර්තන කාණ්ඩ ඇති සාමාන්යකරණය නොකළ දත්ත” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Zero normal form – Unnormalised data with repeating groups.ශුන්ය සාමාන්ය ආකෘතිය – පුනරාවර්තන කාණ්ඩ ඇති සාමාන්යකරණය නොකළ දත්ත.
18Which term means: “Atomic values and no repeating groups”?“පරමාණුක අගයන් සහ පුනරාවර්තන කාණ්ඩ නැත” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
First normal form – Atomic values and no repeating groups.පළමු සාමාන්ය ආකෘතිය – පරමාණුක අගයන් සහ පුනරාවර්තන කාණ්ඩ නැත.
19Which term means: “1NF with no partial dependencies”?“අර්ධ පරායත්තතා නැති 1NF” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Second normal form – 1NF with no partial dependencies.දෙවන සාමාන්ය ආකෘතිය – අර්ධ පරායත්තතා නැති 1NF.
20Which term means: “2NF with no transitive dependencies”?“සංක්රාන්ති පරායත්තතා නැති 2NF” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Third normal form – 2NF with no transitive dependencies.තෙවන සාමාන්ය ආකෘතිය – සංක්රාන්ති පරායත්තතා නැති 2NF.
MCQ answer keyMCQ පිළිතුරු
- D – Unnormalised.සාමාන්යකරණය නොකළ.
- A – 1NF.1NF.
- B – Part of key.යතුරේ කොටස.
- C – Via non-key.යතුරු නොවන හරහා.
- A – Whole key.සම්පූර්ණ යතුර.
- D – Each item line.සෑම භාණ්ඩ පේළියක්ම.
- E – Delete.මකා දැමීම.
- C – Customer, Order, Item, OrderLine.වගු 4.
- B – Normalisation – Process of organising tables to reduce redundancy and anomalies.සාමාන්යකරණය – අතිරික්තතාව සහ විෂමතා අඩු කිරීමට වගු සංවිධානය කිරීම.
- C – Insert anomaly – Cannot add data without unrelated other data.ඇතුළත් කිරීමේ විෂමතාව – වෙනත් දත්ත නැතිව දත්ත එක් කළ නොහැකි වීම.
- D – Update anomaly – Changing repeated data in some rows only leaves inconsistency.යාවත්කාලීන විෂමතාව – සමහර පේළිවල පමණක් වෙනස් කිරීමෙන් අසංගතතාව.
- E – Delete anomaly – Deleting a row also loses other needed facts.මකා දැමීමේ විෂමතාව – පේළියක් මැකීමෙන් අවශ්ය වෙනත් කරුණු නැති වීම.
- B – Functional dependency – A value of one attribute set determines another attribute.ක්රියාකාරී පරායත්තතාව – එක් උපලක්ෂණ කට්ටලයක අගය තවත් උපලක්ෂණයක් තීරණය කිරීම.
- E – Full dependency – Attribute depends on the whole composite key.පූර්ණ පරායත්තතාව – උපලක්ෂණය සම්පූර්ණ සංයුක්ත යතුර මත රඳා පැවතීම.
- B – Partial dependency – Attribute depends on only part of a composite key.අර්ධ පරායත්තතාව – උපලක්ෂණය සංයුක්ත යතුරේ කොටසක් මත පමණක් රඳා පැවතීම.
- A – Transitive dependency – Non-key attribute depends on another non-key attribute.සංක්රාන්ති පරායත්තතාව – යතුරු නොවන උපලක්ෂණයක් තවත් එකක් මත රඳා පැවතීම.
- D – Zero normal form – Unnormalised data with repeating groups.ශුන්ය සාමාන්ය ආකෘතිය – පුනරාවර්තන කාණ්ඩ ඇති සාමාන්යකරණය නොකළ දත්ත.
- A – First normal form – Atomic values and no repeating groups.පළමු සාමාන්ය ආකෘතිය – පරමාණුක අගයන් සහ පුනරාවර්තන කාණ්ඩ නැත.
- C – Second normal form – 1NF with no partial dependencies.දෙවන සාමාන්ය ආකෘතිය – අර්ධ පරායත්තතා නැති 1NF.
- E – Third normal form – 2NF with no transitive dependencies.තෙවන සාමාන්ය ආකෘතිය – සංක්රාන්ති පරායත්තතා නැති 2NF.
Structured Questionsව්යුහගත ප්රශ්න
1Explain insert, update and delete anomalies with the order table.විෂමතා තුන. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
2Define full, partial and transitive dependency with examples.පරායත්තතා තුන. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
3Convert the 0NF order data to 1NF and state the key.0NF → 1NF. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
4Normalise the 1NF table to 2NF.1NF → 2NF. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
5Normalise to 3NF and explain which anomaly is removed.3NF. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
🎮 Game🎮 ක්රීඩා
Summary & Downloadsසාරාංශය සහ බාගත කිරීම්
Key pointsප්රධාන කරුණු
- Redundancy causes insert, update and delete anomalies.අතිරික්තතාව විෂමතා ඇති කරයි.
- 1NF: atomic values, no repeating groups.1NF: පරමාණුක, පුනරාවර්තන නැත.
- 2NF: remove partial dependencies.2NF: අර්ධ පරායත්තතා ඉවත් කරන්න.
- 3NF: remove transitive dependencies.3NF: සංක්රාන්ති පරායත්තතා ඉවත් කරන්න.
- A good decomposition is lossless – joins rebuild the data.හොඳ බෙදීමක් අහිමි නොවේ – join මගින් දත්ත නැවත ලැබේ.
Downloadsබාගත කිරීම්
Full Lesson 8 PDFසම්පූර්ණ පාඩම 8 PDF: English · සිංහල
Next: Lesson 8 A/L Exam Practiceඊළඟට: පාඩම 8 A/L විභාග පුහුණුව →
