Getting Started - A Simple Notebook

How to get started with Query.me


This guide is a short walk-through of a basic Query.me use case: The creation of a parameterized, SQL-based report that is then scheduled and sent out via email.


1. Create an account

If you don't have a Query.me account yet, you can sign up here and create a free account.

Every new account comes with a "Welcome Notebook" and a (read-only) database connection with some demo data to tinker with.

Your home screen in Query.me

2. Connect your SQL database

This step is optional at this point.

You can follow the tutorial using the demo data available to any new account and come back to this step later. But of course, the experience is much better using real data.

  • Click "Connect Database" from the quick access menu on the home screen.
Select "Connect Database" from the quick-access menu
  • Next, select your database type and fill out the corresponding form.

    You can find help specific to your database type in the "Connecting to Data" section of the documentation. Make sure you have whitelisted Query.me's IPs to allow a connection.
Connecting to a SQL database

3. Create your first notebook

Select "New Notebook" from the quick-access menu

To create your first notebook, select "New Notebook" from the menu on the home screen and then select "Blank Notebook" from the template selection.

Check out templates for a head start on your next project

Here's a quick primer on notebooks:

  • Notebooks consist of Blocks that can be created using the -button or the assigned hotkeys shown in the add-block menu.
  • Notebooks are divided into pages that can be created, browsed, and removed in the Sidebar.
  • Notebooks can be Exectuted, Sent, and Scheduled in the top navigation.
  • Notebooks have a Viewing and an Editing mode. You can change mode freely unless you do not have editing permission.
The different parts that make a notebook

4. Create your first SQL block

  • To toggle the Add Block Menu click the + -button next to any existing block.
  • From the menu, select the block type you want to create, in this case SQL Query
Click + to add blocks to your notebook

5. Run a Query

Now it's time to execute our first SQL query.

  • Query blocks are run by clicking the -button
  • Make sure that your SQL block is connected to the correct database. You can change the database by clicking on the -icon next to the query name.

Browsing schema information:

  • Try out the data-tab to explore your database's schemas and tables.
  • The -button copies a full select statement of the table to your clipboard.
  • The -button lets you preview a table.

OK. Now we know how to query our data using SQL.

To continue with our tutorial, try running the following SQL code against the demo database:

SELECT 
    date_trunc('month', orderdate) as day, 
    region,
    sum(profit) as profit 
FROM demo_data.store_orders
group by 1,2

6. Create a chart

In Query.me you can easily visualize the results of a query as a chart.

  • The -button on the SQL block is the fastest way to create a chart directly from the result of a query.
  • Click Edit to make changes to the chart, e.g. changing the visualization type from a bar chart to an area chart.

7. Use Parameters

One very powerful feature of Query.me is that you can create parameters to make your notebooks more dynamic.
For example, you can create a parameter block and then use it inside a SQL query to filter for a specific product category, date, customer ID, etc.

Adding a parameter to a SQL query.
  • Open the +-Menu and select Parameter Input
  • A new parameter_1 will be created.
  • In the input field type a value, e.g. West
  • Now we use this parameter in the SQL query by referencing the parameter name in double curly brackets like this: {{ parameter_1 }}
  • You can click the {{ button on the SQL block to render a preview of the parsed query that will be executed on run.

Here is our updated SQL query with the parameter reference:

SELECT 
    date_trunc('month', orderdate) as day, 
    region,
    sum(profit) as profit 
FROM demo_data.store_orders
WHERE region = '{{ parameter_1 }}'
group by 1,2

You can play around with different parameter types and even create dropdown parameters by specifying a list of allowed values:

A dropdown parameter

8. Share your Notebook

Query.me notebooks can be easily shared with your team - pretty much like a Google Doc.

Just click on the Share-button and define your sharing settings for the notebook.

  • Notebooks can be set to Public, meaning they can be viewed and copied by anyone on the internet with the link.
  • Notebooks shared with the workspace can be viewed or edited by any member of your workspace.
  • Notebooks can be shared with individual users.
SQL results features
Share Notebook

9. Schedule it as an Email Report

Finally, scheduling notebooks to be run regularly is very easy.
We also can receive it as an email report directly to our inbox.

  • Click on the Schedule button in the top navigation bar.
  • In Select Action you can choose to just execute the current page or to Execute + Send it via email
  • Fill out the recipient email and pick your desired scheduling frequency
  • Finally, click Save and you are done. This report will now send automatically at the set interval.
Schedule an email report

To run it manually, click on the ... and select Run now:

Trigger a scheduled run manually

Your inbox should now have a new message like this:

A Query.me notebook delivered via Email

Note: You can make things a bit prettier by hiding the actual SQL and the results.


That's it 🎉

Welcome aboard!

With any questions or feedback, please contact us anytime!

SQL results features

What's Next?

Check out the Advanced Guide for a more complex reporting pipeline using conditional statements, loops, slack messages, and more.
Or browse our examples and use them as a template for your next project.

Jump to