SQL Update Command
Advertisements
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_id | name | salary |
---|---|---|
101 | Amit | 24000 |
104 | Gaurav | 26000 |
105 | Hitesh | 35000 |
102 | Rahul | 34000 |
103 | Sultan | 54000 |
Example
UPDATE Employee SET salary=100000, WHERE emp_id=101; );
Result after execute above query.
emp_id | name | salary |
---|---|---|
101 | Amit | 100000 |
104 | Gaurav | 26000 |
105 | Hitesh | 35000 |
102 | Rahul | 34000 |
103 | Sultan | 54000 |
Google Advertisment