In case the database user does not have sufficient permission to create database schemas, the following link refers to the SQL script used to create the required database tables.
All scripts have the name of the DBMS they are intended for in their filename.
There are scripts for table creation called "create-tables-ejbca-<dbms-name>.sql."
and one general file that is used to create the required DB indices called "create-index-ejbca.sql."