Updating allows you to modify existing rows in a table. You can either update specific rows with a WHERE clause or all the rows in a table with UPDATE without WHERE.
Updating data in tables
Using the UPDATE statement with a WHERE clause
Let's say you made a mistake when you inserted a record for the college information earlier in this chapter. You can update this information with the UPDATE clause. To update data in a table in MySQL, use the following syntax:
UPDATE lahmansbaseballdb.collegeplaying
SET
`playerID` = <{playerID: }>,
`schoolID` = <{schoolID: }>,
`yearID` = <{yearID: }>
WHERE ;
You can get this syntax by taking the following steps:
- Right-click on Tables in MySQL Workbench.
- Choose Send to SQL...