--try
alter table comment
add constraint fk_UserId FOREIGN KEY (`Userid`) REFERENCES `users` (`Id`) ON DELETE CASCADE ON UPDATE CASCADE,
add constraint fk_NewsID FOREIGN KEY (`NewsID`) REFERENCES `news` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
alter table comment
add constraint fk_UserId FOREIGN KEY (`Userid`) REFERENCES `users` (`Id`) ON DELETE CASCADE ON UPDATE CASCADE,
add constraint fk_NewsID FOREIGN KEY (`NewsID`) REFERENCES `news` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
alter table comment
add constraint fk_UserId FOREIGN KEY (Userid) REFERENCES users(Id) ON DELETE CASCADE ON UPDATE CASCADE,
constraint fk_NewsID FOREIGN KEY (NewsID) REFERENCES news (ID) ON DELETE CASCADE ON UPDATE CASCADE
gocreate table B(BID int not null primary key, name varchar(10))
gocreate table C(CID int, AID int, BID int)
goalter table C
add constraint fk_AID foreign key(AID) references A(AID) on delete cascade on update cascade,
constraint fk_BID foreign key(BID) references B(BID) on delete cascade on update cascade
godrop table C
drop table A, B
go