- CREATE TABLE command is used to create a database table.
Syntax:
CREATE TABLE <table_name>(
<column1><datatype> (size),
<column2><datatype> (size),…
<column N><datatype> (size));
Example:
CREATE TABLE student(
std_no number(3),
std_namevarchar2(10),
Cityvarchar2(10));
- Where, table_name is the name of the table.
- Table name must be unique within a same database.
- Column specifies name of the column for the table and it must be unique.
- All the identifier rules must be followed for both column name and table name.
- Datatype specifies type of the data that column can hold, it may be any of basic data types such as number, varchar2, date etc.