Get startedGet started for free

Querying data visually

1. Querying data visually

Every query we wrote in the last video depended on knowing SQL syntax. Fabric can build those same queries for us. In this video, you'll use the visual query editor to select, filter, and summarize data without writing a line of SQL.

2. The benefits of querying data visually

An online shop never asks us to write a search command. We check boxes, choose filters, and pick how to sort. The visual query editor gives us that same experience over a Fabric table.

3. Why visual query authoring helps

The visual editor means we can ask a question of our data before we know any SQL syntax. Each choice we make becomes a visible step, so we can see how the query was built, go back to any step, and change it. A SQL statement gives us the answer. The visual editor shows us the reasoning too, which is what makes it a good place to start exploring.

4. Accessing the visual query editor

The visual query editor exists in both a lakehouse and a warehouse. In a lakehouse, it's accessed via the SQL analytics endpoint. In a warehouse, it's accessed directly. In both cases, it's in the New SQL query dropdown on the ribbon.

5. Visual query editor layout

The editor has three parts: the data source, the steps we apply to it, and a live preview of the result. When we drag a table from the Explorer panel onto the canvas, its data appears straight away. From there we select columns, apply filters, group, or sort, and the preview updates with every step, so we can check each change before adding the next.

6. Selecting columns visually

Selecting columns narrows the result to the fields we need. We check the ones we want in a list, and the columns we left out drop out of the preview. This is done from the Manage columns menu on the ribbon.

7. Adding a filter visually

A visual filter asks for three things: a field, a condition, and a value. The filter opens from a column heading’s arrow in the preview. We choose the column, pick a condition such as equals, and then enter or select the value we want to keep. The rows that don't match drop out of the preview immediately, with no syntax to type.

8. Grouping data visually

Grouping turns a long list into a summary. We pick the column to group by and the calculation we want for each group, such as a sum. The summary appears in the preview as soon as we confirm. Grouping sales by department gives us one total for electronics, one for clothing, and one for home products, instead of a row for every individual purchase.

9. Sorting and previewing

Sorting arranges the returned records in ascending or descending order. The preview then lets us confirm that our filters and sorting produced what we expected.

10. SQL or visual query?

Both editors run against the same tables, so the choice depends on the task. SQL can express any query the engine supports, which suits complex logic or queries we write from scratch. The visual editor builds the query step by step, which suits data we don't know well yet. Most people use both, picking whichever fits the job in front of them.

11. Let's practice!

Now let's build a query in the visual editor, without writing any SQL.

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.