
Answer-first summary for fast verification
Answer: `DESCRIBE DATABASE EXTENDED db_hr`
The correct command to find the location of a database in the underlying storage is `DESCRIBE DATABASE EXTENDED db_hr`. This command provides comprehensive details, including the storage location. Other options like `DESCRIBE DATABASE db_hr` offer basic information but may not include the storage location. Commands such as `DESCRIBE db_hr` and `SELECT location FROM db_hr.db` are syntactically incorrect for this purpose. Relying on the default hive metastore directory is unreliable as databases can be created in other locations.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A data engineer is working with a database named db_hr and wishes to determine its creation location in the underlying storage. Which command should they use?
A
DESCRIBE db_hr
B
SELECT location FROM db_hr.db
C
DESCRIBE DATABASE EXTENDED db_hr
D
DESCRIBE DATABASE db_hr
E
There is no need for a command since all databases are created under the default hive metastore directory