Pine Labs interview question

basic sql