Showing posts with label Add Column to Table. Show all posts
Showing posts with label Add Column to Table. Show all posts

Saturday, October 13, 2012

SQL: Add Column in Table

Here  is the statement skeleton for adding new column in an existing table.

ALTER TABLE table_name
ADD column_name datatype

Lets explain it using an example:

Lets suppose I have a table Student and I want to add new column in it named CourseName.

ALTER TABLE Student
ADD CourseName varchar(50)

A new column gets added to the Student table.