
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
Question 12
A data engineer needs to create a database called customer360 at the location /customer/customer360. The data engineer is unsure if one of their colleagues has already created the database.
Which of the following commands should the data engineer run to complete this task?
A
CREATE DATABASE customer360 LOCATION '/customer/customer360';
B
CREATE DATABASE IF NOT EXISTS customer360;
C
CREATE DATABASE IF NOT EXISTS customer360 LOCATION '/customer/customer360';
D
CREATE DATABASE IF NOT EXISTS customer360 DELTA LOCATION '/customer/customer360';
E
CREATE DATABASE customer360 DELTA LOCATION '/customer/customer360';
Explanation:
The correct answer is C because:
IF NOT EXISTS clause ensures that the database is only created if it doesn't already exist, which addresses the engineer's uncertainty about whether a colleague has already created itLOCATION '/customer/customer360' clause specifies the exact location where the database should be createdDELTA is not a valid keyword in the CREATE DATABASE syntax - Delta is a table format, not a database typeThis command follows the proper Spark SQL syntax for creating a database with conditional existence checking and custom location specification.