Javatpoint Logo
Javatpoint Logo

DB2 RazorSQL Alter

The Alter command is used to make a change in the table.

DB2 Alter 1

For example:

  • Add new column
  • Add primary key
  • Add foreign key
  • Add constraints
  • Change the type of column
  • Drop column
  • Drop Primary Key
  • Drop Foreign Key
  • Drop Constraint
DB2 Alter 2

Let's add a new column "Department" in the table "Freshers"

DB2 Alter 3
DB2 Alter 4

You can see that the table is altered and a new column "Department" is added.

DB2 Alter 5

As the same way you can Add primary key

  • Add foreign key
  • Add constraints
  • Change the type of column
  • Drop column
  • Drop Primary Key
  • Drop Foreign Key
  • Drop Constraint

Next TopicDB2 Drop




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA