SQL ALTER TABLE — Basic UsageIT technician command center
Database · SQL and Database Administration

SQL ALTER TABLE — Basic Usage

Use SQL ALTER TABLE for a standard administrative task.

Copy-ready commandSQL ALTER TABLE — Basic Usage
ALTER TABLE users ADD COLUMN last_login DATETIME NULL;
Production warning

INSERT, UPDATE, DELETE, ALTER, and restore operations can modify or remove data.

Requirements and permissions

Requirements
Appropriate database client and connection
Permissions
Database privileges vary
Last reviewed
2026-07-31

Examples

Basic Usage

Use SQL ALTER TABLE for a standard administrative task.

ALTER TABLE users ADD COLUMN last_login DATETIME NULL;

Original command

Alter a table definition.

ALTER TABLE users ADD COLUMN last_login DATETIME NULL;

Common errors

Command not found

Confirm Appropriate database client and connection is installed and available in your current shell.