---
title: "SQL Lab: Query Editor"
url: "https://help.psarev.io/en/article/sql-lab-query-editor"
language: "en"
last_updated: "2026-03-10T15:33:56.446Z"
---

# SQL Lab: Query Editor

Clicking SQL Lab in the Analytics module opens the query editor, where you can write and run T-SQL queries directly against your Rev.io data. SQL Lab is divided into three main areas.

| **NOTE:** The SQL Lab requires the *Query Databases* permission. If you do not see SQL Lab in your navigation menu, contact your administrator to request access. |
| --- |

The left panel contains the *Connection* bar, where the **Database** and **Schema** selectors let you choose which data source you are querying. A table schema reference is also available here, allowing you to browse the columns and data types for any table in the selected schema. The center panel is the query editor, where you write your T-SQL. The editor supports syntax highlighting, auto-complete for table and column names, keyboard shortcuts, and multi-tab query sessions. The bottom panel is the *Results* panel, where results appear after you run a query. You can sort, scroll, and export the result set directly from this panel, and switch between the *Results*, *Query History*, and table schema tabs.

![](https://cdn-assets.productfruits.com/abd8b7b0-3610-4258-9726-e766c0808658)

To run a query in SQL Lab, complete the following steps.

1.  Select the **Database** and **Schema** from the drop-downs at the top of the left panel. Always confirm you have selected the correct database before running a query.
2.  Click in the query editor and type or paste your T-SQL query.
3.  Press **Ctrl+Enter** (Windows) or **Cmd+Enter** (Mac) to run the query, or click **Run**. Results appear in the panel below.
4.  Use the **Limit** drop-down to cap the number of rows returned. The default limit is 1,000 rows.
5.  Click **Download to Results** to export the full result set as a CSV file.
6.  Click **Save** to save the query for future reuse. See the [SQL Lab: Saved Queries](https://help.psarev.io/en/article/sql-lab-saved-queries) article for more information.

The following keyboard shortcuts are available in the query editor.

| **Shortcut** | *Action* |
| --- | --- |
| **Ctrl+Enter / Cmd+Enter** | *Run the current query* |
| **Ctrl+S / Cmd+S** | *Save the current query* |
| **Ctrl+Z / Cmd+Z** | *Undo last edit* |
| **Ctrl+F / Cmd+F** | *Find and replace text in the editor* |
| **Ctrl+A / Cmd+A** | *Select all query text* |
| **Alt+Shift+F** | *Format and auto-indent SQL* |
