
Answer-first summary for fast verification
Answer: By using the %python and %sql magic commands at the beginning of each cell to specify the language.
Databricks notebooks facilitate the use of multiple languages within the same notebook through magic commands such as %python and %sql. These commands, placed at the start of each cell, specify the language for that cell, enabling smooth integration of Python and SQL without the need for extra configurations or libraries.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
What is the method to execute both Python and SQL code within the same Databricks notebook?
A
By writing all code in Python and using API calls to execute SQL queries.
B
By using the %python and %sql magic commands at the beginning of each cell to specify the language.
C
By installing a special library that allows cross-language execution.
D
By configuring the notebook settings to enable multi-language support before execution.