Added SQL buildDelete function