If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > ERD for a blogging system...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-26-11, 15:12
uperkurk uperkurk is offline
Registered User
 
Join Date: Nov 2011
Posts: 8
ERD for a blogging system...

Hey guys, I have to make a blogging system and I have to make the ERD for it and this is what I have so far

Editors
[P]Username
First Name
Last Name
Date of Birth

Blog
[P]Blog Number
Date Time of Blog
Blog Category
Blog Title

Post
[P]Post Number
Post Content
Date Time of Post

Comment
[P]Comment Number
Posters Username
Date Time of Comment
Posters Email


I am trying to think of some other things which can be added to the entities I have. The way I have it is:

Each editor can have 1 blog
Each blog can have many posts
Each post can have many comments
Comments can be anonymous (So no username or email required)

Does this seem logical? Also one other thing is im abit confused that the editor table has a date of birth field because it isnt really nessasary to display the date of birth of the editor?
Reply With Quote
  #2 (permalink)  
Old 11-26-11, 21:14
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
who really cares when an editor was born

what's more important is identifying who wrote a post

also, posts typically have titles, too

as for the comments, how do you know which post a comment refers to?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-26-11, 21:23
uperkurk uperkurk is offline
Registered User
 
Join Date: Nov 2011
Posts: 8
Thats true... so maybe I need to add another field to relate the posts and comments together but im not sure what do do?

This is what I have so far...

http://i43.tinypic.com/4rvl2h.jpg
Reply With Quote
  #4 (permalink)  
Old 11-26-11, 22:08
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by uperkurk View Post
... but im not sure what do do?
do some research on foreign keys

your diagram says that editor-makes-post is many-to-many, but are you sure you want to allow a single post to be made by more than one editor?

similarly, your diagram says that post-have-comment is many-to-many, but are you sure you want to allow a single comment to be made on more than one post?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On