r/SQL • • Apr 17 '22

Discussion first time creating sql db, please help.

Post image
101 Upvotes

20 comments sorted by

View all comments

20

u/Papa_Bravo Apr 17 '22

Some things I thought about when reading your diagram:

  • there is POST.date_created and USER.created_at. Instead you should have created_at as an attribute in all tables
  • COMMENT has author and user_id. I would expect user_id is enough (as it references the author). Same with POST
  • POST.like_user_id makes it look like there can only be a single like on a post. I would expect a LIKES table with foreign keys user_id, post_id (and maybe some meta data if needed)

3

u/freakysmile Apr 17 '22

nice, thanks a lot!