I doubt the code in question will work. Reason: in most cases foreign key constraint violation will not allow to delete ACCOUNT table row if ADDRESS row refers to it.
Developer needs set DDL for foreigh key on ADDRESS as:
You are right but the question doesn't say that there is a foreign key constraint created in the database (although logically I agree that there is.) But there is a possibility that tables are not created by the persistent provider (legacy tables) and there is no FK constraint.
So I think for the purpose of the question, it is ok.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.