Introduction to Databricks Genie
Gang Wang
Senior Data Scientist

$$
"What is the top revenue-generating product?"
Genie might guess at the grouping and aggregation.
SQL examples ensure it follows your exact pattern every time.

SQL function when
Example query when
Natural language description
"Identify the top revenue-generating product"
Phrased how users actually ask
$$
Natural language description
"Identify the top revenue-generating product"
Phrased how users actually ask
Verified SQL
SELECT
`product`,
SUM(`totalPrice`) as total_revenue,
COUNT(*) as transaction_count,
SUM(`quantity`) as total_quantity_sold
FROM
`samples`.`bakehouse`.`sales_transactions`
GROUP BY
`product`
ORDER BY
total_revenue DESC
Genie uses YOUR exact pattern

$$
For mission-critical KPIs that need guaranteed accuracy, Genie offers Trusted Assets - verified queries that run your exact SQL every time.
We'll cover how to create and use them in Chapter 4.
Introduction to Databricks Genie