On Demand Agility interview question

database: view vs materialized view, asked 1 query for which solution need to use aggregate function with groupby clause, etc