In order to accurately track employee responses and activities (along with work history) within a company or organization, it would be best to NOT delete them from the intersection table, because then you will also have to UPDATE the TICKETS table.
Like in the table example I gave above, you should simply use a column called EndDate (DATE, NULL, Default = 0000-00-00) to track when that employees end their tenure in that particular department.
Then in your UPDATE script ("delete" as you call it), you should simply query the intersection table to find that employee's USERID and DEPARTMENTID, then UPDATE the EndDate column.
Also, you should not be in the habit of "deleting" users from your Users table either in order to accurately track responses within your trouble ticket system. Simply reference the EndDate field in the intersection table to acknowledge whether the user account is active or not -OR- you could add another field/column in the Users table that "flags" whether the account is active or not.
========================================
Buh Bye!
Cheers,
Me
Like in the table example I gave above, you should simply use a column called EndDate (DATE, NULL, Default = 0000-00-00) to track when that employees end their tenure in that particular department.
Then in your UPDATE script ("delete" as you call it), you should simply query the intersection table to find that employee's USERID and DEPARTMENTID, then UPDATE the EndDate column.
Also, you should not be in the habit of "deleting" users from your Users table either in order to accurately track responses within your trouble ticket system. Simply reference the EndDate field in the intersection table to acknowledge whether the user account is active or not -OR- you could add another field/column in the Users table that "flags" whether the account is active or not.
========================================
Buh Bye!
Cheers,
Me