Learn how to use the DELETE FROM statement to remove rows from a table and the WHERE clause to determine which rows are removed.
- [Instructor] To delete rows from a table,…you use the delete from statement.…And we're going to go back to our test db, database here.…And in the previous lesson we created a test table,…we added some rows to it, it looks like this.…And we can use the delete from statement…to delete a row, like this.…And that will delete the row…that has a three in the A column.…That's the one that says beauty there.…
And so when I say go,…you see that that row is no longer there.…Deleting rows is destructive, that is once they're deleted…they cannot easily be recovered.…So if you're typing SQL directly,…as we are here in this tutorial,…it's a good idea to audition your where clause…with a select statement like this.…And I need an asterisk there, I made a typo.…So, SELECT * FROM test WHERE a = 4.…
I can see that matches just one row.…And if I say WHERE a = 1, I can see that matches two rows.…And now if I use DELETE FROM,…and I'll put in another select after,…you see that both of those rows are now gone.…The ones where a = 1.…We'll cover the where clause in a lot more detail,…
- Understanding SQL terminology and syntax
- Creating new tables
- Inserting and updating data
- Writing basic SQL queries
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Defining functions in PHP
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times1m 52s
11. Views and Subselects
12. Defined Functions
13. A Simple CRUD Application
- 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.