Normalization คือกระบวนการจัดระเบียบข้อมูลเพื่อ ลดความซ้ำซ้อน (redundancy) และเพิ่มความถูกต้องสมบูรณ์ของข้อมูล โดยการแยกข้อมูลออกเป็นตารางที่สัมพันธ์กัน ตามชุดของ "normal forms" เป้าหมายคือ ข้อมูลแต่ละชิ้นถูกจัดเก็บไว้ เพียงครั้งเดียว หลีกเลี่ยงการซ้ำซ้อนและความผิดปกติ (anomalies) ที่ตามมา
ปัญหา: ตารางที่ไม่ได้ normalize (มีความซ้ำซ้อน)
❌ orders table with everything in one place — data is DUPLICATED:
order_id | customer_name | customer_email | product | price
1 | Ann | [email protected] | Phone | 999
2 | Ann | [email protected] | Case | 20 ← Ann's info repeated!
Problems (anomalies):
✗ UPDATE anomaly — change Ann's email → must update EVERY one of her orders
✗ INSERT anomaly — can't add a customer without an order
✗ DELETE anomaly — deleting Ann's last order loses her info entirely
✗ Wasted storage and inconsistency risk
