alter table modify column name code example

Example 1: mysql alter table add column

ALTER TABLE vendors ADD COLUMN phone VARCHAR(15) AFTER name;

Example 2: sql rename column

ALTER TABLE my_table RENAME COLUMN col_name TO new_col_name;

Example 3: how to change the column name in sql

ALTER TABLE table_name
CHANGE COLUMN old_name TO new_name;

Example 4: modify column name in sql

ALTER TABLE `Table Name` MODIFY COLUMN `Column Name` Datatype(Size);

Example 5: change column name sql

ALTER TABLE `db_name`.`table_name` 
	CHANGE `current_column_name` `new_column_name` datatype(size) NOT NULL COMMENT '';

Example 6: change column name sql

ALTER TABLE users
 ALTER COLUMN first username varchar(20);

Tags:

Php Example