UPDATE

SQL UPDATE Keyword

The UPDATE command is used to modify existing rows in a table. It allows you to change one or more column values for rows that match a specified condition.

Important: Be careful when using UPDATE without a WHERE clause — it will update all rows in the table.

Tutorials dojo strip

SQL UPDATE Syntax

SQL

SQL UPDATE Single Row Example

This query updates the specialty of the doctor with doctor_id = 1.

SQL

SQL UPDATE Multiple Rows Example

This query sets the gender of all patients with last name ‘Garcia’ to ‘Female’.

SQL

SQL UPDATE Labs

Tutorials dojo strip