Add A Column To A Table With SQL On A MySQL Database
table_name ADD COLUMN column_name details_for_column;
Examples:
INT; samples ADD COLUMN id_number
VARCHAR(100) NOT NULL UNIQUE; genres ADD COLUMN genre
Note that if you set unique, the values in the table have to be unique already. Same goes for `not null`.
- These are for mysql. - Need to test with other database. - I'm using `ADD COLUMN column_name`. You can remove COLUMN
and call ADD column_name
as well, but I like the more explicit version.
-- end of line --