Smoothstack Interview Question

Asked how to solve a database query question using sql