Lokal App interview question

Solving a query with Given 4 tables