Noom Interview Question

SQL joins, subqueries. Java coding