= 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 the, made italic. * Multivalued attributes have their own table == Tables == 1. STORY(__story_ID__, mature_content, short_description, image, content, user_ID*(WRITER)) * status (multi-valued attribute, see table STATUS) 2. STATUS(__story_ID*(STORY)__, __status__) 3. USER(__user_ID__, username, email, name, surname, password) 4. ADMIN(__user_ID*(USER)__) 5. REGULAR_USER(__user_ID*(USER)__) 6. WRITER(__user_ID*(USER)__, created_story) 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 =