From the course: Database Foundations: Intro to Databases

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Update and delete records

Update and delete records

From the course: Database Foundations: Intro to Databases

Start my 1-month free trial

Update and delete records

- [Narrator] When you want to modify the values that are already stored in a table row, then you can use the update command. Let's take a look at the data that's already in the products table that we entered in the previous movie. I'm going to right-click on the products table that's inside of the Two Trees database in the SQL Server instance, and then from the pop-up menu, choose select top 1,000. This shows me the four rows of data that we've entered. The last row that we entered, we didn't supply a category or a size. We can update the row and fill in these values by making reference to the primary key for the table. In this table, the SKU column provides the primary key and you can see that based off of the PK notation here inside of the connections sidebar. So the primary key value for the row that we want to change is OGEC004. Now that we have this piece of information, we can start our update command. I'm going…

Contents