When you engage with several RDBMSs, even a small amount of change in syntax can cause confusion. This is the first in a series of postings about how to add multiple columns to different RDBMSs. However, this article will focus on MySQL syntax.
Syntax:
ALTER TABLE tableName
ADD COLUMN `column1` dataType,
ADD COLUMN `column2` dataType,
ADD COLUMN `column3` dataType;
Example:
ALTER TABLE Customers
ADD COLUMN `CxID` SMALLINT(6) NOT NULL,
ADD COLUMN `LastName` VARCHAR(20),
ADD COLUMN `status` INT(10) UNSIGNED NOT NULL;
Hope you find this article helpful.
Please subscribe for more interesting updates.