liveBook · Manning

Alter table command

ALTER TABLE is an SQL data-definition statement that modifies the structure or properties of an existing table.

How 2 Manning books explain it

Learn SQL in a Month of Lunches

ALTER TABLE is an SQL statement that changes the structure or definition of an existing database table.

How it is used
Changes existing table structures, columns, keys, and constraints without using INSERT to create new rows.
How deep it goes
Demonstrates adding, validating, relating, and removing columns and constraints, while deferring broader product-specific syntax.
Examples
Uses title and category tables, CategoryID, named keys, populated rows, and DROP statements for constraints and columns.
What you can do after
Apply it via SQL to add or remove table elements and enforce relationships after checking existing data.

Read how Learn SQL in a Month of Lunches explains alter table command →

Just Use Postgres!

The ALTER TABLE command is an SQL statement that changes the definition of an existing table, including its constraints.

How it is used
Strengthens database-level data integrity after table creation by adding or tightening constraints.
How deep it goes
Demonstrates adding checks and NOT NULL requirements, including existing-row failures, but does not detail broader table alterations.
Examples
Uses catalog price validation, a rejected negative-price update, and review NOT NULL and ranking constraints.
What you can do after
Operate/configure it to enforce new table constraints and diagnose failures caused by violating existing or incoming rows.

Read how Just Use Postgres! explains alter table command →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.