Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML

Print Version

SQL Alter Table

In an earlier lesson, we created a table with the CREATE TABLE command. In this lesson, we will modify the table using the ALTER TABLE command.

Add a Column

SQL syntax

ALTER TABLE table_name
ADD column_name datatype

Example SQL Statement

ALTER TABLE Individual
ADD age int

Change the Datatype

SQL syntax

ALTER TABLE table_name
ALTER COLUMN column_name datatype

Example SQL Statement

ALTER TABLE Individual
ALTER COLUMN age numeric

Drop a Column

'Dropping' a column means removing or deleting that column.

SQL syntax

ALTER TABLE table_name
DROP COLUMN column_name

Example SQL Statement


ALTER TABLE Individual
DROP COLUMN age

Enjoy this website?

  • Share
  • Add this page to your Favorites
  • Link to this page (copy/paste into your own website or blog):
  • Link to Quackit using one of these banner ads.
  • Help support Quackit by making a donation

Oh, and thank you for supporting Quackit!

© Copyright 2000 - 2010 Quackit.com