
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Add a New Column Address in DB2 Table Tab1
We can add a new column in an existing table as per the business requirements. Similarly, we can also remove a column from the table. This could be done using the ALTER table command as below.
ALTER TABLE TAB1 ADD COLUMN ADDRESS VARCHAR(100);
The ALTER TABLE reserved words are followed by the name of the table which we want to amend. In this case it is TAB1.
To add a new column we will use ADD COLUMN and to remove the column we will use the REMOVE COLUMN parameter. This is followed by the name of the column. If this is an addition of a new column then we also need to give the data type for this column.
Advertisements