--- title: "SQL manual" sidebarTitle: "Overview" description: "Analytical SQL over the lakehouse, served through Arrow Flight SQL." icon: table-list keywords: ["sql", "flight sql", "query", "analytics", "datafusion", "fts"] --- LanceDB answers analytical queries in SQL, served over an [Arrow Flight SQL](https://arrow.apache.org/docs/format/FlightSql.html) endpoint. Any Flight SQL client can reach it, and results come back as Arrow. The dialect is [DataFusion's](/sql/functions), so the syntax and functions are the ones that reference documents. What this manual covers is the parts that are LanceDB's: how a query reaches the engine, how Lance columns appear to it, and the extensions a lakehouse over multimodal data needs. ## Where a query runs {#execution} Queries execute on the server. The client sends a statement and receives Arrow record batches — nothing is converted to pandas or Python objects unless you ask for it. Because results are Arrow the whole way, a query that feeds training or downstream processing does not pay a serialization cost to get there. ## The dialect {#dialect} Ordinary analytical SQL — `SELECT`, `WHERE`, `GROUP BY`, `ORDER BY`, `LIMIT`, joins, CTEs and window functions — over Arrow-typed columns. Two things differ from a warehouse you may be used to, and both come from the storage being Lance rather than something SQL-shaped: - **Columns are Arrow types**, not a SQL type system mapped onto storage. A vector column is a `FixedSizeList` and behaves like one. - **Row metadata is available as columns** — `_rowid`, `_rowaddr` — but only when asked for, so they stay out of `SELECT *`. Both are covered in [Functions and types](/sql/functions). ## Full-text search {#fts} Full-text search is a **table function** rather than a predicate, because it produces relevance alongside the matching rows and a `WHERE` clause has nowhere to put that: ```sql SELECT id, text, _score FROM fts('my_docs', 'puppy') ORDER BY _score DESC LIMIT 5 ``` `fts()` takes a table name and a query — a bare string, or a JSON query object for fuzzy, phrase, boolean, boost and multi-match forms. `_score` carries relevance and behaves like any other column. Being a relation is what makes it compose: join its result, filter it, aggregate over it. ## Reference {#reference} The DataFusion dialect and version, how Lance columns map onto it, and what LanceDB adds. ## What this manual does not cover {#scope} Connecting a Flight SQL client — drivers, authentication, the endpoint address — is deployment-specific and documented with the deployment.