Changes between Version 15 and Version 16 of P5


Ignore:
Timestamp:
04/21/26 00:25:36 (12 days ago)
Author:
211099
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • P5

    v15 v16  
    9292
    9393USERS(user_id, username, email, user_name, surname, password, user_created_at, user_updated_at) → simple primary key user_id, so it satisfies 2NF.
     94
    9495STORY(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
    9597CHAPTER(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
    9699GENRE(genre_id, genre_name) → simple primary key genre_id, so it satisfies 2NF.
     100
    97101READING_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
    98103NOTIFICATION(notification_id, notification_content, is_read, type, link, notification_created_at) → simple primary key notification_id, so it satisfies 2NF.
     104
    99105AI_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
    100107COMMENT(comment_id, comment_content, user_id, story_id, comment_created_at, comment_updated_at) → simple primary key comment_id, so it satisfies 2NF.
     108
    101109STATUS(story_id, status) → There are no other attributes, so it satisfies 2NF.
     110
    102111CONTENT_TYPE(notification_id, content_type) → There are no other attributes, so it satisfies 2NF.
     112
    103113SUGGESTION_TYPE(suggestion_id, suggestion_type) → There are no other attributes, so it satisfies 2NF.
     114
    104115LIKES(user_id, story_id, like_created_at) → like_created_at depends on {user_id, story_id} together, so it satisfies 2NF.
     116
    105117COLLABORATION(user_id, story_id, collab_created_at) → collab_created_at depends on {user_id, story_id} together, so it satisfies 2NF.
     118
    106119ROLES(user_id, story_id, roles) → There are no other attributes, so it satisfies 2NF.
     120
    107121PERMISSION_LEVEL(user_id, story_id, permission_level) → There are no other attributes, so it satisfies 2NF.
     122
    108123HAS_GENRE(story_id, genre_id) → There are no other attributes, so it satisfies 2NF.
     124
    109125READING_LIST_ITEMS(list_id, story_id, added_at) → added_at depends on {list_id, story_id} together, so it satisfies 2NF.
     126
    110127NOTIFY(user_id, story_id, notification_id) → There are no other attributes, so it satisfies 2NF.
     128
    111129NEED_APPROVAL(suggestion_id, story_id, chapter_id) → There are no other attributes, so it satisfies 2NF.
     130
    112131Since there are no partial dependencies in any of the resulting tables, this schema satisfies 2NF.
    113132
     
    116135
    117136USERS(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
    118138STORY(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
    119140CHAPTER(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
    120142GENRE(genre_id, genre_name) — both attributes are candidate keys. No transitive dependency.
     143
    121144READING_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
    122146NOTIFICATION, AI_SUGGESTION, COMMENT — simple primary keys, no non-prime attribute determines another. No transitive dependencies.
     147
    123148All remaining tables — no non-prime attributes at all, or single non-prime attribute depending on the full composite key. No transitive dependencies.
    124149
    125150Since no transitive dependencies were found in any relation, all relations already satisfy 3NF.
     151
    126152=== 3NF Decomposition
    127153Since no transitive dependencies were identified in the 3NF Check, no decomposition is required.
     
    130156We analyze each relation for BCNF violations:
    131157USERS(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
    132159STORY(story_id, ...) — only FD4 applies, story_id is the sole candidate key and the only determinant. No BCNF violation.
     160
    133161CHAPTER(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
    134163GENRE(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
    135165READING_LIST(list_id, ...) — only FD9 applies, list_id is the only determinant and is the candidate key. No BCNF violation.
     166
    136167NOTIFICATION(notification_id, ...) — only FD10 applies, notification_id is the only determinant and is the candidate key. No BCNF violation.
     168
    137169AI_SUGGESTION(suggestion_id, ...) — only FD11 applies, suggestion_id is the only determinant and is the candidate key. No BCNF violation.
     170
    138171COMMENT(comment_id, ...) — only FD12 applies, comment_id is the only determinant and is the candidate key. No BCNF violation.
     172
    139173All remaining tables — no non-trivial functional dependencies beyond the primary key. No BCNF violations.
     174
    140175Since every determinant in every relation is a superkey, all relations satisfy BCNF.
     176
    141177=== BCNF Decomposition
    142178Since no BCNF violations were identified in the BCNF Check, no decomposition is required