2. Comments, and posts that belong to nobody · Done when

Done when

  • The diagram draws three relationship lines: posts → users, comments → posts, comments → users.
  • You can answer: a user with 3 posts, each with 5 comments from other people, deletes their account. How many rows disappear, and from which tables?
  • You can answer: a news site wants to keep comments from deleted accounts and show them as "[deleted user]". Which ON DELETE rule would it use on comments.user_id?