CREATE SCHEMA

CREATE SCHEMA — create a new schema

Syntax

CREATE SCHEMA schema_name

Description

CREATE SCHEMA creates a new schema. The schema name must be distinct from the name of any existing schema in the current database. A schema is essentially a namespace. It contains named objects, including tables, views, domains and stored procedures, whose names may duplicate those of other objects in other schemas. You access named objects by qualifying their names with the schema name as a prefix. The default behavior is that the creator of the schema and a user assigned the DBA role can create tables, views, domains and sequences in that schema. To give this privilege to another user, use the GRANT statement (see GRANT). CREATE statement that specifies an unqualified object name creates the object in the current schema. You can also create a schema by declaring it with the USE statement (see USE). To remove a schema, specify DROP SCHEMA (see DROP SCHEMA).

For more information on using database identifiers with special characters, see Rules for Specifying NuoDB Identifier Names.

Parameters

schema_name

Name of a schema to be created. This name must be unique in the set of schemas in the current database.

New users must be granted CREATE SCHEMA privilege by the DBA to enable new users to create new schemas. Any users existing prior to upgrading to NuoDB 4.0 will retain this privilege by default

Example

CREATE SCHEMA newSchema;