CVS Health interview question

Solve a few sql code if not solve some code in python