Meta Interview Question

2 sql questions and 2 cases