SLK Group interview question

Based on the SQL queries