| Version 21 (modified by , 13 days ago) ( diff ) |
|---|
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
- USER (
user_ID,username,email,user_name,surname,password,user_created_at,user_updated_at)
- ADMIN (
user_ID*(USER),assigned_at)
- REGULAR_USER (
user_ID*(USER),joined_at)
- WRITER (
user_ID*(USER),bio)
- STORY (
story_ID,title,mature_content,short_description,image,story_content,status,user_ID*(WRITER),story_created_at,story_updated_at)
- CHAPTER (
chapter_ID,chapter_number,chapter_name,title,chapter_content,word_count,rating,published_at,view_count,story_ID*(STORY),chapter_created_at,chapter_updated_at)
- GENRE (
genre_ID,genre_name)
- READING_LIST (
list_ID,list_name,list_content,is_public,user_ID*(USER),list_created_at,list_updated_at)
- NOTIFICATION (
notification_ID,notification_content,content_type,is_read,link,user_ID*(USER),story_ID*(STORY),notification_created_at)
- AI_SUGGESTION (
suggestion_ID,original_text,suggested_text,suggestion_type,accepted,suggestion_created_at,applied_at,story_ID*(STORY))
- LIKE (
user_ID*(USER),story_ID*(STORY),liked_at)
- COMMENT (
comment_ID,comment_content,user_ID*(USER),story_ID*(STORY),comment_created_at,comment_updated_at)
- COLLABORATION (
user_ID*(USER),story_ID*(STORY),role,permission_level,collab_created_at)
- HAS_GENRE (
story_ID*(STORY),genre_ID*(GENRE))
- READING_LIST_ITEMS (
list_ID*(READING_LIST),story_ID*(STORY),added_at)
- NEED_APPROVAL (
suggestion_ID*(AI_SUGGESTION),story_ID*(STORY),chapter_ID*(CHAPTER))
DDL script for creation and deletion of tables
DML script for inserting data in the tables
Relational diagram made in DBeaver
Attachments (15)
-
relational_schema.png
(109.3 KB
) - added by 7 months ago.
Added relational schema
-
schema_creation.sql
(8.5 KB
) - added by 7 months ago.
Added schema creation script.
- relational_schema.2.png (119.5 KB ) - added by 7 months ago.
-
data_load.sql
(24.2 KB
) - added by 7 months ago.
Added data load script.
- relational_schema.3.png (122.7 KB ) - added by 6 months ago.
- schema_creation.2.sql (9.0 KB ) - added by 6 months ago.
- data_load.2.sql (25.3 KB ) - added by 6 months ago.
- relational_schema_updated.png (505.9 KB ) - added by 2 months ago.
- schema_creation.3.sql (9.4 KB ) - added by 2 months ago.
- data_load.3.sql (25.5 KB ) - added by 2 months ago.
- schema_creation.4.sql (7.3 KB ) - added by 13 days ago.
- data_load.4.sql (25.1 KB ) - added by 13 days ago.
- relational_schema (2).png (571.0 KB ) - added by 13 days ago.
- schema_creation.5.sql (7.3 KB ) - added by 13 days ago.
- relational_schema (2).2.png (551.6 KB ) - added by 13 days ago.
Note:
See TracWiki
for help on using the wiki.

.png)