MySQL Essential Training: How to Update Rows in MySQL


show more Updating rows provides you with in-depth training on Developer. Taught by Bill Weinman as part of the MySQL Essential Training show less
please wait ...

Updating rows

The update statement is used to change data in existing rows in a table. In this lesson, I'll be using the Scratch Database. And, I'm continuing with the test table that I created in the previous lesson. So if we say, SELECT * FROM test;, we can see the state of this. And we'll go ahead and we'll update a row. The update statement uses a where clause, just like the select statement. So, sometimes I like to start with a select statement with a where clause, like this, where a equals two.

And then I know that my where clause is. Selecting just the row that I want to change. This prevents me from accidentally updating rows that I don't intend to update. So for example, here I can say, UPDATE test, SET C equals Extra Funny. And we use that where clause that I've already typed and presumably debugged. And then after this I can say select star from test, and we can see the result. So there it is.

Sense of humor, extra funny. So you see that the. Update statement is used to change the d...

Updating rows
Video duration: 2m 21s 4h 24m Beginner

Viewers:

Updating rows provides you with in-depth training on Developer. Taught by Bill Weinman as part of the MySQL Essential Training

Subject:
Developer
Software:
MySQL
Author:
please wait ...