ALTER TABLE ADD COLUMN
ALTER TABLE changes structure. ADD COLUMN adds a column, existing rows get the default or NULL.
Example
ALTER TABLE courses ADD COLUMN active INTEGER DEFAULT 1;
SELECT title, active FROM courses LIMIT 2;Result
title | active Intro to HTML | 1 CSS Basics | 1
Exercise
Add a column.
ALTER TABLE t COLUMN c INT
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.