Blog Management System

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Blog Management System

Blog Management System. This system will involve managing


blog posts, categories, authors, and user comments.

User Table:
 user_id (Primary Key)
 username
 password (hashed and salted)
 email
 role_id (Foreign Key referencing Role Table)

Role Table:
 role_id (Primary Key)
 role_name (e.g., Admin, Author, Reader)

Author Table:
 author_id (Primary Key)
 user_id (Foreign Key referencing User Table)
 bio
Category Table:
 category_id (Primary Key)
 category_name

Post Table:
 post_id (Primary Key)
 title
 content
 author_id (Foreign Key referencing Author Table)
 category_id (Foreign Key referencing Category Table)
 publish_date
 status (e.g., draft, published)

Comment Table:
 comment_id (Primary Key)
 user_id (Foreign Key referencing User Table)
 post_id (Foreign Key referencing Post Table)
 comment_date
 comment_text

Relationships to be defined as:

 A User can have one Role, but a Role can be associated


with multiple Users. (One-to-Many relationship between
Role and User)
 An Author is associated with one User, but a User can be
associated with multiple Authors (e.g., if a user writes
under different pen names). (One-to-Many relationship
between User and Author)

 An Author can have multiple Posts, but each Post is


written by one Author. (One-to-Many relationship
between Author and Post)

 A Category can have multiple Posts, and a Post can


belong to one Category. (One-to-Many relationship
between Category and Post)

 A Post can have multiple Comments, and a Comment is


associated with one Post. (One-to-Many relationship
between Post and Comment)

You might also like