Skip to content

Data Manipulation Language (DML) ​

INSERT ​

With INSERT you can add data into a table

sql
INSERT INTO people (name, age, city)
VALUES ('Adam', 42, 'Rovaniemi'), ('Amanda', 35, 'Rovaniemi');

UPDATE ​

UPDATE updates the matcing rows

sql
UPDATE people SET city = 'Oulu' WHERE name = 'Adam' AND age = 42;

WARNING

Without WHERE the UPDATE matches every row in table and will update every row

DELETE ​

Deletes matching row from a table

sql
DELETE FROM people WHERE city = 'Oulu';

WARNING

Without SELECT the DELETE matches every row in table and will delete everything

Safe updates ​

MySQL Workbench rejects the updates and deletes without any restrictions. If you want to turn it off, it can be done from Edit -> Preferences -> SQL Editor and in the bottom of the screen (scroll down) uncheck Safe Updates

Safe updates

Lapland University of Applied Sciences

© 2026 Juha Petäjäjärvi

© 2026 Juha Petäjäjärvi