#SQL Server
ALTER TABLE Customers
ALTER COLUMN age VARCHAR(2);
#MySQL
ALTER TABLE Customers
MODIFY COLUMN age VARCHAR(2);
#Oracle
ALTER TABLE Customers
MODIFY age VARCHAR(2);
#PostgreSQL
ALTER TABLE Customers
ALTER COLUMN age TYPE VARCHAR(2);
ALTER TABLE employees
ALTER COLUMN last_name VARCHAR(75) NOT NULL;
'This adds 'NOT NULL' to excisting column counting in the table mytable'
ALTER TABLE mytable ALTER COLUMN counting INT NOT NULL;
ALTER TABLE table_name
ALTER COLUMN column_name column_type;
ALTER TABLE Customers
ALTER COLUMN age VARCHAR(2);
Changes the data type of a table’s column.
Example: In the ‘users’ table, make the column ‘incept_date’ into a
‘datetime’ type.
ALTER TABLE users
ALTER COLUMN incept_date datetime;
sp_rename 'employees.last_name', 'lname', 'COLUMN';
sp_rename 'table_name.old_column_name', 'new_column_name', 'COLUMN';
ALTER TABLE table_name
DROP COLUMN column_name;