G42 interview question

Task related to SQL Queries