{"id":1042,"date":"2026-10-30T12:16:09","date_gmt":"2026-10-30T12:16:09","guid":{"rendered":"https:\/\/blog.debuggersspace.com\/?p=1042"},"modified":"2026-10-30T14:12:01","modified_gmt":"2026-10-30T14:12:01","slug":"what-is-normalisation-explain-1nf-2nf-and-3nf","status":"publish","type":"post","link":"https:\/\/blog.debuggersspace.com\/index.php\/2026\/10\/30\/what-is-normalisation-explain-1nf-2nf-and-3nf\/","title":{"rendered":"What is normalisation? Explain 1NF, 2NF and 3NF."},"content":{"rendered":"<div class='booster-block booster-read-block'>\n                <div class=\"twp-read-time\">\n                \t<i class=\"booster-icon twp-clock\"><\/i> <span>Read Time:<\/span>1 Minute, 44 Second                <\/div>\n\n            <\/div>\n<p class=\"wp-block-paragraph\">Normalisation is organising tables so each fact is stored once. That removes update anomalies (changing a value in one row but not another), insert anomalies and delete anomalies. Walk one table through the steps.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Starting point<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>OrderData\norder_id  customer  city    products              \n101       Asha      Pune    Pen:2, Notebook:1    \n102       Ravi      Mumbai  Pen:5<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">1NF: atomic values, no repeating groups<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Each cell holds one value and each row is unique.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>order_id  product   qty  customer  city\n101       Pen       2    Asha      Pune\n101       Notebook  1    Asha      Pune\n102       Pen       5    Ravi      Mumbai\nKey: (order_id, product)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2NF: no partial dependency<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Every non-key column must depend on the <em>whole<\/em> key. Here <code>customer<\/code> and <code>city<\/code> depend only on <code>order_id<\/code>, part of the key. Split them out.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Orders(order_id PK, customer, city)\nOrderItems(order_id, product, qty)  PK (order_id, product)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3NF: no transitive dependency<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Non-key columns must depend only on the key, not on another non-key column. <code>city<\/code> depends on the customer, not on the order. Split again.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Customers(customer_id PK, name, city)\nOrders(order_id PK, customer_id FK)\nOrderItems(order_id FK, product_id FK, qty)\nProducts(product_id PK, name, price)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now a customer moving city is one update in one row.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">BCNF in one line<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Every determinant must be a candidate key. It is a stricter 3NF; most 3NF tables already satisfy it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When to denormalise<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Reporting and read-heavy screens sometimes copy data (for example storing <code>order_total<\/code> on the order, or a reporting table) to avoid many joins. Do it on purpose, keep the copy in sync, and say so in the interview: it shows you know the trade-off.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Follow-ups<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>What are insert, update and delete anomalies?<\/li>\n\n\n<li>What is a candidate key versus a primary key?<\/li>\n\n\n<li>Is a highly normalised schema always faster?<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This answer was written by Debugger&#8217;s Space as practice material. It is asked in most Indian IT services interviews (TCS, Infosys, Wipro, HCLTech, Tech Mahindra, LTIMindtree, Accenture, Cognizant, Capgemini, IBM). See each company&#8217;s hiring steps and practice questions on <a href=\"https:\/\/www.debuggersspace.com\/companies\">Debugger&#8217;s Space<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Database normalisation explained with one table taken from unnormalised to 1NF, 2NF and 3NF, plus BCNF and when to denormalise.<\/p>\n","protected":false},"author":43,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[263],"tags":[234,236,235,267,231,237,229,233,282,265,228,232,230],"class_list":["post-1042","post","type-post","status-publish","format-standard","hentry","category-common-interview-questions","tag-accenture","tag-capgemini","tag-cognizant","tag-dbms-interview-questions","tag-hcltech","tag-ibm","tag-infosys","tag-ltimindtree","tag-normalization","tag-sql-interview-questions","tag-tcs","tag-tech-mahindra","tag-wipro"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Himanshu Namdeo","author_link":"https:\/\/blog.debuggersspace.com\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"Database normalisation explained with one table taken from unnormalised to 1NF, 2NF and 3NF, plus BCNF and when to denormalise.","_links":{"self":[{"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/posts\/1042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/comments?post=1042"}],"version-history":[{"count":1,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/posts\/1042\/revisions"}],"predecessor-version":[{"id":1083,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/posts\/1042\/revisions\/1083"}],"wp:attachment":[{"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/media?parent=1042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/categories?post=1042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/tags?post=1042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}