# SQL

> For the complete documentation index, see [llms.txt](https://kotlin.github.io/dataframe/llms.txt).

Kotlin DataFrame supports reading from SQL databases using JDBC.

API reference: [readSqlTable](https://kotlin.github.io/dataframe/api-docs/dataframe-jdbc/org.jetbrains.kotlinx.dataframe.io/read-sql-table.html), [readSqlQuery](https://kotlin.github.io/dataframe/api-docs/dataframe-jdbc/org.jetbrains.kotlinx.dataframe.io/read-sql-query.html), [DbType](https://kotlin.github.io/dataframe/api-docs/dataframe-jdbc/org.jetbrains.kotlinx.dataframe.io.db/-db-type/index.html), [dataframe-jdbc module](https://kotlin.github.io/dataframe/api-docs/dataframe-jdbc/index.html)

Requires the [dataframe-jdbc module](modules.html#dataframe-jdbc), which is included by default in the general [dataframe artifact](modules.html#dataframe-general) and in [%use dataframe](setupkotlinnotebook.html#integrate-kotlin-dataframe) for Kotlin Notebook. You’ll also need a JDBC driver for the specific database.

## Supported databases

Kotlin DataFrame provides out-of-the-box support for the most common SQL databases:

* [PostgreSQL](postgresql.html)

* [MySQL](mysql.html)

* [Microsoft SQL Server](microsoft-sql-server.html)

* [SQLite](sqlite.html)

* [H2](h2.html)

* [MariaDB](mariadb.html)

* [DuckDB](duckdb.html)

You can also define a [Custom SQL Source](custom-sql-source.html) to work with any other JDBC-compatible database.

## Read

[DataFrame](dataframe.html) can be loaded from a database in several ways: a user can read data from a SQL table by a given name ([DataFrame.readSqlTable()](readsqldatabases.html)), as a result of a user-defined SQL query ([DataFrame.readSqlQuery()](readsqldatabases.html)), or from a given `ResultSet` ([DataFrame.readResultSet()](readsqldatabases.html)). It is also possible to load all data from non-system tables, each into a separate `DataFrame` ([DataFrame.readAllSqlTables()](readsqldatabases.html)).

See [Read from SQL databases](readsqldatabases.html) for more details.

