
Explanation:
Delta tables in Databricks can be queried using standard SQL. Databricks notebooks support magic commands like %sql to directly execute SQL queries. Additionally, you can use the Spark SQL API within Python (using %python) to execute SQL queries against Delta tables. The spark.sql() method allows you to pass a SQL query string. Therefore, both options A and B are valid ways to query a Delta table.
Incorrect options:
Ultimate access to all questions.
No comments yet.
Which of the following commands can be used to query a delta table in Databricks?
A
%sql Select * from table_name
B
%python spark.sql("select * from table_name")
C
%python execute.sql("select * from table")
D
Both A & B
E
%python delta.sql("select * from table")