Pine Labs Interview Question

basic sql