The art of asking better questions

Introduction to Databricks Genie

Gang Wang

Senior Data Scientist

Why refinement matters

$$ funnel: Vague Question, Add Filters, Add Time, Add Sorting, Precise Answer

Prompt Refinement = Better Results

  • First query rarely perfect (okay!)
  • Add filters, dates, grouping
  • More specific = more useful
Introduction to Databricks Genie

Genie results for "Show me my transactions" — overwhelming rows and columns

"Show me my transactions"

Introduction to Databricks Genie

Genie results for "Show me transactions from the most recent month"

"Show me transactions from the most recent month"

Introduction to Databricks Genie

Genie results for "...where amount over $100, grouped by franchise"

"Show me transactions from the most recent month where the amount was over $100, grouped by franchise"

Introduction to Databricks Genie

The formula

$$

sentence_builder_v3.png

Introduction to Databricks Genie

Sentence builder

nanobanana: full: Four building blocks stacking together to form a great prompt - block 1 labeled WHAT with a magnifying glass icon, block 2 labeled WHEN with a calendar icon, block 3 labeled HOW with a sorting icon, block 4 labeled CONSTRAINTS with a filter icon - blocks connect to form a complete prompt

Tip: Most beginners are too brief - they only type "Sales." Use all four parts for better results.

Introduction to Databricks Genie

Another example

Genie results for "revenue by franchise for May 2024, grouped by city" with SQL panel open

"Show me revenue by franchise for May 2024, grouped by city, only transactions over $50"

Introduction to Databricks Genie

Iterative approach mindset

$$

iterativecycle

$$

  1. Ask - Start with basic question
  2. Review - Check the results
  3. Refine - Add constraints one at a time
  4. Repeat - Until you get what you need

Remember: You don't need the perfect prompt on the first try

Introduction to Databricks Genie

Let's practice!

Introduction to Databricks Genie

Preparing Video For Download...