SQL ALTER Table Statement

0
169

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
Previous articleSQL ORDER BY keyword
Next articleSQL AND & OR Operators
Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!

Leave a Reply

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