Virtue Infotek Interview Question

oops concepts sql query