Middle
Provide examples of normalized and non-normalized data from practice
sobes.tech AI
Answer from AI
Normalized data refers to data organized to minimize redundancy and dependency, usually in multiple related tables. For example, in a customer and order database:
- The
Customerstable contains unique customer records with their ID, name, and contact information. - The
Orderstable contains order records linked to the customer ID.
This way, data is not duplicated, and changes to customer information need to be made in only one place.
Denormalized data is when all information is stored in a single table, often with repeating data. For example:
| Customer | Phone | Order | Amount |
|---|---|---|---|
| Ivan | 123456 | Item1 | 1000 |
| Ivan | 123456 | Item2 | 1500 |
Here, customer data is repeated for each order, leading to redundancy and difficulties in updating.