SQL Update

The UPDATE in SQL is used to modify existing records in a table. It allows you to change one or more values in one or more rows of a table.


Tutorials dojo strip

SQL Update Syntax

SQL


SQL Update Example

SQL Update Updating a Single Record Example

This query updates the contact_number to ‘555-9999’ for the patient with patient_id = 2 in the Patients table.

SQL


SQL Update Multiple Records Example

This query updates the status to ‘Rescheduled’ for all records in the Appointments table where the appointment_date is ‘2024-07-18’.

SQL


SQL Update Multiple Columns Example

This query updates the contact_number to ‘555-1234’ and the dob (date of birth) to ‘1991-01-15’ for the patient with patient_id = 5 in the Patients table.

SQL


SQL Update Visual Diagram


SQL Update Labs

Tutorials dojo strip