delete consultas when referenced by sql.