Summary: in this tutorial, you will learn how to use the Oracle
CREATE TABLE
statement to create a new table in the Oracle database.
Introduction to Oracle CREATE TABLE
statement
To create a new table in Oracle Database, you use the
CREATE TABLE
statement. The following illustrates the basic syntax of the CREATE TABLE
statement:
CREATE TABLE schema_name.table_name (
column_1 data_type column_constraint,
column_2 data_type column_constraint,
...
table_constraint
);
Oracle CREATE TABLE
example
The following example shows how to create a new table named
persons
in the ot
schema:
CREATE TABLE ot.persons(
person_id NUMBER GENERATED BY DEFAULT AS IDENTITY,
first_name VARCHAR2(50) NOT NULL,
last_name VARCHAR2(50) NOT NULL,
PRIMARY KEY(person_id)
);
0 comments:
Post a Comment