I took an example ERD image used as a reference,it's a class diagram modeling a simple entities relationship for a supermarket pay database.
I ask if what I found in it there is a flaw. You can find the diagrams, with the one amended from me put beside HERE [http://www.orafaq.com/forum/fa/10013/147115/], with indication of what I think is a flaw.
One more point: if I'm interested in tracking shifts worked over time in the shifts table, I'm still able to do so.
Any comment would be appreciated.
Thank you HamidHelal , but then, I discovered a limitation: if my Shifts table traces shifts over time (that's reasonable), then if I want to be able to change a department for a given user ID, since the existence of referential constraints with the parent Users table (that is not a fact table), I should first set nulls or 'cascading' delete the child rows in Shifts, and then I can change the department in Users table, thus I'm no longer able to trace past shifts for that DepartmentID/UserID....
Since my maniacal inclination for using as many constraints as possible for enforcing integrity at database level, if I wanted to fix and enforce the mentioned limit at database foreign key/check level, I'm still not able to answer, I'm doing some tests without results for now. Obviously I could perform all checks programmatically, at code level....
Edited by: user7095235 on 4-apr-2012 12.33
Edited by: user7095235 on 4-apr-2012 12.36