biily b
2010-12-04 14:17:37 UTC
I need to write SQL to add or delete an employee to the database. If I add one that's easy, I just add a row to the employee table. Deleting one is harder because if I want to delete an employee and he has been involved in sales or rentals his ID will be in the SALE or RENTAL table and I get foreign key constraint errors in trying to delete him from the employee table.
How can I write SQL to delete an employee from the employee table and preferrably leave all of his associated transactions in place in the SALES or RENTAL table. I'm using Oracle SQL developer by the way