
Answer-first summary for fast verification
Answer: Leverage the magic commands %sql and %python within a single notebook to switch between languages.
The correct approach is to use a single notebook with magic commands (%sql and %python) to switch between SQL and Python. This method enhances productivity by keeping related code in one place and simplifies the development process.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
When working on a project that requires both SQL and Python in a Databricks notebook, what is the most efficient approach?
A
Use separate notebooks for SQL and Python to avoid confusion.
B
Leverage the magic commands %sql and %python within a single notebook to switch between languages.
C
Deploy an All-purpose cluster for Python and a SQL endpoint for SQL queries.
D
Utilize a job cluster for Python execution and a SQL endpoint for SQL queries.
No comments yet.