
Answer-first summary for fast verification
Answer: CREATE TABLE users_jdbc USING org.apache.spark.sql.jdbc OPTIONS (url = “jdbc:sqlite:/sqmple_db“, dbtable = “users“)
The correct answer is to use `CREATE TABLE users_jdbc USING org.apache.spark.sql.jdbc OPTIONS (url = “jdbc:sqlite:/sqmple_db“, dbtable = “users“)`. This is because Databricks runtime supports connecting to various SQL databases, including SQLite, using JDBC. The correct syntax involves specifying the JDBC driver (`org.apache.spark.sql.jdbc`) and the necessary options such as the URL and the table name. For more detailed documentation, refer to [SQL databases using JDBC – Azure Databricks | Microsoft Docs](https://docs.microsoft.com).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How would you define an external SQL table by connecting to a local instance of an SQLite database using JDBC in Databricks?
A
CREATE TABLE users_jdbc USING SQLITE OPTIONS (url = “jdbc:/sqmple_db“, dbtable = “users“)
B
CREATE TABLE users_jdbc USING org.apache.spark.sql.jdbc OPTIONS (url = “jdbc:sqlite:/sqmple_db“, dbtable = “users“)
C
CREATE TABLE users_jdbc USING SQLURL = {server:“jdbc:/sqmple_db“,dbtable: “users”}
D
CREATE TABLE users_jdbc USING org.apache.spark.sql.jdbc.sqlite OPTIONS (url = “jdbc:/sqmple_db“, dbtable = “users“)
E
CREATE TABLE users_jdbc USING SQL OPTIONS (url = “jdbc:sqlite:/sqmple_db“, dbtable = “users“)
No comments yet.