Deleting rows


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

Deleting rows

The delete statement is used to remove rows from a table. In this lesson I'll be using the scratch database, and I'll be continuing with the test table that we've been using for the last few lessons. So I'll say select star from test. And we can see that those are the rows in the test table. Now, if I want to delete a row from this table, I can use delete from, test, where a equals two, semi-colon.

And this will delete the row where this condition is true, which is just that one row, sense of humor and all, and if I. Select go, we've still got our select statement in there, so we'll see the result. And that row with the two in it is gone. So just as with the update statement, this where clause is used to select which rows are going to be deleted. So, it's a good idea to test the where clause, right? If I say select. Star from test where a equals, and let's put a one in there now.

Then you'll see that that selects just these two rows. And if I go ahead and do a delete,...

Deleting rows
Video duration: 2m 25s 4h 24m Beginner

Viewers:

Deleting 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 ...