change column type mysql code example
Example 1: sql change column types
ALTER TABLE table_name
ALTER COLUMN column_name datatype;
-- Example
ALTER TABLE product
ALTER COLUMN description VARCHAR(250);
Example 2: add new column to the table mysql
ALTER TABLE `TABLE_NAME`
ADD `COLUMN_NAME` VARCHAR(50) NULL
AFTER `COLUMN_NAME_AFTER`;
Example 3: change column in mysql
#Alter is used
#alter table TableName change CurrentColumnName NewColumnName Specification(size);
alter table TableName change name firstname varchar(30);