create database
Create a database or schema definition
Syntax
create_schema: CREATE {SCHEMA | DATABASE} {database_name | db-uri}
Description
The CREATE DATABASE statement is used to introduce the database definition for a new database. The definition is contained in the sequence of DDL statements (CREATE DOMAIN or CREATE TABLE) that are submitted immediately following this statement. The name of the database is specified by the database_name identifier.
The database is automatically created and initialized upon the successful compilation of all of its subsequent DDL statements and execution of the first non-DDL statement (usually COMMIT) that follows the DDL statements. At that point, the database is open and ready for use. If encryption is enabled, the database encryption key will automatically be created for this connection.
Only one CREATE DATABASE can be issued in a given connection and no other databases can be opened when the CREATE DATABASE is issued.
This statement can only be executed through SQL. It is not recognized by the rdm-compile
and rdm-create
utilities.
Example
create database bookshop; create table author( last_name char(11) primary key, full_name char(35), gender char(1), yr_born smallint, yr_died smallint, short_bio varchar(250) ); ... other DDL statements for the bookshop database commit;
See Also