If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

SQL: ALTER TABLE

Use the ALTER TABLE command to add a new column to a table (ADD COLUMN) or rename the table (RENAME TO) after creating it.
It doesn't make sense here, where you can always edit your initial CREATE TABLE statement, but in actual databases, you would need to use it once you did the CREATE TABLE and realized some time after that you needed a different schema.
For more details, see the SQLite reference for ALTER TABLE.
▶️ You can also learn about this in our ALTERing tables after creation talkthrough.

Want to join the conversation?

No posts yet.