Normalization and Denormalization
A school writes a student's phone number on every exam sheet. When it changes, someone must find every sheet. Normalization writes the number in one place only. Denormalization copies it again, on purpose.
6 min read6 মিনিটে পড়া যায় · 8 sections8টি সেকশন · 2 sources2টি সোর্স · updated Nov 2026আপডেট: Nov 2026
Splitting a table into 1NF, 2NF, 3NFএকটা টেবিলকে 1NF, 2NF, 3NF-এ ভাগ করা
Watch a messy student table split into clean tables, then switch to a copy and see a write touch every row.একটা এলোমেলো student টেবিল পরিষ্কার টেবিলে ভাগ হতে দেখুন, তারপর কপিতে বদলে দেখুন একটা write প্রতিটা রো ছোঁয়।
You’ll learnআপনি শিখবেন
- What 1NF, 2NF and 3NF split apart1NF, 2NF ও 3NF কী কী আলাদা করে
- Why a normalized read needs joinsnormalized রিডে কেন জয়েন লাগে
- Why a copy makes a write cost moreকপি থাকলে কেন write-এর খরচ বাড়ে
- How copies drift apartকপিগুলো কীভাবে আলাদা হয়ে যায়
In plain words
Normalization is the work of organizing data in a database: you make tables and the links between them by rules that protect the data and make the database more flexible Source 1সোর্স 1. The rules remove two things: redundancy (the same data in many places) and inconsistent dependency (data stored in the table of the wrong thing) Source 1সোর্স 1.
Redundant data wastes disk space and causes maintenance problems. A fact that lives in several places must be changed the same way in every place Source 1সোর্স 1. A customer address is easier to change when it is stored only in the Customers table Source 1সোর্স 1. As for inconsistent dependency, an employee's salary belongs with the employee, not in Customers. Data in the wrong place can be hard to find Source 1সোর্স 1.
Two tools hold the pieces together. A primary key is a column, or a group of columns, that identifies each row. Its values must be unique and not null Source 2সোর্স 2. A foreign key says that a value in one table must match a row of another table. This keeps the two tables consistent, and the name for it is referential integrity Source 2সোর্স 2.
সহজ English
Normalization is the work of organizing data in a database. You make tables and the links between them by rules. The rules protect the data and make the database more flexible Source 1সোর্স 1. The rules remove two things: redundancy (the same data in many places) and inconsistent dependency (data stored in the table of the wrong thing) Source 1সোর্স 1.
Redundant data wastes disk space and causes maintenance problems. A fact that lives in several places must be changed the same way in every place Source 1সোর্স 1. A customer address is easier to change when it is stored only in the Customers table Source 1সোর্স 1. An employee's salary belongs with the employee, not in Customers. Data in the wrong place can be hard to find Source 1সোর্স 1.
Two tools hold the pieces together. A primary key is a column, or a group of columns, that identifies each row. Its values must be unique and not null Source 2সোর্স 2. A foreign key says that a value in one table must match a row of another table. This keeps the two tables consistent. The name for it is referential integrity Source 2সোর্স 2.
বাংলা ব্যাখ্যা
নরমালাইজেশন (normalization) হলো ডেটাবেসে ডেটা সাজানোর কাজ। আপনি নিয়ম মেনে টেবিল এবং তাদের মধ্যকার লিংক বানান। নিয়মগুলো ডেটাকে রক্ষা করে এবং ডেটাবেসকে আরও নমনীয় করে Source 1সোর্স 1। নিয়মগুলো দুটি জিনিস দূর করে: রিডান্ডেন্সি (redundancy, একই ডেটা অনেক জায়গায়) এবং ইনকনসিসটেন্ট ডিপেন্ডেন্সি (inconsistent dependency, ডেটা ভুল জিনিসের টেবিলে রাখা) Source 1সোর্স 1।
রিডান্ডেন্ট ডেটা ডিস্ক স্পেস নষ্ট করে এবং রক্ষণাবেক্ষণে সমস্যা তৈরি করে। যে তথ্য কয়েক জায়গায় থাকে, তা প্রতিটি জায়গায় একই ভাবে বদলাতে হয় Source 1সোর্স 1। কাস্টমারের ঠিকানা শুধু Customers টেবিলে রাখলে তা বদলানো সহজ হয় Source 1সোর্স 1। কর্মীর বেতন কর্মীর সাথেই থাকা উচিত, Customers-এ নয়। ভুল জায়গায় থাকা ডেটা খুঁজে পাওয়া কঠিন হতে পারে Source 1সোর্স 1।
দুটি টুল অংশগুলোকে একসাথে ধরে রাখে। প্রাইমারি কী (primary key) হলো একটি কলাম বা একাধিক কলামের গুচ্ছ, যা প্রতিটি রো-কে শনাক্ত করে। এর মান ইউনিক হতে হয় এবং null হতে পারে না Source 2সোর্স 2। ফরেন কী (foreign key) বলে, এক টেবিলের একটি মান অন্য টেবিলের একটি রো-র সাথে মিলতে হবে। এতে দুটি টেবিল সামঞ্জস্যপূর্ণ থাকে। এর নাম রেফারেন্সিয়াল ইন্টিগ্রিটি (referential integrity) Source 2সোর্স 2।
When you need it
You meet this topic whenever a team designs tables for orders, users, or payments. It also helps with a bug such as "the address is right on one screen and wrong on another". That often means the same fact is stored twice.
সহজ English
You meet this topic whenever a team designs tables for orders, users, or payments. It also helps with a bug such as "the address is right on one screen and wrong on another". That often means the same fact is stored twice.
বাংলা ব্যাখ্যা
কোনো দল অর্ডার, ইউজার বা পেমেন্টের টেবিল ডিজাইন করলেই আপনি এই বিষয়ের মুখোমুখি হন। "ঠিকানা এক স্ক্রিনে ঠিক, অন্য স্ক্রিনে ভুল" ধরনের বাগেও এটি সাহায্য করে। এর অর্থ প্রায়ই হলো, একই তথ্য দুবার সংরক্ষিত আছে।
How it works
Each rule is called a normal form. A database that follows the first rule is in first normal form. One that follows the first three rules is in third normal form Source 1সোর্স 1. Third normal form is the highest level that most applications need Source 1সোর্স 1. Stricter forms exist too (BCNF, fourth, and fifth normal form), but the source says they are rarely considered in practical design Source 1সোর্স 1.
| Form | The rule, as the source gives it |
|---|---|
| First (1NF) | Remove repeating groups. Put each group of related data in its own table. Give each set a primary key Source 1সোর্স 1. |
| Second (2NF) | Make separate tables for values that apply to many records, and relate them with a foreign key. A record must depend on the primary key and on nothing else Source 1সোর্স 1. |
| Third (3NF) | Remove fields that do not depend on the key Source 1সোর্স 1. |
Worked example. The source starts with a student table that has the fields Class1, Class2, and Class3. For first normal form, it uses one row for each student and class. For second normal form, it splits the data into Students and Registration. For third normal form, the advisor's room depends on the advisor, so it moves to a Faculty table Source 1সোর্স 1.
Foreign keys. A foreign key then protects the link. If orders points to products, the database refuses an order with a product number that is not in products Source 2সোর্স 2. When someone deletes a referenced row, RESTRICT blocks the delete and CASCADE deletes the rows that point to it Source 2সোর্স 2. CASCADE can suit parts that cannot exist alone, such as order items. RESTRICT suits independent things, such as products and orders Source 2সোর্স 2.
সহজ English
Each rule is called a normal form. A database that follows the first rule is in first normal form. A database that follows the first three rules is in third normal form Source 1সোর্স 1. Third normal form is the highest level that most applications need Source 1সোর্স 1. Stricter forms exist too (BCNF, fourth, and fifth normal form), but the source says they are rarely considered in practical design Source 1সোর্স 1.
- First (1NF): remove repeating groups. Put each group of related data in its own table. Give each set a primary key Source 1সোর্স 1.
- Second (2NF): make separate tables for values that apply to many records, and relate them with a foreign key. A record must depend on the primary key and on nothing else Source 1সোর্স 1.
- Third (3NF): remove fields that do not depend on the key Source 1সোর্স 1.
The source starts with a student table that has the fields Class1, Class2, and Class3. For first normal form, it uses one row for each student and class. For second normal form, it splits the data into Students and Registration. For third normal form, the advisor's room depends on the advisor, so it moves to a Faculty table Source 1সোর্স 1.
A foreign key then protects the link. If orders points to products, the database refuses an order with a product number that is not in products Source 2সোর্স 2. When someone deletes a referenced row, RESTRICT blocks the delete and CASCADE deletes the rows that point to it Source 2সোর্স 2. CASCADE can suit parts that cannot exist alone, such as order items. RESTRICT suits independent things, such as products and orders Source 2সোর্স 2.
বাংলা ব্যাখ্যা
প্রতিটি নিয়মকে নরমাল ফর্ম (normal form) বলে। যে ডেটাবেস প্রথম নিয়ম মানে, সে প্রথম নরমাল ফর্মে (first normal form) আছে। যে ডেটাবেস প্রথম তিনটি নিয়ম মানে, সে তৃতীয় নরমাল ফর্মে (third normal form) আছে Source 1সোর্স 1। বেশিরভাগ অ্যাপ্লিকেশনের জন্য তৃতীয় নরমাল ফর্মই সর্বোচ্চ স্তর, যা দরকার হয় Source 1সোর্স 1। আরও কঠোর ফর্মও আছে (BCNF, চতুর্থ ও পঞ্চম নরমাল ফর্ম), কিন্তু সোর্স বলে বাস্তব ডিজাইনে সেগুলো কদাচিৎ বিবেচনা করা হয় Source 1সোর্স 1।
- প্রথম (1NF): রিপিটিং গ্রুপ (repeating group) সরিয়ে দিন। সম্পর্কিত ডেটার প্রতিটি গুচ্ছ নিজের টেবিলে রাখুন। প্রতিটি সেটকে একটি প্রাইমারি কী দিন Source 1সোর্স 1।
- দ্বিতীয় (2NF): যে মান অনেক রেকর্ডে প্রযোজ্য, তার জন্য আলাদা টেবিল বানান এবং ফরেন কী দিয়ে সম্পর্ক করুন। একটি রেকর্ড প্রাইমারি কী-র উপর নির্ভর করবে, আর কিছুর উপর নয় Source 1সোর্স 1।
- তৃতীয় (3NF): যেসব ফিল্ড কী-র উপর নির্ভর করে না, সেগুলো সরিয়ে দিন Source 1সোর্স 1।
সোর্স শুরু করে শিক্ষার্থীর একটি টেবিল দিয়ে, যাতে Class1, Class2 ও Class3 ফিল্ড আছে। প্রথম নরমাল ফর্মের জন্য সে প্রতিটি শিক্ষার্থী ও ক্লাসের জন্য একটি রো ব্যবহার করে। দ্বিতীয় নরমাল ফর্মের জন্য সে ডেটাকে Students ও Registration-এ ভাগ করে। তৃতীয় নরমাল ফর্মের জন্য, উপদেষ্টার (advisor) ঘর উপদেষ্টার উপর নির্ভর করে, তাই সেটি একটি Faculty টেবিলে যায় Source 1সোর্স 1।
তারপর একটি ফরেন কী লিংকটিকে রক্ষা করে। orders যদি products-এর দিকে নির্দেশ করে, তাহলে products-এ নেই এমন প্রোডাক্ট নম্বর দিয়ে অর্ডার দিলে ডেটাবেস তা প্রত্যাখ্যান করে Source 2সোর্স 2। কেউ কোনো রেফারেন্স করা রো মুছলে RESTRICT মোছা আটকে দেয়, আর CASCADE যেসব রো তার দিকে নির্দেশ করে সেগুলোও মুছে দেয় Source 2সোর্স 2। CASCADE সেইসব অংশের জন্য মানানসই হতে পারে, যারা একা থাকতে পারে না, যেমন অর্ডার আইটেম। RESTRICT স্বাধীন জিনিসের জন্য মানানসই, যেমন প্রোডাক্ট ও অর্ডার Source 2সোর্স 2।
Denormalization and trade-offs
Normalization needs more tables, and real projects cannot always follow the rules in full Source 1সোর্স 1. The source warns that many small tables may hurt performance Source 1সোর্স 1. If a team breaks one of the first three rules, the application must expect the problems that follow, such as redundant data Source 1সোর্স 1. It also suggests that a team may use third normal form just for the fields that change often Source 1সোর্স 1.
Denormalization is the tutorial's word for such a deliberate step: you keep a copy of some data in a second place so that a read needs fewer joins. The sources above do not use this word. The tutorial's own advice: this is a trade. A read becomes simpler, but a write must update every copy.
সহজ English
Normalization needs more tables, and real projects cannot always follow the rules in full Source 1সোর্স 1. The source warns that many small tables may hurt performance Source 1সোর্স 1. If a team breaks one of the first three rules, the application must expect the problems that follow, such as redundant data Source 1সোর্স 1. The source also suggests that a team may use third normal form just for the fields that change often Source 1সোর্স 1.
Denormalization is the tutorial's word for such a deliberate step. You keep a copy of some data in a second place, so that a read needs fewer joins. The sources above do not use this word. The tutorial's own advice: this is a trade. A read becomes simpler, but a write must update every copy.
বাংলা ব্যাখ্যা
নরমালাইজেশনে বেশি টেবিল লাগে, আর বাস্তব প্রজেক্ট সবসময় নিয়মগুলো পুরোপুরি মানতে পারে না Source 1সোর্স 1। সোর্স সতর্ক করে, অনেক ছোট টেবিল পারফরম্যান্সের ক্ষতি করতে পারে Source 1সোর্স 1। কোনো দল প্রথম তিনটি নিয়মের একটি ভাঙলে, অ্যাপ্লিকেশনকে তার ফলে আসা সমস্যা, যেমন রিডান্ডেন্ট ডেটা, সামলানোর জন্য তৈরি থাকতে হয় Source 1সোর্স 1। সোর্স এটিও পরামর্শ দেয়, দল শুধু যেসব ফিল্ড প্রায়ই বদলায় সেগুলোর জন্য তৃতীয় নরমাল ফর্ম ব্যবহার করতে পারে Source 1সোর্স 1।
ডিনরমালাইজেশন (denormalization) হলো এমন ইচ্ছাকৃত পদক্ষেপের জন্য টিউটোরিয়ালের নিজস্ব শব্দ। আপনি কিছু ডেটার একটি কপি দ্বিতীয় জায়গায় রাখেন, যাতে একটি রিডে কম জয়েন (join) লাগে। উপরের সোর্সগুলো এই শব্দ ব্যবহার করে না। টিউটোরিয়ালের নিজস্ব পরামর্শ: এটি একটি ট্রেড-অফ। রিড সহজ হয়, কিন্তু রাইটকে প্রতিটি কপি আপডেট করতে হয়।
A real-life example
A shop has one table, orders, with the columns order_id, customer_name, customer_city, and item. This example is the tutorial's own.
A customer with 40 orders moves to a new city, and the city is in 40 rows. If a script fixes 39 rows and fails on the last one, the shop has two cities for one customer. A report by city gives a wrong count, and no error appears.
The team splits the data. A customers table holds the city once, and orders keeps a customer_id with a foreign key. One update now fixes all 40 orders.
Later the order list is slow because every row needs a join. The team may copy customer_city back into orders, for example to show the city on the day of the order. That is denormalization, and the team must decide which copy is the real one.
সহজ English
This example is the tutorial's own. A shop has one table, orders, with the columns order_id, customer_name, customer_city, and item.
A customer with 40 orders moves to a new city, and the city is in 40 rows. Say a script fixes 39 rows and fails on the last one. Then the shop has two cities for one customer. A report by city gives a wrong count, and no error appears.
The team splits the data. A customers table holds the city once, and orders keeps a customer_id with a foreign key. One update now fixes all 40 orders.
Later the order list is slow because every row needs a join. The team may copy customer_city back into orders, for example to show the city on the day of the order. That is denormalization. The team must decide which copy is the real one.
বাংলা ব্যাখ্যা
এই উদাহরণটি টিউটোরিয়ালের নিজস্ব। একটি দোকানের একটিমাত্র টেবিল আছে, orders, যার কলাম হলো order_id, customer_name, customer_city এবং item।
40টি অর্ডার আছে এমন একজন কাস্টমার নতুন শহরে চলে যান, আর শহরটি 40টি রো-তে আছে। ধরুন একটি স্ক্রিপ্ট 39টি রো ঠিক করে এবং শেষটিতে ব্যর্থ হয়। তাহলে দোকানে একজন কাস্টমারের দুটি শহর থাকে। শহর অনুযায়ী একটি রিপোর্ট ভুল গণনা দেয়, আর কোনো এরর দেখা যায় না।
দল ডেটা ভাগ করে। একটি customers টেবিল শহরটি একবার রাখে, আর orders একটি ফরেন কী সহ customer_id রাখে। এখন একটি আপডেট 40টি অর্ডারই ঠিক করে দেয়।
পরে অর্ডারের তালিকা ধীর হয়ে যায়, কারণ প্রতিটি রো-র জন্য জয়েন লাগে। দল customer_city আবার orders-এ কপি করতে পারে, যেমন অর্ডারের দিনের শহরটি দেখানোর জন্য। এটাই ডিনরমালাইজেশন। কোন কপিটি আসল, তা দলকে ঠিক করতে হবে।
Common mistakes
- Storing the same fact in several places by accident. A change must then reach every copy Source 1সোর্স 1.
- Using numbered columns for a list. A new vendor or class then needs a change to the table and the program Source 1সোর্স 1.
- Splitting without a foreign key. The database then cannot keep the tables consistent Source 2সোর্স 2.
- Choosing
CASCADEfor independent things. The PostgreSQL manual says it can be a problem when a product delete removes order rows Source 2সোর্স 2. - Copying data and not recording it. A copy that nobody tracks drifts from the original. This is the tutorial's own advice.
সহজ English
- Do not store the same fact in several places by accident. A change must then reach every copy Source 1সোর্স 1.
- Do not use numbered columns for a list. A new vendor or class then needs a change to the table and the program Source 1সোর্স 1.
- Do not split without a foreign key. The database then cannot keep the tables consistent Source 2সোর্স 2.
- Do not choose
CASCADEfor independent things. The PostgreSQL manual says it can be a problem when a product delete removes order rows Source 2সোর্স 2. - Do not copy data without a record of the copy. A copy that nobody tracks drifts from the original. This is the tutorial's own advice.
বাংলা ব্যাখ্যা
- ভুল করে একই তথ্য কয়েক জায়গায় রাখবেন না। তখন প্রতিটি কপিতে পরিবর্তন পৌঁছাতে হয় Source 1সোর্স 1।
- তালিকার জন্য সংখ্যা দেওয়া কলাম ব্যবহার করবেন না। তখন নতুন ভেন্ডর বা ক্লাসের জন্য টেবিল ও প্রোগ্রাম দুটোই বদলাতে হয় Source 1সোর্স 1।
- ফরেন কী ছাড়া টেবিল ভাগ করবেন না। তখন ডেটাবেস টেবিলগুলোকে সামঞ্জস্যপূর্ণ রাখতে পারে না Source 2সোর্স 2।
- স্বাধীন জিনিসের জন্য
CASCADEবেছে নেবেন না। PostgreSQL ম্যানুয়াল বলে, একটি প্রোডাক্ট মুছলে অর্ডারের রো-ও মুছে গেলে তা সমস্যা হতে পারে Source 2সোর্স 2। - ডেটা কপি করে তা নথিভুক্ত না করে ছেড়ে দেবেন না। যে কপি কেউ ট্র্যাক করে না, সেটি আসল থেকে সরে যায়। এটি টিউটোরিয়ালের নিজস্ব পরামর্শ।
What a tester can check
Tutorial advice
These test ideas are the tutorial's own advice.
- Find the copies. Ask where a fact is stored. If it is in more than one place, ask which one is the source of truth.
- Change one fact. Change a customer's city. Check every screen, report, and export that shows it.
- Break the link. Try to create an order for a customer that does not exist. The system should refuse it with a clear error.
- Delete a parent. Delete a customer that other rows use. Check that the result matches the team's rule (blocked, cascaded, or set to empty).
- Test a copied field. Change the original, then look at the copy. Ask whether it should change or keep the old value, and test that choice.
- Look for numbered columns. For
phone1,phone2,phone3, try a fourth value.
সহজ English
These test ideas are the tutorial's own advice.
- Find the copies. Ask where a fact is stored. If it is in more than one place, ask which one is the source of truth.
- Change one fact. Change a customer's city. Check every screen, report, and export that shows it.
- Break the link. Try to create an order for a customer that does not exist. The system should refuse it with a clear error.
- Delete a parent. Delete a customer that other rows use. Check that the result matches the team's rule (blocked, cascaded, or set to empty).
- Test a copied field. Change the original, then look at the copy. Ask whether it should change or keep the old value, and test that choice.
- Look for numbered columns. For
phone1,phone2,phone3, try a fourth value.
বাংলা ব্যাখ্যা
এই টেস্টের ধারণাগুলো টিউটোরিয়ালের নিজস্ব পরামর্শ।
- কপিগুলো খুঁজুন। জিজ্ঞাসা করুন একটি তথ্য কোথায় সংরক্ষিত। একাধিক জায়গায় থাকলে জিজ্ঞাসা করুন কোনটি সোর্স অফ ট্রুথ (source of truth)।
- একটি তথ্য বদলান। একজন কাস্টমারের শহর বদলান। যে প্রতিটি স্ক্রিন, রিপোর্ট ও এক্সপোর্ট সেটি দেখায়, তা পরীক্ষা করুন।
- লিংক ভাঙুন। এমন কাস্টমারের জন্য অর্ডার বানানোর চেষ্টা করুন, যার অস্তিত্ব নেই। সিস্টেম একটি পরিষ্কার এরর দিয়ে তা প্রত্যাখ্যান করবে।
- একটি প্যারেন্ট (parent) মুছুন। এমন কাস্টমার মুছুন, যাকে অন্য রো ব্যবহার করে। ফলাফল দলের নিয়মের সাথে মেলে কি না দেখুন (ব্লক করা, ক্যাসকেড করা, বা ফাঁকা করা)।
- কপি করা ফিল্ড টেস্ট করুন। আসলটি বদলান, তারপর কপিটি দেখুন। জিজ্ঞাসা করুন এটি বদলানো উচিত নাকি পুরোনো মান রাখা উচিত, এবং সেই সিদ্ধান্তটি টেস্ট করুন।
- সংখ্যা দেওয়া কলাম খুঁজুন।
phone1,phone2,phone3-এর জন্য চতুর্থ একটি মান দিয়ে দেখুন।
Key words
| Word | Meaning |
|---|---|
| Normalization | Organizing tables and links by rules that remove redundancy and inconsistent dependency Source 1সোর্স 1 |
| Normal form | One of the rules of normalization. The first three are the common ones Source 1সোর্স 1 |
| Redundancy | The same data stored in more than one place Source 1সোর্স 1 |
| Primary key | A column or group of columns with unique, not null values that identifies each row Source 2সোর্স 2 |
| Foreign key | A rule that a value must match a row in another table Source 2সোর্স 2 |
| Referential integrity | The consistency that a foreign key keeps between two tables Source 2সোর্স 2 |
| Denormalization | The tutorial's word for a deliberate copy of data to make reads simpler |