Adding a new column to a table

The ALTER TABLE helps you add a column with specified data type to an existing table.

				
					ALTER TABLE customer
ADD COLUMN address TEXT;
				
			
Let’s break down our statement:
  • ALTER TABLE is followed by the table name.
  • ADD COLUMN lets you add a column. It is followed by the name of the column
  • After writing the name of the column, we have to specify it’s type. In our example, the data type of our new column “address” is TEXT.
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments