1

i have 3 table, user, topic and comment. I design database for my website. One user has many topic (or article) One topic (or article) has many comment One user has many comment

i create relationship for them. after i set Insert and And Update Specification as cascade.

I want if i delete one user then topic of this user and comment of user will delete If i delete one topic then all comment of topic will delete by cascade

my diagram

juergen d
  • 201,996
  • 37
  • 293
  • 362
lecuong92
  • 43
  • 7

1 Answers1

0

@lecuong92....

  • While creating the relationship between the tables ... you should mention delete cascade....
  • Then, once you delete the records of parent table, then records from the child table will automatically get deleted....
  • Use : "ON DELETE CASCADE" clause
rfornal
  • 5,072
  • 5
  • 30
  • 42
karan arora
  • 176
  • 9