Loading Data Driven Insights
Preparing your learning content.
Preparing your learning content.
A beginner-friendly guide to ALTER TABLE in SQL, including how to add, change, and remove columns from an existing table.
On this page
Jump to a lesson section
The ALTER TABLE statement is used to change the structure of an existing table.
It helps you update a table design after the table has already been created.
The most common beginner example is adding a new column to an existing table.
ALTER TABLE table_name
ADD column_name data_type;
For example, this adds an email column to the Employees table.
ALTER TABLE Employees
ADD email VARCHAR(150);
email to the Employees table.Before running the ALTER TABLE statement, the table does not have an email column.
ALTER TABLE to add an email column.This SQL Server-friendly example adds a new email column to the existing Employees table.
ALTER TABLE Employees
ADD email VARCHAR(150);
After this statement runs, the table has a new column available for storing employee email addresses.
ALTER TABLE is useful when your database requirements change after a table already exists.
ADD email VARCHAR(150)ALTER COLUMN department VARCHAR(100)DROP COLUMN emailADD CONSTRAINT ...In SQL Server, common ALTER TABLE actions include adding columns, changing compatible column definitions, dropping columns, and adding constraints.
ALTER TABLE Employees
ALTER COLUMN department VARCHAR(100);
ALTER TABLE Employees
DROP COLUMN email;
Be careful when changing or removing existing columns because they may already contain data or be used by reports, applications, views, or stored procedures.
Use it carefully, especially when changing or removing existing columns, because structure changes can affect stored data and connected database objects.
SQL Roadmap Progress
Topic 13 of 111
12% complete
Next in SQL Roadmap
Continue with the next SQL topic in the recommended roadmap order.
Continue learning ā