how to create catalog

PraveenReddy21
New Contributor III

Hi ,

I am trying to create  catalog  and database  its not  allowing  databricks  , please  suggest  .

Here my code .

base_dir = "/mnt/files"
spark.sql(f"CREATE CATALOG IF NOT EXISTS dev")
spark.sql(f"CREATE DATABASE IF NOT EXISTS dev.demo_db")
 
first i need to create  catalog then after  under catalog  i want to create database.
 
Thank You .
Praveen.