> For the complete documentation index, see [llms.txt](https://docs.daita.ch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.daita.ch/usage/relational/view/create-view.md).

# CREATE VIEW

```typescript
await client.exec({
   createView: 'MountainsInSwitzerland',
   orReplace: true,
   as: {
       select: all(Mountain),
       from: table(Mountain),
       where: equal(field(Mountain, 'country'), 'CH'),
   }
});

// sql: CREATE OR REPLACE VIEW "MountainsInSwitzerland" AS
//      SELECT "Mountain".* FROM "Mountain"
//      WHERE "Mountain"."country" = 'CH'
```
