I have an employees table in a database, and I want to link an employee to their manager:
Employee Table
- employee_id
- first_name
- last_name
- manager_id
If the manager_id is just another row in the same table where the manager has it as their employee, what is the best way to enforce that if I delete an employee it verifies that this employee is not the manager of another employee?
Is there a better best practice for this?