To create a database in sql database is pretty simple, you can just enter the following code.
CREATE DATABASE database_name;
To check if a database is already exists, you can use the following syntax:
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database_name'
If you want to combine together to prevent an error message return when you try to create a database, you can use the keyword EXISTS. See below example syntax for more details.
CREATE DATABASE IF NOT EXISTS database_name;