Meta interview question

I had to write SQL and python code based on the questions provided.