Learn How to Update Data Rows using Update Statement in SQL

Опубликовано: 19 Апрель 2026
на канале: PnTutorials by Pradnyankur Nikam
33,753
128

Learn about using UPDATE statement in SQL. As the name suggests UPDATE statement is used to update the data rows in a table. The UPDATE statement can update one or multiple column values in single SQL statement. WHERE clause is used to specify the data row to be updated. UPDATE statement without WHERE clause will update all the data rows in the table. Any existing data rows or records in target table remain unaffected.
Here are the examples UPDATE statements,
UPDATE tablename SET column1 = newvalue;
UPDATE tablename SET column1 = newvalue1, column2 = newvalue2 WHERE columnid = 3;

Select the "school" database, "USE school;"
Run a simple SQL statement to display all the data rows in students table using SQL statement, "SELECT * FROM students;"
Here in this result set, take a look at studentid 1. Suppose we have accidentally added this student record under class first instead of second. And now we are going to update this row to change the class value from 'First' to 'Second'.
We will use the SQL statement, "UPDATE students SET class = 'Second' WHERE studentid = 1;"
Press enter to execute the statement and display all the data rows in 'students' table, "SELECT * FROM students;"
And sure enough the class value for studentid 1 is changed from 'First' to 'Second'.

Check out the whole playlist of SQL Tutorials or Individual video from the following links,

SQL Tutorial for Beginners. Introduction to SQL Basics
   • SQL Tutorial for Beginners. Introduction t...  

1.Learn What is SQL? Introduction to SQL
   • Learn What is SQL? Introduction to SQL  

2.Learn How to Install MySQL Database Server on Windows Operating System
   • Learn How to Install MySQL Database Server...  

3.Learn What is Database? How to Create and Show Databases using SQL
   • Learn What is Database? How to Create and ...  

4.Learn How to Select and Use Existing Database using SQL
   • Learn How to Select and Use Existing Datab...  

5.Learn How to Delete or Remove Database using SQL
   • Learn How to Delete or Remove Database usi...  

6.Learn What is Database Table? How to Create a Database Table using SQL?
   • Learn What is Database Table? How to Creat...  

7.Learn How to Modify or Update Database Table using SQL
   • Learn How to Modify or Update Database Tab...  

8.Learn How to Delete or Remove Database Table using SQL
   • Learn How to Delete or Remove Database Tab...  

9.Learn How to Add Data Rows in a Table using SQL
   • Learn How to Add Data Rows in a Table usin...  

10.Learn How to Use INSERT INTO SELECT Statement in SQL
   • Learn How to Use INSERT INTO SELECT Statem...  

11.Learn How to Update Data Rows using Update Statement in SQL
   • Learn How to Update Data Rows using Update...  

12.Learn How to Delete Data Rows using Delete Statement in SQL
   • Learn How to Delete Data Rows using Delete...  

Subscribe to my channel:    / @pntutorialsbypradnyankurnikam