
Explanation:
The correct syntax to create a schema if it does not already exist is CREATE SCHEMA IF NOT EXISTS schema_name [ LOCATION schema_directory ]. This ensures the schema is only created if it doesn't already exist, preventing errors. For more details, refer to the Databricks documentation.
Ultimate access to all questions.
How can you create a schema named 'bronze' with the location '/mnt/delta/bronze' and ensure it doesn't already exist before creation?
A
CREATE SCHEMA bronze IF NOT EXISTS LOCATION ‘/mnt/delta/bronze‘
B
if IS_SCHEMA(‘bronze‘): CREATE SCHEMA bronze LOCATION ‘/mnt/delta/bronze‘
C
Schema creation is not available in metastore, it can only be done in Unity catalog UI
D
CREATE SCHEMA IF NOT EXISTS bronze LOCATION ‘/mnt/delta/bronze‘
E
Cannot create schema without a database
No comments yet.