change a column value in sql code example

Example 1: update column sql server

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

Example 2: how to change the value of a table in sql

UPDATE employees 
SET 
    address = '1300 Carter St',
    city = 'San Jose',
    postalcode = 95125,
    region = 'CA'
WHERE
    employeeID = 3;

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: change column name sql

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

Tags:

Php Example