SQL · Lesson 6 of 8
INSERT, UPDATE & DELETE
Adding, changing and removing rows safely.
These statements change data:
INSERT INTO jobs (title, city) VALUES ('Tester', 'Kochi');— add a row. Name the columns so the statement survives table changes.UPDATE jobs SET salary_lpa = 4 WHERE id = 1;— change rows.DELETE FROM jobs WHERE id = 9;— remove rows.
Always write the WHERE clause first. UPDATE or DELETE without WHERE changes every row. In real systems, run a SELECT with the same WHERE to preview, and use transactions (BEGIN … COMMIT / ROLLBACK).
Don't worry here — the sample database is rebuilt every time you press Run.
Try it yourself
Press Run to see the results.
Runs on a small fictional sample database (companies, jobs) that is rebuilt on every run, so you can't break anything.
Key points
- Name columns in INSERT.
- Never run UPDATE/DELETE without WHERE by accident.
- Preview with SELECT; use transactions in production.
Quick check
What happens with DELETE FROM jobs; (no WHERE)?
Without WHERE, DELETE removes all rows (the table itself stays).
Practice task
Add a new company in 'Cyberpark' with 40 employees, then show all Cyberpark companies.
Interview corner
DELETE vs TRUNCATE vs DROP?
DELETE removes chosen rows and can be rolled back. TRUNCATE quickly removes all rows (not available in SQLite). DROP removes the whole table and its structure.
What is a transaction and what does ACID mean?
A group of statements that succeed or fail together. ACID: Atomicity, Consistency, Isolation, Durability.
Further reading
Official documentation, linked for deeper study. These are outside sites; this lesson's text is our own.
Original lesson written by the InfoparkDaily team · © 2026 InfoparkDaily · Free to learn — no paid course or subscription.