# SQL

Doltgres is a full-featured SQL database, akin to [Postgres](https://www.postgresql.org/) or [MySQL](https://www.mysql.com/).

Doltgres implements the Postgres SQL dialect. You connect to Doltgres using a Postgres client. The goal is for Doltgres to be a drop in replacement for Postgres.

Doltgres has [databases](/concepts/sql/databases.md) and [tables](/concepts/sql/schema.md) as you'd expect. Doltgres implements all Postgres [data types](/concepts/sql/types.md). Doltgres supports [secondary indexes](/concepts/sql/indexes.md). Doltgres supports [foreign key and check constraints](/concepts/sql/constraints.md). Doltgres supports [views](/concepts/sql/views.md), [triggers](/concepts/sql/triggers.md), and [procedures](/concepts/sql/procedures.md). Doltgres implements [users and grants](/concepts/sql/users-grants.md) for permissions.

This section of the documentation will explain Doltgres's flavor of these standard SQL concepts. Perhaps more importantly, this section will also explain how these concepts interact with Doltgres's version control features.

Concepts will be tackled in the following order:

1. [Databases](/concepts/sql/databases.md)
2. [Schema](/concepts/sql/schema.md)
3. [Tables](/concepts/sql/table.md)
4. [Primary Keys](/concepts/sql/primary-key.md)
5. [Types](/concepts/sql/types.md)
6. [Indexes](/concepts/sql/indexes.md)
7. [Views](/concepts/sql/views.md)
8. [Constraints](/concepts/sql/views.md)
9. [Triggers](/concepts/sql/triggers.md)
10. [Procedures](/concepts/sql/procedures.md)
11. [Users/Grants](/concepts/sql/users-grants.md)
12. [Transactions](/concepts/sql/transaction.md)
13. [System Variables](/concepts/sql/system-variables.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.doltgres.com/concepts/sql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
