> For the complete documentation index, see [llms.txt](https://vikram-bajaj.gitbook.io/cs-gy-6083-principles-of-database-systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vikram-bajaj.gitbook.io/cs-gy-6083-principles-of-database-systems/main-1/sql/dml-commands/with.md).

# With

The **with** clause provides a way of defining a temporary relation whose definition is available only to the query in which the with clause occurs.

Ex. Find all departments with the maximum budget:

```
with max_budget (value) as (select max(budget) from department)
select budget from department, max_budget
where department.budget = max_budget.value;
```
