Prova questo. Usa INFORMATION_SCHEMA.SCHEMATA
per verificare l'esistenza del Database
If not exists (SELECT 1
FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = 'demo-database')
CREATE DATABASE `demo-database`
.....