Changes between Version 15 and Version 16 of P5
- Timestamp:
- 04/21/26 00:25:36 (12 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
P5
v15 v16 92 92 93 93 USERS(user_id, username, email, user_name, surname, password, user_created_at, user_updated_at) → simple primary key user_id, so it satisfies 2NF. 94 94 95 STORY(story_id, mature_content, short_description, image, story_content, user_id, story_created_at, story_updated_at) → simple primary key story_id, so it satisfies 2NF. 96 95 97 CHAPTER(chapter_id, chapter_number, chapter_name, title, chapter_content, word_count, rating, published_at, view_count, story_id, chapter_created_at, chapter_updated_at) → composite candidate key {story_id, chapter_number} exists, but all other attributes depend on the full key, not a subset. No partial dependencies, so it satisfies 2NF. 98 96 99 GENRE(genre_id, genre_name) → simple primary key genre_id, so it satisfies 2NF. 100 97 101 READING_LIST(list_id, list_name, list_content, is_public, user_id, list_created_at, list_updated_at) → simple primary key list_id, so it satisfies 2NF. 102 98 103 NOTIFICATION(notification_id, notification_content, is_read, type, link, notification_created_at) → simple primary key notification_id, so it satisfies 2NF. 104 99 105 AI_SUGGESTION(suggestion_id, original_text, suggested_text, accepted, suggestion_created_at, applied_at, story_id) → simple primary key suggestion_id, so it satisfies 2NF. 106 100 107 COMMENT(comment_id, comment_content, user_id, story_id, comment_created_at, comment_updated_at) → simple primary key comment_id, so it satisfies 2NF. 108 101 109 STATUS(story_id, status) → There are no other attributes, so it satisfies 2NF. 110 102 111 CONTENT_TYPE(notification_id, content_type) → There are no other attributes, so it satisfies 2NF. 112 103 113 SUGGESTION_TYPE(suggestion_id, suggestion_type) → There are no other attributes, so it satisfies 2NF. 114 104 115 LIKES(user_id, story_id, like_created_at) → like_created_at depends on {user_id, story_id} together, so it satisfies 2NF. 116 105 117 COLLABORATION(user_id, story_id, collab_created_at) → collab_created_at depends on {user_id, story_id} together, so it satisfies 2NF. 118 106 119 ROLES(user_id, story_id, roles) → There are no other attributes, so it satisfies 2NF. 120 107 121 PERMISSION_LEVEL(user_id, story_id, permission_level) → There are no other attributes, so it satisfies 2NF. 122 108 123 HAS_GENRE(story_id, genre_id) → There are no other attributes, so it satisfies 2NF. 124 109 125 READING_LIST_ITEMS(list_id, story_id, added_at) → added_at depends on {list_id, story_id} together, so it satisfies 2NF. 126 110 127 NOTIFY(user_id, story_id, notification_id) → There are no other attributes, so it satisfies 2NF. 128 111 129 NEED_APPROVAL(suggestion_id, story_id, chapter_id) → There are no other attributes, so it satisfies 2NF. 130 112 131 Since there are no partial dependencies in any of the resulting tables, this schema satisfies 2NF. 113 132 … … 116 135 117 136 USERS(user_id, username, email, ...) — FD2: username → user_id and FD3: email → user_id exist, but username and email are both candidate keys, not non-prime attributes. No transitive dependency. 137 118 138 STORY(story_id, ..., user_id, ...) — user_id is a non-prime attribute, but within this relation user_id does not determine any other attribute. No transitive dependency. 139 119 140 CHAPTER(chapter_id, ..., story_id, ...) — story_id is a non-prime attribute, but within this relation story_id does not determine any other attribute. No transitive dependency. 141 120 142 GENRE(genre_id, genre_name) — both attributes are candidate keys. No transitive dependency. 143 121 144 READING_LIST(list_id, ..., user_id, ...) — user_id is a non-prime attribute, but within this relation user_id does not determine any other attribute. No transitive dependency. 145 122 146 NOTIFICATION, AI_SUGGESTION, COMMENT — simple primary keys, no non-prime attribute determines another. No transitive dependencies. 147 123 148 All remaining tables — no non-prime attributes at all, or single non-prime attribute depending on the full composite key. No transitive dependencies. 124 149 125 150 Since no transitive dependencies were found in any relation, all relations already satisfy 3NF. 151 126 152 === 3NF Decomposition 127 153 Since no transitive dependencies were identified in the 3NF Check, no decomposition is required. … … 130 156 We analyze each relation for BCNF violations: 131 157 USERS(user_id, username, email, user_name, surname, password, user_created_at, user_updated_at) — FD2: username → user_id and FD3: email → user_id exist, but username and email are both superkeys (their closure contains all attributes of USERS). No BCNF violation. 158 132 159 STORY(story_id, ...) — only FD4 applies, story_id is the sole candidate key and the only determinant. No BCNF violation. 160 133 161 CHAPTER(chapter_id, ...) — FD5: chapter_id → all others, FD6: {story_id, chapter_number} → chapter_id. Both chapter_id and {story_id, chapter_number} are candidate keys, so both are superkeys. No BCNF violation. 162 134 163 GENRE(genre_id, genre_name) — FD7: genre_id → genre_name and FD8: genre_name → genre_id. Both are candidate keys, so both are superkeys. No BCNF violation. 164 135 165 READING_LIST(list_id, ...) — only FD9 applies, list_id is the only determinant and is the candidate key. No BCNF violation. 166 136 167 NOTIFICATION(notification_id, ...) — only FD10 applies, notification_id is the only determinant and is the candidate key. No BCNF violation. 168 137 169 AI_SUGGESTION(suggestion_id, ...) — only FD11 applies, suggestion_id is the only determinant and is the candidate key. No BCNF violation. 170 138 171 COMMENT(comment_id, ...) — only FD12 applies, comment_id is the only determinant and is the candidate key. No BCNF violation. 172 139 173 All remaining tables — no non-trivial functional dependencies beyond the primary key. No BCNF violations. 174 140 175 Since every determinant in every relation is a superkey, all relations satisfy BCNF. 176 141 177 === BCNF Decomposition 142 178 Since no BCNF violations were identified in the BCNF Check, no decomposition is required
