Add new column to a table using alter table statement in Teradata

Alter table in Teradata:

Alter table statement is used to add new columns to the existing table in Teradata. It uses ADD function to perform this operation. The table structure is changed by using the alter table statement in Teradata.

Syntax of alter table

Example 1 : Add new column to a table

The above query will add the Address column to the Customer table.

Example 2 : Add new column to a table with default value

If you want to add the new column with some default value, you can use DEFAULT function along with alter table command to do that. The above query will add the Salary_Frequency column to the Employee table with the default value as ‘Monthly’.

Example 3 : Add multiple new columns to a table

Here we are adding multiple new columns such as Address and Birthdate to the the table Employee. Since we are adding multiple new columns in Teradata, multiple ADD’s are required in the ALTER TABLE query.

Recommended Articles