Explore your data warehouse using the SQL Runner. This feature allows you to preview sql queries and subsequently create workbooks, worksheets, and datasets directly from SQL.
Summary of Content
- To run SQL against a connection, you must have permission to access your data at the connection level. Learn more.
The SQL Runner will only appear if you have connection level access to at least one connection in your organization.
Creating a Workbook, Worksheet or Dataset from SQL
- Click the Create New button in the left side navigation panel to open the Create New / Explore Data menu.
- Select Write SQL.
- Select your connection from the dropdown menu.
- The data tree on the left side of the page will allow you to explore your data.
You may choose to click on any table to preview its data.
- To write SQL, begin typing keywords into the text box in the top half of the screen. Sigma will automatically provide a list of autocomplete options to guide you.
- To run your SQL query, click the blue Run button.
Keyboard shortcuts: CTRL-Enter on a PC or CMD-Enter on a Mac.
- To explore your query in a workbook, click the Explore button the top right corner of the page.
To create a worksheet or dashboard, click the dropdown icon next to the Explore button. Then click Create Worksheet or Create Dataset.
Formatting your SQL
Use the format SQL icon button to quickly format long blocks of SQL text.
When you are using the SQL runner, you will have access to a history of the queries you've recently run against your current connection. To access this history, click the ‘History’ tab in the left hand panel.
Viewing Multiple Tables
When writing your query, you can still use the left side menu to explore data tables. You can switch between the Table Preview and SQL results, letting you preview what columns you may want to use when joining data tables.
|Mac Shortcut||PC Shortcut||Command|
|CMD + Enter||CTRL + Enter||Submit query for execution|
|CTRL + Space||CTRL + Space||Open autocomplete|
|CMD + /||CTRL + /||Toggle commenting on or off for the highlighted line|
|CMD + Left||Go to the start of the line|
|Shift + Tab||Shift + Tab||Indent less|
|Shift + CTRL + K||Shift + CTRL + K||Delete current line|
|CMD + L||CTRL + L||Select line|
|CMD + CTRL + Up||Shift + CTRL + Up||Shift line up|
|CMD + CTRL + Down||Shift + CTRL + Down||Shift line down|
|CMD + J||CTRL + J||Join Lines|
|Shift + CMD + D||Shift + CTRL + D||Duplicate line|
|CMD + K CMD + K||CTRL + K CTRL + K||Delete the portion of the line to the right of the cursor|
|CMD + K CMD + delete||CTRL + K CTRL + Backspace||Delete the portion of the line to the left of the cursor|
|CMD + K CMD + U||CTRL + K CTRL + U||Upcase at cursor|
|CMD + K CMD + L||CTRL + K CTRL + U||Downcase at cursor|