InfoCepts Interview Question

Question on SQL using ground by and having