Sobes.tech
Senior

Was the data schema normalized in your project? How did you approach normalization?

sobes.tech AI

Answer from AI

Yes, in projects with relational databases, data schema normalization is an important design step. Normalization helps eliminate redundancy, avoid update anomalies, and ensure data integrity.

The normalization approach typically includes the following steps:

  1. Requirements and data analysis — understanding entities, their attributes, and relationships.
  2. First Normal Form (1NF) — removing repeating groups and ensuring atomicity of data.
  3. Second Normal Form (2NF) — eliminating partial dependencies where attributes depend not on the entire key but on a part of it.
  4. Third Normal Form (3NF) — removing transitive dependencies where an attribute depends on another non-key attribute.

In some cases, to improve performance, denormalization is allowed, but this is a conscious compromise.

Example: if the "Orders" table stores customer information, it is better to move customer data to a separate "Customers" table and link them via a foreign key to avoid duplicating information with each order.