Skip to main content
World Nomads Logo

How to RENAME column and table itself in MySQL?

5) RENAME column in table

Syntax:

ALTER TABLE table_name
CHANGE COLUMN old_name new_name 
column_definition
[ FIRST | AFTER column_name ]
Example:

In this example, we will change the column name "cus_surname" to "cus_title".

Use the following query to do this:

 ALTER TABLE  cus_tbl
CHANGE COLUMN cus_surname cus_title
varchar(20) NOT NULL;
6) RENAME table

Syntax:

ALTER TABLE table_name
RENAME TO new_table_name;
Example:

In this example, the table name cus_tbl is renamed as cus_table.

ALTER TABLE cus_tbl
RENAME TO cus_table;

Subscribe channel on YouTube
Read this post on Blogger
Like page on Facebook
Tweet about video on twitter
Let's chat on whatsapp
See you at Instagram
Google+

Comments

Contact Us

Name

Email *

Message *