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!
On the Discover page, click on the data table name for which you want to write the SQL query.
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.
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.
You can check how long a query took to run. The time is displayed right next to the "Run Query" button.
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.
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!