1. Learn
  2. /
  3. Courses
  4. /
  5. Databricks with the Python SDK

Connected

Exercise

Query NYC Taxi Dataset using SQL Agent

Databricks exposes an open source samples catalog that contains several schemas. In this exercise, we will create a LangChain Databricks SQL agent to connect to the nyctaxi schema and then ask it a question that requires SQL to answer. Creating one of these agents empowers the user to perform data analysis and ask questions on data that require SQL, with no prior knowledge of SQL.

Instructions

100 XP
  • Create LangChain SQLDatabase object from nyctaxi schema in Databricks samples catalog.
  • Create a custom LangChain LLM using the Databricks Meta Llama 3 model.
  • Create a LangChain Databricks SQL Agent using the custom LLM.
  • Query the Databricks SQL Agent.