</> realdeveloper

DDL: changing database structure

Data Definition Language defines database objects such as tables and constraints. CREATE, ALTER and DROP belong here. Schema changes serve a different purpose from reading or changing rows.

A concrete example

Before adding a required field to an existing table, plan how to populate old rows and whether older application versions remain compatible.

ALTER TABLE orders ADD COLUMN note text;

Explain it yourself

What migration steps are needed to add a NOT NULL column to a populated table?

How to study this

Write your reasoning first. Check the original documentation, identify an assumption, then try a different example. Reading this page does not count as verified skill evidence.

Source and review

PostgreSQL data definition ↗

Original RealDeveloper explanation; last source check: .

Put it into practice

Public pages are open to everyone. Sign in to save answers and follow a personal practice route.

Open practice topics →