Adding Columns to a Table
Syntax : ALTER TABLE table-name ADD column-specification
Ex : ALTER TABLE empolyee ADD JobDescription VARCHAR(500)
Modifying Existing Columns
ALTER TABLE employee ALTER COLUMN EmpName VARCHAR(30) NOT NULL
ALTER TABLE employee ALTER COLUMN EmpName VARCHAR(30) NOT NULL
ALTER TABLE employee ALTER COLUMN address2 VARCHAR(200) NULL
Deleting Columns
ALTER TABLE empolyee DROP COLUMN address3
Syntax : ALTER TABLE table-name ADD column-specification
Ex : ALTER TABLE empolyee ADD JobDescription VARCHAR(500)
Modifying Existing Columns
ALTER TABLE employee ALTER COLUMN EmpName VARCHAR(30) NOT NULL
ALTER TABLE employee ALTER COLUMN EmpName VARCHAR(30) NOT NULL
ALTER TABLE employee ALTER COLUMN address2 VARCHAR(200) NULL
Deleting Columns
ALTER TABLE empolyee DROP COLUMN address3
No comments:
Post a Comment