While analyzing and storing the data, we can insert new columns as per our needs. To add the columns, we will use the “ALTER TABLE” command. In this blog, you will learn about adding different types of columns.
In Snowflake, we will use “ALTER TABLE” to add the column.
For example, if we want to add a column “
customer_id smallint” column.
alter table product1 Add customer_id smallint;
|Looking forward to a career in a cloud data warehousing domain? Check out the "Snowflake Training" and get certified today|
By using the “ALTER TABLE” command, we can add columns with default values:
alter table product1 add column customer_id smallint default 3;
We can add the string column with the not null constraint:
alter table product1 add type varchar(100) not null;
|Preparing for Snowflake Interview? Here are the Top Snowflake Interview Questions and Answers|
Adding multiple columns:
alter table product1 add Customer_id small int default 3; type varchar(100) not null;
Alter table command is used to different types of columns. We can use the command for inserting different types of columns. I hope this blog provides you with the required information about adding columns.
Snowflake Related Articles
Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!
|Snowflake Training||Dec 09 to Dec 24||View Details|
|Snowflake Training||Dec 12 to Dec 27||View Details|
|Snowflake Training||Dec 16 to Dec 31||View Details|
|Snowflake Training||Dec 19 to Jan 03||View Details|
Copyright © 2013 - 2023 MindMajix Technologies