%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% flowchart LR subgraph Era1["ยุคข้อมูลซ้ำ / Duplicated Data"] A["เก็บซ้ำหลายที่แก้ไขยาก"] end subgraph Era2["ยุค ERD / Relationship Design"] B["Entity Relationship Diagramออกแบบก่อนสร้าง"] C["Primary/Foreign Keyเชื่อมความสัมพันธ์"] end subgraph Era3["ยุค Optimization / Scalable Schema"] D["Normalizationลดความซ้ำ"] E["Indexค้นหาเร็วขึ้น"] end A --> B --> C --> D --> E
%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% erDiagram USERS ||--o{ POSTS : "เขียน / writes" USERS ||--|| PROFILES : "มี / has" STUDENTS ||--o{ ENROLLMENTS : "ลงทะเบียน / enrolls" COURSES ||--o{ ENROLLMENTS : "มีผู้เรียน / has" USERS { int id PK string name string email } POSTS { int id PK int user_id FK string title } PROFILES { int id PK int user_id FK string bio } STUDENTS { int id PK string name } COURSES { int id PK string title } ENROLLMENTS { int student_id FK int course_id FK }