Using SQL Blocks
Last updated
Was this helpful?
Last updated
Was this helpful?
Airbook allows you to retrieve and manipulate data using SQL queries. Below is a step-by-step guide to querying data, using Dataframes, and joining across datasources.
You can only query one datasource at a time. To join across multiple datasources, see the "Querying and Joining Dataframes" section below.
If you are familiar with SQL, this is the most flexible way to retrieve data. First, select your datasource from the dropdown. The input field will autofill with a basic SELECT *
query, providing a quick overview of the table contents. Modify the query as needed or run it as-is.
To execute your query, press Shift + Enter or click the Run button on the right. After a few seconds, a table displaying your results will appear below the input field. This table is referred to as a Dataframe.
Each Dataframe has a name, displayed in a green label above the block. You can rename it by clicking on the label and entering a new name. Renaming triggers the query to run again. Your Dataframe is now available for further querying, joining across datasources, charting, and other operations.
The right sidebar helps you browse datasources efficiently:
Clicking a datasource displays a list of schemas and folders.
Clicking a table shows its columns and data types.
Clicking the Query button automatically adds a new block with a SELECT *
query (limited to 100 rows) for a quick table preview.
Once a query runs, its results appear in a table with interactive features:
Drag to rearrange columns.
Click a column name to sort and filter data.
Note: Sorting and filtering here are temporary and do not affect the underlying Dataframe. Filtered-out data is still included in subsequent queries. These tools help explore and refine data before writing new queries.
To query a Dataframe, set your datasource dropdown to Local Dataframes and use the Dataframe name as the table name in your query. Below are example queries:
By following these steps, you can efficiently query, explore, and manipulate data within Airbook.