Oracle SQL - Table Create Schema

Introduction

Oracle SQL supports the ANSI/ISO standard CREATE SCHEMA command.

This command allows you to create a complete schema with a single DDL command/transaction.

The CREATE SCHEMA command succeeds or fails as an atomic transaction.

It solves the problem of two tables having foreign key references to each other.

The following table shows how you could have created the case tables with the CREATE SCHEMA command.

SQL> create schema authorization BOOK
  2         create table emp     (...)
  3         create table departments   (...)
  4         create table salgrades     (...)
  5         create table courses       (...)
  6         create table offerings     (...)
  7         create table registrations (...)
  8         create table history       (...)
  9         create view ... as select ... from ...
 10         grant select on ... to public;

This command does not actually create a schema.

Oracle schemas are created with the CREATE USER command.

You can specify the CREATE SCHEMA command components in any order.

Within each component definition, you can refer to other (earlier or later) schema components.

Related Topics