SQL DDL and DML/Add a column

Modify an existing table by adding a new column.

Section: CREATE, ALTER, and DROP

Add a column

sql
sql
ALTER TABLE users
ADD COLUMN last_login_at TIMESTAMP;
Explanation

ALTER TABLE changes schema without recreating the table.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing CREATE, ALTER, and DROP
Create table
Define a new table with columns and constraints.
OpenIn sheetsqlsame section
Add a constraint
Attach a foreign key or check constraint after table creation.
OpenIn sheetsqlsame section
Drop table
Remove a table definition and its data.
OpenIn sheetsqlsame section
Truncate table
Remove all rows quickly without dropping the table.
OpenIn sheetsqlsame section
Create index
Add an index to improve lookup performance.
OpenIn sheetsql1 tag match
Define primary key
Mark a column as the main row identifier.