 Hey everybody, this is Brian. Welcome to our 50 second lamp tutorial. Today we're going to be discussing how to update rows All right, so we've got our our products table. It's got a primary key description cost and Date added and as you can see whoopsie Get rid of that. I was playing around Here's our actual data here and what we're going to do is we're going to update the cost field for one of these Records and let's just say Bob's gun shop record three. We're going to actually go here We're going to choose the update statement as you can see the update statement is very similar to the insert statement say update Database table and we're going to get rid of some of this clutter here make this little easier to understand So there's our table because we're using the my store database We're not going to update the primary key And we're not going to update the description Or the date added we're going to update the cost here We're going to say the cost equals and we're going to say $2.99 And we have a where statement and we're going to say where and let's say one So what we're going to do is we're going to say this first record here Actually, no, we said the third didn't we sorry Bob's gun shop. We're going to change that from $99 to $2.99 So we're going to choose the primary key of three So very simply we're saying use of the my store database update the table products Set the cost equal to 99 where The primary key will three and then we're just going to select the record so we can see him look the wrong one. Sorry about that There we go As you can see, there's our Bob's gun shop to 99 so it updated that and we can change it again Let's just for the sake of argument change it to $4.99 Because you can buy an entire gun shop for only $4.99 as you can see we're updating the data Pretty simple pretty easy you can choose any of the columns you want except for the primary key because that's an auto increment field You can't do that The order by would not make any sense here because you're just updating all the records that meet this where Qualification you should note that if you omit this where if you just take that out It's going to do all of them now if you are in the mysql editor and you try this It's got built-in safeties where it just won't let you do that. I Think in the preferences you can actually go in and change it around but Just in case you're at home playing around like we'll set this to one After I was like why didn't that work? Geez? I am starving. I'm waiting for my pizza to get done There we go. So it changed to $4.99 So you can see how you can do individual ones, but if you try taking the where statement out and that's not a shortcoming of the language It's a shortcoming of the mysql editor or the mysql workbench I think there's somewhere in edit preferences where you can actually disable that Well, that's all for this tutorial. I hope you found this educational entertaining and thank you for watching