> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindsdb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a View

## Description

The `createView()` function creates a view in MindsDB.

## Syntax

Here is the syntax:

```
const viewSelect = `SELECT t.sqft, t.location, m.rental_price
  FROM mysql_demo_db.home_rentals as t
  JOIN mindsdb.home_rentals_model as m`;
    
const predictionsView = await MindsDB.Views.createView(
  'view_name',
  'project_name',
  viewSelect);
```
