Beginner

711. UPDATE Multiple Columns

Learn how to update more than one column in a single UPDATE statement.

📘 Lesson 710 of 728 ⏱ 6 min 🎯 Beginner

SQL allows multiple columns to be modified within a single UPDATE statement by separating each column assignment with a comma.

Updating multiple columns together keeps related information synchronized and reduces the number of SQL statements executed.

After an employee transfers to another department, both the Department and Salary columns are updated together.

SQL
UPDATE Employees
SET Department = 'Finance',
    Salary = 75000
WHERE EmployeeID = 101;

Businesses frequently update customer information, employee details, product information, and order status using a single UPDATE statement.

  • Updates multiple columns together.
  • Uses one UPDATE statement.
  • Assignments are separated by commas.
  • Works with a WHERE clause.
  • Improves query efficiency.
  • Maintains data consistency.
  • Reduces unnecessary database calls.
Can UPDATE modify multiple columns?

Yes. Multiple columns can be updated by separating assignments with commas.

Why update multiple columns together?

It improves efficiency and keeps related information synchronized.

Have you finished this lesson?

Introduction to SQL – All Lessons