Available Tables

Next →

Modifying Tables (ALTER TABLE, DROP COLUMN)

After creating tables, you may need to modify their structure to accommodate changing data requirements.

ALTER TABLE

The ALTER TABLE statement lets you add, modify, or drop columns.

Adding a Column

To add a new column, use:

ALTER TABLE table_name ADD COLUMN column_name data_type;

Example:

ALTER TABLE students ADD COLUMN email TEXT;

Dropping a Column

To remove a column:

ALTER TABLE table_name DROP COLUMN column_name;

Example:

ALTER TABLE students DROP COLUMN age;

Modifying tables allows your database to evolve as your application grows.