CHANGE
CHANGE is a SQL command used in ALTER TABLE clause to modify existing columns within a table. It is principally used to change the type of a column, rename a column, or modify the column's attributes. It is important to note that the CHANGE command requires both the old and new column name, even if it remains the same.
Example
Output
Explanation
The CHANGE
clause in MySQL is used to change the name and/or data type of a column in a table. In this example, the column named FirstNm
is being renamed to FirstName
with datatype VARCHAR(45)
.