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.
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.
📄 Use the "Copy" button to easily copy your SQL query and paste it somewhere else.
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.
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.
The editor auto-completes SQL functions as you write.
😎 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.
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.
🌟 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!