Smoothstack interview question

Asked how to solve a database query question using sql