Removing data from MySQL databases is similar to selecting it. Learn how to debug a DELETE query by first SELECTING the data to be deleted, then modifying the query in Python. This video also includes a brief description of using regular expressions in MySQL.
- [Instructor] The next part of this CRUD challenge…is to delete all of the lines…beginning with stage directions.…Shakespeare was pretty light on stage direction…as was typical of his time, but even that has to go.…It's important to note that…we're only going to be doing text matching to delete data.…If a line starts with enter or exit,…and it's not a stage direction, it's going to get cut anyway.…Deleting data in MySQL is extremely simple.…DELETE statements are almost identical…to simple SELECT statements.…Instead of outputting the data, however, they remove it.…Just to show an example, I'll open up a new SQL tab here,…and we will select everything…from amnd_temp where the play text contains Theseus.…
I'll use the in string function here.…If I run that query, you can see that…there's 13 lines that contain Theseus.…If I want to delete these lines instead of selecting them,…all I have to do is replace SELECT star with DELETE.…And I run that.…It affected 13 rows,…so if I put my SELECT star back in here and run it,…
- Strengths and weaknesses of MySQL
- Creating a database
- Joining data sets
- Integrating Python with MySQL
- Searching a database
- CRUD operations
- Performing calculations
Skill Level Appropriate for all
1. Data and MySQL in under Five Minutes
2. Create a Database
3. Join Two Datasets
4. Search a Database
Searching a database1m 51s
5. Create, Read, Update, and Delete Operations
6. Averages and Calculations
Next steps1m 1s
- 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.