DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Strategies for Improving the Performance of Applications Using EF Core
  • Java and MongoDB Integration: A CRUD Tutorial [Video Tutorial]
  • Architecture and Code Design, Pt. 2: Polyglot Persistence Insights To Use Today and in the Upcoming Years
  • Architecture and Code Design, Pt. 1: Relational Persistence Insights to Use Today and On the Upcoming Years

Trending

  • Optimizing Integration Workflows With Spark Structured Streaming and Cloud Services
  • How To Develop a Truly Performant Mobile Application in 2025: A Case for Android
  • Cosmos DB Disaster Recovery: Multi-Region Write Pitfalls and How to Evade Them
  • Agile and Quality Engineering: A Holistic Perspective
  1. DZone
  2. Data Engineering
  3. Databases
  4. Database Concepts for a java Dev: Database Normalization

Database Concepts for a java Dev: Database Normalization

By 
Jagadeesh Motamarri user avatar
Jagadeesh Motamarri
·
Mar. 13, 13 · Interview
Likes (1)
Comment
Save
Tweet
Share
10.6K Views

Join the DZone community and get the full member experience.

Join For Free

In this part, I will be briefing about different types of Database Normalizations using a sample data model.

What is Database Normalization?

Normalization is the process of efficiently organizing data in the database.

Primary Goal of Normalization?

Eliminating redundant data & ensuring meaningful data dependencies.

Types of Normalization

The following are the three most common normal forms in the database normalization process

  1. First Normal Form (1NF)
  2. Second Normal Form (2NF)
  3. Third Normal Form (3NF)

Sample Data Model for Demonstration

The following data model will be used to demonstrate all the three normal forms

First Normal Form (1NF)

First Normal Form (1NF) sets the very basic rules for an organized database:

  • Create separate set of tables for each group of related data and identify each row with a unique columns [primary key] or set of columns [composite key]
  • Eliminate duplicate columns from the table

The following data model depicts the tables after 1NF rules are applied -

Second Normal Form (2NF)

Second Normal Form (2NF) further addresses the concept of removing duplicate data:

  • Meet all the requirements of the first normal form
  • Remove subsets of data that apply to multiple rows of a table and place them in separate tables
  • Create relationships between these new tables and their predecessors through the use of foreign keys

So basically the objective of the Second Normal Form is to take that is only partly dependent on the primary key and enter that data into another table.

The following data model depicts the tables after 2NF rules are applied.

Data from EMPLOYEE_TABLE is split into 2 tables – EMPLOYEE_TABLE and EMPLOYEE_HR_TABLE.

Similarly data from CUSTOMER_TABLE is moved to CUSTOMER_TABLE and CUSTOMER_ORDER table

Third Normal Form (3NF)

Third normal form (3NF) goes one large step further:

  • Meet all the requirements of the second normal form.
  • Remove columns that are not dependent upon the primary key.

The following data model depicts the tables after 3NF rules are applied.

Further state and country details are moved to their own tables because they are not dependent on the primary key.

Advantages of Normalizing the Database

There are several advantages of normalization -

  1. Data can be stored as small atomic pieces
  2. Saves space
  3. Increases speed
  4. Reduces data anomalies
  5. Easy maintenance

Other parts of this series include:

Part 1 – ACID Properties

Part 2 – Keys

Part 4 – Database Transactions [coming soon]

Part 5 – Indexes [coming soon]

Database Database normalization Data (computing) Concept (generic programming) Form (document) Data model (GIS) Relational database Java (programming language) dev

Published at DZone with permission of Jagadeesh Motamarri, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Strategies for Improving the Performance of Applications Using EF Core
  • Java and MongoDB Integration: A CRUD Tutorial [Video Tutorial]
  • Architecture and Code Design, Pt. 2: Polyglot Persistence Insights To Use Today and in the Upcoming Years
  • Architecture and Code Design, Pt. 1: Relational Persistence Insights to Use Today and On the Upcoming Years

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: