change data type in mysql 1

change data type in mysql

ALTER TABLE table_name

CHANGE COLUMN column_name column_name datatype; 

Here is what the above code is Doing:
1. We’re changing the name of the column from “name” to “first_name”.
2. We’re changing the data type of the column from “varchar(255)” to “varchar(30)”.

Similar Posts