Meta Interview Question

Various scenarios were given and I was asked to write sql statements for that and the same was with python