SQL ALTER Table Statement

0
158

Using ALTER Table Statement, we were able to Add, Delete or Modify Columns in an existing table.

Syntax to add a column:

Syntax to drop a column :

Example:

Employee

Employee_id Name Address

 

Now, suppose you want to add a column for designation. You can do so in the following way.

Employee_id Name Address Designation

 

Now if you want to delete the address column, you can do this in the following way.

The final table will look like

Employee_id Name Designation

 

Facebook Comments

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.