Home Table Manipulation sql add new column
sql add new column

How to add a new column to the database

Syntax #1

How to add a new column to a the existing table

ALTER TABLE table_name
 ADD column_name column-definition;

EXAMPLES:

ALTER TABLE student
 ADD DOB  varchar2(10);

This will add a column called DOB to the student table. 

Syntax #2

How to add multiple columns to an existing table, the ALTER TABLE syntax is:

ALTER TABLE table_name
ADD ( column_1 column-definition,
  column_2 column-definition,
  ... 
  column_n column_definition );

EXAMPLES:

ALTER TABLE student
ADD ( DOB vvarchar2(10)
   AGE int ); 



Comments (0)
Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:D:angry::angry-red::evil::idea::love::x:no-comments::ooo::pirate::?::(
:sleep::););)):0
Security
Please input the anti-spam code that you can read in the image.

"