Meta interview question

Some SQL join, aggregation, etc