Join Bill Weinman for an in-depth discussion in this video Deleting rows, part of MySQL Essential Training (2014).
…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, then those two rows'll be…deleted and our result will show the null and the three and the four.…
- Writing queries
- Creating and updating databases and tables
- Using MySQL built-in functions
- Sorting and filtering data
- Updating tables with triggers
- Working with subselects and views
- Creating and using a stored function
Skill Level Beginner
1. Installing and Configuring the Test Environment
2. Basic Syntax
3. Creating a Database
4. MySQL Data Types
5. MySQL Functions
8. Subselects and Views
9. Stored Routines
10. PHP's PDO Interface with MySQL
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.