Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML
Website builder

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 page?

  1. Add this page to your Favorites
  2. Link to this page (copy/paste into your own website or blog):
  3. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!