From the course: MySQL Essential Training (2019)

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Deleting data

Deleting data

- [Instructor] The delete statement is used to remove rows from a table. For this lesson, we'll use the scratch database as modified in the previous lessons. Here in MySQLWorkbench I'm connected with my admin connection and you'll notice my first line here is USE scratch and then I create a table with three columns and integer and two 16 character strings, and then I insert these five rows into the table. You'll notice that the A column is the same in the first row and in the fifth row. That's intentional, that's so that we can demonstrate some aspects of the delete statement. So I'm going to go ahead and shift + command + enter here on my Mac or you'll use shift + ctrl + enter on other operating systems to execute all of this at once. And there we go. And if I bring up my bottom tab here, you'll see that we have each of these commands, they're all successful and we have affected all those rows. Go ahead and close that for now, just for the limited space that I have on the screen…

Contents