SQLancer
LESSON 14

SQL (Core) - Updating rows

Progress: 0%

SQL Lesson 14: Updating rows

Database records frequently change as new information becomes available. In SQL, you modify existing row data using the UPDATE statement.

Update Syntax & Safe Filters

The UPDATE query requires a table name, a SET clause specifying new values, and a critical WHERE constraint:

UPDATE table_name
SET column1 = value1, column2 = value2
WHERE condition;
⚠️ Important: Always verify your WHERE condition before running an UPDATE query. Without a WHERE clause, SQL will overwrite column values for every single row in the entire table!

🗄️ Schema Explorer SELECTABLE

movies
|

🎯 Exercises Checklist:

1. The director for A Bug's Life is incorrect, it was actually directed by John Lasseter
2. The year Toy Story 2 was released is incorrect, it was released in 1999
3. Both the title and director for Monsters, Inc. are correct, but update the director Dan Scanlon to Daniel Scanlon
⚡ Practice Console

Data Output

No results. Run query to fetch data.

Current Task Target

5 rows