
Answer-first summary for fast verification
Answer: CREATE TABLE new_table USING jdbc OPTIONS ( url ‘jdbc:mysql://database.example.com:3306/mydb‘, dbtable ‘new_table‘, user ‘username‘, password ‘password‘)
This SQL command for creating a new table through a JDBC connection in Databricks specifies the JDBC connection details and attempts to create a new table named new_table. If a table with that name already exists, Databricks will throw an error, which aligns with the default behavior for creating tables via JDBC connections.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
Which SQL command correctly attempts to create a new table in Databricks using a JDBC connection and throws an error if the table already exists?
A
INSERT INTO new_table SELECT * FROM jdbc(‘jdbc:mysql://database.example.com:3306/mydb‘, ‘existing_table‘, ‘username‘, ‘password‘)
B
CREATE TABLE new_table AS SELECT * FROM jdbc(‘jdbc:mysql://database.example.com:3306/mydb‘, ‘table_name‘, ‘username‘, ‘password‘)
C
CREATE TABLE new_table USING jdbc OPTIONS ( url ‘jdbc:mysql://database.example.com:3306/mydb‘, dbtable ‘new_table‘, user ‘username‘, password ‘password‘)
D
CREATE TABLE IF NOT EXISTS new_table USING jdbc OPTIONS ( url ‘jdbc:mysql://database.example.com:3306/mydb‘, dbtable ‘existing_table‘, user ‘username‘, password ‘password‘)