Sobes.tech
Junior — Middle

Can you give an example of when data normalization is used in a database?

sobes.tech AI

Answer from AI

Data normalization is used to eliminate redundancy and ensure data integrity. For example, if you have an orders table where customer data (name, address) is repeated, normalization allows you to create a separate customers table and link it to orders via a foreign key.

This helps to:

  • Avoid duplication of information
  • Facilitate data updates (for example, changing a customer's address in one place)
  • Improve the database structure

Example: instead of storing the customer's name and address in each order record, a Clients table is created with a unique client_id, and only the client_id is stored in the orders table.