sql query rename column code example

Example 1: rename table sql

ALTER TABLE STUDENTS  
RENAME TO ARTISTS;

Example 2: how to rename columns in sql server

EXEC sp_rename 'Sales.SalesTerritory.TerritoryID', 'TerrID', 'COLUMN';

Example 3: change column name sql

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

Example 4: sql rename column in select query

SELECT data.column AS `Label`

Example 5: change column name sql

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

Tags:

Php Example