Deloitte interview question

HQL basic query