<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_view(self, name, expr, database=None):
 """ Create an MapD view from a table expression Parameters name : string expr : ibis TableExpr database : string, default None """

        ast = self._build_ast(expr, MapDDialect.make_context())
        select = ast.queries[0]
        statement = ddl.CreateView(name, select, database=database)
        self._execute(statement)