Modify Table Structure

Oracle basic syntax to modify table structure

Syntax 1
add a column into existing table

ALTER TABLE table_name
ADD column_name datatype;

example :
ALTER TABLE customer
ADD phone_number varchar(20);


Syntax 2
modify a data type of a field of existing table

ALTER TABLE table_name
MODIFY (column_name datatype);

example :
ALTER TABLE customer
MODIFY (name varchar(100));

No comments: