
Answer-first summary for fast verification
Answer: dbfs:/user/hive/warehouse
## Explanation In Databricks, when you create a database using the `CREATE DATABASE` command without specifying a custom location, the database is created in the default Hive warehouse directory. The default location for Hive databases in Databricks is: **dbfs:/user/hive/warehouse/** When you create a database without specifying a location, Databricks creates a subdirectory with the database name inside this warehouse directory. So for the `customer360` database, the actual directory would be: **dbfs:/user/hive/warehouse/customer360.db** However, among the given options, option B (`dbfs:/user/hive/warehouse`) is the correct answer because it represents the default warehouse location where databases are stored. ### Key Points: 1. **Default Location**: The default Hive warehouse directory is `dbfs:/user/hive/warehouse/` 2. **Database Directory**: Each database gets its own subdirectory with `.db` extension 3. **Custom Location**: If you want a different location, you need to specify it explicitly: ```sql CREATE DATABASE customer360 LOCATION 'dbfs:/mnt/data/customer360'; ``` 4. **Option Analysis**: - **A**: Incorrect - This path pattern doesn't exist in Databricks - **B**: Correct - This is the default warehouse location - **C**: Incorrect - Databases aren't created directly under `/user/hive/` - **D**: Incorrect - The default location is known and doesn't require additional information - **E**: Incorrect - This path doesn't exist as a default location This understanding is important for Databricks data engineers to know where their data is stored and how to manage database locations effectively.
Author: Keng Suppaseth
Ultimate access to all questions.
No comments yet.
A data engineer has created a new database using the following command: CREATE DATABASE IF NOT EXISTS customer360; In which of the following locations will the customer360 database be located?
A
dbfs:/user/hive/database/customer360
B
dbfs:/user/hive/warehouse
C
dbfs:/user/hive/customer360
D
More information is needed to determine the correct response
E
dbfs:/user/hive/database