Queries

Queries

Queries

Queries allow you to leverage SQL to get the data you want from your connections.

Creating queries

It’s possible to create new queries from the queries page.

image

Using queries

Queries can SELECT data from your connection and the result will appear in a table or chart layout. By default, a table layout is used.

⚠️

Queries allow you to execute ANY SQL against your data source, including UPDATE, DELETE, and DROP TABLE statements.

Queries are useful in the following scenarios:

  • When you need to do deep joins of your data source tables (e.g. joining on a foreign value from an already joined table)
  • Visualize data in a line or bar chart
  • Leverage SQL to make calculations on your data

Chart layout

If using chart layout, the first column specified in the SQL query will be used as the chart’s x-axis. A line chart will be used if one of the data points is a date, otherwise a bar chart will be used.

Draft, published, and favorited queries

When you first create a query, it will be set as a draft and will transition to published once you hit the publish button. Once a query has been published, you can always move it back to drafts after the fact.

Queries are initially set to being drafts since it allows users to take their time setting up a query without worrying about having their teammates interpret the query as being ready to use.

image

It’s also possible to favorite queries that you frequently use in order to easily find them. Click on the star to favorite a query.

Draft and published queries are sorted separately in the sidebar, with favorites sorted first.

Favorites are also automatically added to your homepage allowing you to easily access them without having to navigate around the rest of the app.

💠

https://www.basedash.com

© BaseDash Inc.