SQL Update Command


Prev Tutorial Next Tutorial

SQL Update Command

Update command is used for modify the data in the table. Using this command you can modify all the records in the table and also you can modify some specific records in the table using "where clause". Using this command you can modify single column and also modify more than one column at a time.

Syntax

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

Update column using where clause

Using where clause you can update specific record from any existing table.

Employee table

emp_idnamesalary
101Amit24000
104Gaurav26000
105Hitesh35000
102Rahul34000
103Sultan54000

Example

	
UPDATE Employee 
SET salary=100000,
WHERE emp_id=101;
);

Result after execute above query.

emp_idnamesalary
101Amit100000
104Gaurav26000
105Hitesh35000
102Rahul34000
103Sultan54000

Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements