
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.
Which of the following commands will return the location of database customer360?
A
DESCRIBE LOCATION customer360;
B
DROP DATABASE customer360;
C
DESCRIBE DATABASE customer360;
D
ALTER DATABASE customer360 SET DBPROPERTIES ('location='/user');
E
USE DATABASE customer360;
Explanation:
To find the location of a database in Databricks/Spark SQL, you need to use the DESCRIBE DATABASE command. This command provides detailed information about the database, including its location, comment, and properties.
Let's analyze each option:
A. DESCRIBE LOCATION customer360; - This is not a valid SQL command in Spark SQL. There is no DESCRIBE LOCATION syntax.
B. DROP DATABASE customer360; - This command would delete the database, not return its location.
C. DESCRIBE DATABASE customer360; - CORRECT. This command displays detailed information about the database, including the location where it's stored.
D. ALTER DATABASE customer360 SET DBPROPERTIES ('location='/user'); - This command would change the database properties, not return the current location.
E. USE DATABASE customer360; - This command switches to the database for subsequent operations, but doesn't return any information about its location.
When you execute DESCRIBE DATABASE customer360;, you'll see output that includes:
This is the standard way to retrieve database metadata including its storage location in Databricks and Spark SQL environments.