🔺

SQL

Airbook's SQL capabilities consists of intuitive features like autocomplete and the ability to chain queries making data analysis a seamless experience.

Initiating the SQL block

  1. 1.
    Click on the desired location in your document.
  2. 2.
    Type / to initiate the slash command.
  3. 3.
    From the dropdown menu, select the SQL option. An SQL composer will appear, ready for your input.

Select a data source

Before writing your query, ensure you've selected the correct data source. This helps with the autocomplete.
  1. 1.
    Click on the "Data Source" dropdown within the SQL block.
  2. 2.
    Choose from the list of connected data sources or add a new connection.

Querying with autocomplete

The SQL composer in Airbook is powered by autocomplete, making it easier and faster to write queries:
  1. 1.
    Begin typing your query in the composer.
  2. 2.
    As you type, Airbook will suggest relevant table names, columns, and SQL functions.
  3. 3.
    Select the desired option from the autocomplete suggestions to insert it into your query.

Query with detailed view

Airbook offers a detailed view of the data source connections, tables and the field names. In order to make sure you get a complete view of all the fields in your tables, you can follow the below steps:
  1. 1.
    Click on the connection you want to query from the left side bar under 'Connections'
  2. 2.
    Upon clicking, the right side bar will open up to show you all the tables
  3. 3.
    Furthermore, clicking on the table will open the panel to show you all the field names and the data types within the selected table

Chaining Queries

Airbook offers the unique ability to chain queries, allowing the output of one query block to be used in subsequent query blocks:
  1. 1.
    Execute your initial query by clicking the "Run" button.
  2. 2.
    Once executed, your query block will be assigned a unique name (e.g., Query1).
  3. 3.
    To use the output of Query1 in another SQL block, reference it in the FROM statement of your new query, like so: SELECT * FROM Query1.

Tips for Efficient SQL Writing in Airbook

  • Naming Query Blocks: For better organization, especially when chaining multiple queries, give your query blocks unique names.
  • Error Handling: If there's an error in your query, Airbook will highlight the problematic section and provide a brief description of the issue.
  • Saving Queries (coming soon): Frequently used queries can be saved for future reference and execution.
  • Quick Query options: Query all fields, query table directly or copy field names from the detailed view to write queries more efficiently.
Writing SQL in Airbook is designed to be a user-friendly experience, catering to both seasoned SQL professionals and those new to the language. With features like autocomplete and query chaining, Airbook ensures that your data analysis is efficient and comprehensive.