# SQL Lab (/dashboards/sql-lab)

Run ad-hoc SQL against the lakehouse from your browser.

SQL Lab is the query editor inside Superset. This page covers the Databaas specifics; for the editor
itself — tabs, saved queries, result exploration — see the
[Superset SQL Lab docs](https://superset.apache.org/docs/).

<Callout title="Prerequisite">
  `can_use_dashboards` — it covers SQL Lab too. See [permissions reference](/access/permissions-reference).
</Callout>

## Run a query

Open **Dashboards**, then **SQL → SQL Lab** in Superset's top menu (Superset reuses your Databaas
identity — no second login). Choose the **Lakehouse** database, then pick your namespace from the
schema list: namespaces appear as **schemas**, tables under the namespace they belong to. Naming both
together always works:

```sql title="First rows"
SELECT * FROM <namespace>.<table> LIMIT 10
```

The fully qualified name puts the catalog `iceberg` in front, which you need when you query outside
the selected database:

```sql title="Fully qualified"
SELECT * FROM iceberg.<namespace>.<table> LIMIT 10
```

Substitute the namespace and table from the catalog breadcrumb — see
[browsing the catalog](/catalog/browsing).

## Your query runs as you

SQL Lab sends your query to Trino, which runs it under your identity — the same data grants as in the
catalog and notebooks. Dashboards are a door, not a filter: everyone who can open SQL Lab connects to
the same databases and schemas; what differs per person is which queries return rows. See
[how access works](/access/how-access-works) and [query engines](/dashboards/query-engines).

**Lakehouse** is the only database, and you cannot add or edit database connections from Superset.

## If a query fails or stops

- **A query runs for at most 300 seconds** before SQL Lab cancels it. Narrow it with a `WHERE`
  clause or a `LIMIT`, or move heavy transformations into a [pipeline](/pipelines/authoring).
- **Queries start failing after a while in Superset.** Your Superset sign-in carries a token that
  lasts about 15 minutes and is not refreshed in the background. Sign out of Databaas and back in,
  then rerun the query.