Ad space (banner)
🗄️SQL Lessons
Lesson 8 / 50

Modifying Data with INSERT, UPDATE, and DELETE

This lesson covers the basics of adding, changing, and removing data with INSERT, UPDATE, and DELETE. It's for anyone searching "SQL INSERT UPDATE DELETE."

INSERT adds a row, UPDATE changes existing rows, and DELETE removes rows. Unlike SELECT, which only reads, these three actually rewrite what's stored in the database.

The example inserts a new student, corrects their score with UPDATE, then removes rows matching a condition with DELETE — and a final SELECT shows how the table changed after each step.

A common early mistake is forgetting the WHERE clause on UPDATE or DELETE — without it, every single row is affected. This is a genuinely costly mistake in production, so it's a good habit to run the equivalent SELECT first to double-check exactly which rows you're about to touch. Together, these three operations power the day-to-day data management behind every account signup, profile edit, and cancellation on the web.

SQL
OUTPUT

💡 The SQL engine may take a few seconds to load the first time you run code.

Ad space (banner)
Ad space (in-article)