May 2020
Beginner
564 pages
14h 9m
English
To avoid deleting everything from your table, you can use the WHERE clause with your DELETE statement. To delete data from a table in MySQL, use the following syntax:
DELETE FROM lahmansbaseballdb.collegeplayingWHERE <{where_expression}>;
You can get this syntax by taking the following steps:
This places the DELETE syntax for that table into an SQL query window.
Let's analyze what you might want to delete from the collegeplaying table based on some records you inserted in the previous section of this chapter. If you run the following query, you can see what you inserted:
USE lahmansbaseballdb; ...Read now
Unlock full access