SQL Editor

A rich editor to write SQL queries and explore data

๐ŸŒŸ Feature guide

We designed a clean and simple SQL query editor โœจ

Once you open the Query tab for any data asset, you can start typing โŒจ๏ธ your queries in the editor and run โœ… them to explore your data.

An intutive design and color palette, easy shortcuts, and meta information about the query make it easy to use the editor ๐Ÿƒ

Let's look into its features and how we can use them for our benefit.

  1. There's a "Help" โ„น๏ธ button at the top of the editor. Click it to see shortcuts for faster SQL writing and editing, like Ctrl/Cmd + Enter to run the query.

  2. ๐Ÿ“„ Use the "Copy" button to easily copy your SQL query and paste it somewhere else.

  3. The editor also gives you an option to build your query without writing SQL. Surprised, right? ๐Ÿคฉ It's a boon for non-SQL users! Check out this article to learn more.

  4. If you want the full space to write your query, you can just click on the "Expand" button at the end. This will take you to a full screen ๐Ÿ–ฅ๏ธ mode.

  5. The editor auto-completes SQL functions as you write.

Autocomplete

๐Ÿ˜Ž Cool Hack: Press Ctrl/Cmd + Shift + L to auto-format your SQL query. No need to put in extra effort to make your code look clean. Just use this shortcut!

๐Ÿ› ๏ธ How to open the SQL editor

Running a query to get the list of users who have ordered coffee

STEP 1: Go to the individual data table page

On the Discover page, click on the data table name for which you want to write the SQL query.

STEP 2: Go to the Query tab

Click on the second tab (the Query tab) to open the editor. The editor will be in front of you ๐ŸŽ‰ to start typing and running queries โ–ถ๏ธ

All SQL functions are supported by the editor. You can even join two tables together using JOIN statements. However, this editor is just for querying and not for writing changes back to the source database.

๐Ÿ‘€ Note: The query that runs on the editor is executed at the source of the data catalog. For example, if a table is stored in the Snowflake warehouse, the query will be executed there itself.

๐Ÿš€ Superpowers

There is a bunch of information displayed on the editor screen to help you write a better query.

๐Ÿ“‹ Switch from table to column view

If you only want to look at the columns of the table, just click the "Columns" option. It will list each column name with its data type.

Columns view

๐ŸŒŸ Pro Tip: The column count always shows up right above the table. If you want to check the row count as well, click the "Get rows count" option right next to it.

โฑ๏ธ Check query time

You can check how long a query took to run. The time is displayed right next to the "Run Query" button.

๐Ÿ“ƒ Copy data or columns

If you want to quickly copy the data showing in the table, just click on the option "Copy Data" or "Copy Columns". You can then paste the data in an Excel sheet, Powerpoint, Notepad, etc.

๐Ÿ‘€ Note: The table will only show max 10,000 rows, so more than this number of rows cannot be copied.

โŒจ๏ธ Display terms and classifications with column names

Whenever you mention a column while writing a query, the editor will display the classification and terms attached to that column name for further context.

Go query to glory ๐ŸŒผ and experience working with the SQL editor inside Atlan yourself!