arrow_backwardBack to MySQL code examples

MySQL Full Alter Table Example

A MySQL example for changing, adding, and removing columns for an existing table
ALTER TABLE
  `users`
ADD
  COLUMN `last_name` varchar(255) NULL COMMENT 'Also known as family name';
ALTER TABLE
  `users` DROP COLUMN `favorite_color`;
ALTER TABLE
  `users` MODIFY `birthdate` varchar(255) NULL;

Using Beekeeper Studio?

Beekeeper Studio is a free and open source database manager for Windows, Mac, and Linux.

This feature is baked right in, so there's no need to manually type SQL every time. Access table column editing by right-clicking on a table in the sidebar and clicking 'View Structure'.

Download Beekeeper Studio