oracle

Thursday, 20 April 2017

SQL: Create table

Table is the collection of rows and columns.
Sql CREATE table command is used to create a table in database/schema.
This is DDL command.

Syntax:

Create table table_name (column_1 datatype(size) constraints , Column_2 datatype(size) constraints,........, column_n datatype (size) constraints);

Table is created.

Example:

create table authors (author_id number(3) primary key, author_name varchar2(30));

Result:
table created.

In the above example we created a table with the name of authors and have only two columns

No comments:

Post a Comment