To remove data that you've previously inserted into your database, you need to use the DELETE statement. You can delete all the records from a table, or use a WHERE clause to delete only some of the records from a table.
Deleting data from tables
Using the DELETE statement with a WHERE clause
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.collegeplaying
WHERE <{where_expression}>;
You can get this syntax by taking the following steps:
- Right-click on Tables in MySQL Workbench.
- Select Send to SQL Editor.
- Then, select Delete Statement.
This places the DELETE syntax...