Results 1 to 4 of 4
  1. #1
    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?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    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

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •