Querying data with SQL

Introduction to Microsoft Fabric

Fiodar Sazanavets

Senior Software Engineer

What is SQL used for?

Filtering an online shop by category, price, and brand compared side by side with a SQL query on lakehouse tables

Introduction to Microsoft Fabric

SQL analytics endpoint structure

Lakehouse bins lead to tables, a SQL analytics endpoint running a query, and a revenue-by-product result

  • Lakehouse: storage mechanism
  • Tables: organized catalog
  • SQL analytics endpoint: search interface
Introduction to Microsoft Fabric

Accessing the SQL analytics endpoint

Analyze data with menu in a Fabric lakehouse with the SQL analytics endpoint option highlighted

Introduction to Microsoft Fabric

Accessing the SQL query interface

SQL analytics endpoint ribbon with the New SQL query dropdown open, listing New SQL query and New visual query

Introduction to Microsoft Fabric

SELECT

SELECT *
FROM Sales;
  • Like opening the complete Sales catalog
  • Returns rows from the table
  • * means every column
Introduction to Microsoft Fabric

Selecting specific columns

SELECT OrderDate, ProductName, Revenue
FROM Sales;
  • Returns the date, product name, and revenue
  • Makes the result easier to read
Introduction to Microsoft Fabric

WHERE

SELECT *
FROM Sales
WHERE Region = 'North';
  • Like applying a catalog filter
  • Keeps only matching rows
  • Combines with column selection
Introduction to Microsoft Fabric

Results of a SQL query

  • Returned as a new table in the editor
  • WHERE limits rows; named columns limit columns
  • Not saved; source table unchanged

An unchanged Orders table, a query naming three columns that returns only those columns, and a WHERE query that returns only Electronics rows

Introduction to Microsoft Fabric

Practicing with a sample lakehouse

Data Engineering section of the Create page with the Sample lakehouse card next to the Lakehouse card

  • Pre-populated with a ready-made dataset
  • Dataset chosen at creation (Ex. public holidays)
Introduction to Microsoft Fabric

Let's practice!

Introduction to Microsoft Fabric

Preparing Video For Download...