- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to add a new column Address in the above 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.
- Related Articles
- How to add a row compression to a DB2 table TAB1?
- How to add a unique index on the above table TAB1 for column Enrollment ID (ascending)?
- How to delete a DB2 table TAB1?
- How will you add a constraint on above DB2 table TAB1 for ages between 3 to 16 years?
- How to find the primary key of a DB2 table TAB1?
- How to get the list of all COBOL-DB2 programs using a DB2 table TAB1?
- How to image copy the entire DB2 table TAB1 into a dataset?
- How to find all the foreign keys of a DB2 table TAB1?
- How to find out all the indexes for a DB2 table TAB1?
- How to do a full & incremental MERGECOPY for a DB2 table TAB1?
- How to create an ALIAS TAB2 for DB2 table TAB1?
- How to add a new column to an existing table using JDBC API?
- How to add a new column to an existing table of Laravel in a migration?
- How to create a DB2 table TAB1 with 4 columns, Student ID, Enrollment ID, Name and Age?
- How to store a NULL value in a particular column of a DB2 table using COBOL-DB2 program?

Advertisements