| Version 5 (modified by , 5 weeks ago) ( diff ) |
|---|
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
- STORY(story_ID, mature_content, short_description, image, content, user_ID*)
- user_ID references WRITER
- status (multi-valued attribute, see table STATUS)
- STATUS(story_ID*, status)
- story_ID references STORY
- USER(user_ID, username, email, name, surname, password)
- ADMIN(user_ID*)
- user_ID references USER
- REGULAR_USER(user_ID*)
- user_ID references USER
- WRITER(user_ID*, created_story)
- user_ID references USER
- CHAPTER(chapter_ID, chapter_name, title, content, word_count, rating, published_at, view_count, story_ID*)
- story_ID references STORY
- GENRE(genre_ID, name)
- READING_LIST(list_ID, name, content, is_public, user_ID*)
- user_ID references USER
- NOTIFICATION(notification_ID, content, content_type, user_ID*)
- user_ID references USER
- AI_SUGGESTION(suggestion_ID, original_text, suggested_text, suggestion_type, accepted, story_ID*)
- story_ID references STORY
- LIKE(user_ID*, story_ID*)
- user_ID references USER
- story_ID references STORY
- COMMENT(comment_ID, content, user_ID*, story_ID*)
- user_ID references USER
- story_ID references STORY
- COLLABORATION(user_ID*, story_ID*, role, permission_level)
- user_ID references USER
- story_ID references STORY
- role (multi-valued attribute, see table ROLE)
- permission_level (multi-valued attribute, see table PERMISSION_LEVEL)
- ROLE(user_ID*, story_ID*, role)
- user_ID references COLLABORATION
- story_ID references COLLABORATION
- PERMISSION_LEVEL(user_ID*, story_ID*, permission_level)
- user_ID references COLLABORATION
- story_ID references COLLABORATION
- HAS_GENRE(story_ID*, genre_ID*)
- story_ID references STORY
- genre_ID references 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
Attachments (5)
-
relational_schema.png
(109.3 KB
) - added by 5 weeks ago.
Added relational schema
-
schema_creation.sql
(8.5 KB
) - added by 4 weeks ago.
Added schema creation script.
- relational_schema.2.png (119.5 KB ) - added by 4 weeks ago.
-
data_load.sql
(24.2 KB
) - added by 4 weeks ago.
Added data load script.
- relational_schema.3.png (122.7 KB ) - added by 3 weeks ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.
