SQL Update

SQL Update is used to modify record of table.

Syntax




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


We will take example without where clause, without where clause it will update all records from table

Take a table Student

StudentID StudentName StudentCity
1 Rahul Chandigarh
2 Karan Mohali
3 Neha Delhi
4 Manpreet Chandigarh
5 Ajay Delhi


Update Query



UPDATE Student
SET StudentCity='Mumbai';



StudentID StudentName StudentCity
1 Rahul Mumbai
2 Karan Mumbai
3 Neha Mumbai
4 Manpreet Mumbai
5 Ajay Mumbai

Back To Top