> 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/basic-query-structure.md).

# Basic Query Structure

Queries in SQL have the following query structure:

```
select A1, A2, ..., An
from r1, r2, ..., rm
where P
```

This is equivalent to the following relational algebra expression, and will output a relation.

$$\Pi \_{A\_1, A\_2, ..., A\_n} (\sigma \_P (r\_1 \times r\_2 \times ...\times , r\_m))$$
