CVS Health Interview Question

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