--The following example renames the column TerritoryID in the table Sales.SalesTerritory to TerrID in the AdventureWorks database.
EXEC sp_rename 'Sales.SalesTerritory.TerritoryID', 'TerrID', 'COLUMN';
ALTER TABLE "table_name" RENAME COLUMN "column 1" TO "column 2";
MySQL:
ALTER TABLE Customer CHANGE Address Addr char(50);
Oracle:
ALTER TABLE Customer RENAME COLUMN Address TO Addr;
ALTER TABLE Student RENAME COLUMN NAME TO FIRST_NAME;
ALTER TABLE `Table Name` MODIFY COLUMN `Column Name` Datatype(Size);
ALTER TABLE `table_name`
CHANGE `old_name` `new_name` VARCHAR(10)
CHARACTER SET utf8
COLLATE utf8_general_ci NULL
DEFAULT NULL;
ALTER TABLE `Table Name` MODIFY COLUMN `Column Name` Datatype(Size);
EXEC sp_RENAME 'table_name.oldColumn_name' , 'newColumn_name', 'COLUMN'
ALTER TABLE `db_name`.`table_name`
CHANGE `current_column_name` `new_column_name` datatype(size) NOT NULL COMMENT '';
SELECT CASE lower(col1)
WHEN 'agree' THEN 'Ok'
ELSE
CASE
WHEN col2 = 1 THEN 'Ko'
ELSE 'Maybe'
END
END AS my_result
FROM table_name;
SELECT NAME AS "Employee Name" FROM PEOPLE;
SELECT p.NAME AS "Employee Name", s.SALARY AS "Employee Salary"
FROM PEOPLE p
JOIN SALARIES s ON p.ID = s.ID;