When Creating a Foreign Key Relationship
What you need to check are the referential integrity constraints. 

If you want to delete the parent key there are around four options on how you want to deal with the children keys:


NO ACTION which raises an error and does not delete the parent key (rolls back). 
CASCADE which will carry on and delete all the child keys referred by that parent key,  leaving no orphans. 
SET NULL which will set all the child keys to null values.
SET DEFAULT sets the child keys to the specified default value.