= Relational Design for ChapterX = == Notation == * Primary keys are marked with __'''bold and underlined'''__ * Required attributes are marked with '''bold''' * Foreign keys are marked with * and __underlined__ == Tables == = Relational Design for ChapterX = == Notation == * Primary keys are bolded and underlined. * Foreign keys are marked with `*` at the end of their name and the referenced entity is written in parentheses. * Complex attributes are bolded, and their containing attributes are following them, made italic. * Multivalued attributes have their own table == Tables == 1. **USER** (**__{{{user_ID}}}__**, {{{username}}}, {{{email}}}, {{{name}}}, {{{surname}}}, {{{password}}}) 2. **ADMIN** (**__{{{user_ID*}}}__** (USER)) 3. **REGULAR_USER** (**__{{{user_ID*}}}__** (USER)) 4. **WRITER** (**__{{{user_ID*}}}__** (USER), {{{created_story}}}) 5. **STORY** (**__{{{story_ID}}}__**, {{{mature_content}}}, {{{short_description}}}, {{{image}}}, {{{content}}}, **__{{{user_ID*}}}__** (WRITER)) * status (multi-valued attribute, see table **STATUS**) 6. **STATUS** (**__{{{story_ID*}}}__** (STORY), **__{{{status}}}__**) 7. **CHAPTER** (**__{{{chapter_ID}}}__**, {{{chapter_name}}}, {{{title}}}, {{{content}}}, {{{word_count}}}, {{{rating}}}, {{{published_at}}}, {{{view_count}}}, **__{{{story_ID*}}}__** (STORY)) 8. **GENRE** (**__{{{genre_ID}}}__**, {{{name}}}) 9. **READING_LIST** (**__{{{list_ID}}}__**, {{{name}}}, {{{content}}}, {{{is_public}}}, **__{{{user_ID*}}}__** (USER)) 10. **NOTIFICATION** (**__{{{notification_ID}}}__**, {{{content}}}, {{{content_type}}}, **__{{{user_ID*}}}__** (USER)) 11. **AI_SUGGESTION** (**__{{{suggestion_ID}}}__**, {{{original_text}}}, {{{suggested_text}}}, {{{suggestion_type}}}, {{{accepted}}}, **__{{{story_ID*}}}__** (STORY)) 12. **LIKE** (**__{{{user_ID*}}}__** (USER), **__{{{story_ID*}}}__** (STORY)) 13. **COMMENT** (**__{{{comment_ID}}}__**, {{{content}}}, **__{{{user_ID*}}}__** (USER), **__{{{story_ID*}}}__** (STORY)) 14. **COLLABORATION** (**__{{{user_ID*}}}__** (USER), **__{{{story_ID*}}}__** (STORY), {{{role}}}, {{{permission_level}}}) * role (multi-valued attribute, see table **ROLE**) * permission_level (multi-valued attribute, see table **PERMISSION_LEVEL**) 15. **ROLE** (**__{{{user_ID*}}}__** (COLLABORATION), **__{{{story_ID*}}}__** (COLLABORATION), **__{{{role}}}__**) 16. **PERMISSION_LEVEL** (**__{{{user_ID*}}}__** (COLLABORATION), **__{{{story_ID*}}}__** (COLLABORATION), **__{{{permission_level}}}__**) 17. **HAS_GENRE** (**__{{{story_ID*}}}__** (STORY), **__{{{genre_ID*}}}__** (GENRE)) === DDL script for creation and deletion of tables === === DML script for inserting data in the tables === === Relational diagram made in DBeaver === = AI Usage for Relational Design =