How do I rename a column in a database table using SQL?
In MySQL, the syntax is ALTER TABLE ... CHANGE
:
ALTER TABLE <table_name> CHANGE <column_name> <new_column_name> <data_type> ...
Note that you can't just rename and leave the type and constraints as is; you must retype the data type and constraints after the new name of the column.