| | 1 | = Normalization and design improvements |
| | 2 | |
| | 3 | In my initial DDL design, several entities shared the same attribute names, so I renamed them to make the design clearer and eliminate any ambiguous information. |
| | 4 | The changes I made follow the format (relation_name_specification): |
| | 5 | content → story_content, chapter_content, comment_content, notification_content, list_content |
| | 6 | created_at → user_created_at, story_created_at, chapter_created_at, list_created_at, notification_created_at, like_created_at, comment_created_at, collab_created_at, suggestion_created_at |
| | 7 | updated_at → user_updated_at, story_updated_at, chapter_updated_at, list_updated_at, comment_updated_at |
| | 8 | name → user_name, genre_name, list_name |
| | 9 | |
| | 10 | After these changes, I obtained the following de-normalized relation: |
| | 11 | === Global Relation |
| | 12 | R = {user_id, username, email, user_name, surname, password, user_created_at, |
| | 13 | user_updated_at, story_id, mature_content, short_description, image, story_content, |
| | 14 | story_created_at, story_updated_at, status, chapter_id, chapter_number, chapter_name, |
| | 15 | title, chapter_content, word_count, rating, published_at, view_count, chapter_created_at, |
| | 16 | chapter_updated_at, genre_id, genre_name, list_id, list_name, list_content, is_public, |
| | 17 | list_created_at, list_updated_at, added_at, notification_id, notification_content, is_read, |
| | 18 | type, link, notification_created_at, content_type, suggestion_id, original_text, |
| | 19 | suggested_text, accepted, applied_at, suggestion_created_at, suggestion_type, comment_id, |
| | 20 | comment_content, comment_created_at, comment_updated_at, roles, permission_level, |
| | 21 | collab_created_at, like_created_at} |
| | 22 | |
| | 23 | == Functional Dependencies: |
| | 24 | |
| | 25 | - FD1: user_id → username, email, user_name, surname, password, user_created_at, user_updated_at |
| | 26 | - FD2: username → user_id |
| | 27 | - FD3: email → user_id |
| | 28 | - FD4: story_id → mature_content, short_description, image, story_content, user_id, story_created_at, story_updated_at |
| | 29 | - FD5: chapter_id → chapter_number, chapter_name, title, chapter_content, word_count, rating, published_at, view_count, story_id, chapter_created_at, chapter_updated_at |
| | 30 | - FD6: {story_id, chapter_number} → chapter_id |
| | 31 | - FD7: genre_id → genre_name |
| | 32 | - FD8: genre_name → genre_id |
| | 33 | - FD9: list_id → list_name, list_content, is_public, user_id, list_created_at, list_updated_at |
| | 34 | - FD10: notification_id → notification_content, is_read, recipient_user_id, type, link, notification_created_at |
| | 35 | - FD11: suggestion_id → original_text, suggested_text, accepted, suggestion_created_at, applied_at, story_id |
| | 36 | - FD12:comment_id → comment_content, user_id, story_id, comment_created_at, comment_updated_at |
| | 37 | - FD13: {user_id, story_id} → like_created_at |
| | 38 | - FD14: {user_id, story_id} → collab_created_at |
| | 39 | - FD15:{list_id, story_id} → added_at -> / |