Delete and Update of Foreign keys I'm working on a school project. And I'm required to implement it using Java-EE and SQL Server. I want the design to withstand any kind of faulty user requests. My questions are how should I design the tables and the relationships such that deletions are safe.
In addition i want to know how to log these changes.
The trick is to not actually delete rows, but to set an "IsDeleted" column to 1. That way, referring records remain unorphaned. 

Updates are more interesting. Do you need to have the referring record still refer to the old record, or the new version?