π Day 93: Data Manipulation Language (DML)
Welcome to Day 93! Today, we'll learn about Data Manipulation Language (DML), a subset of SQL used to manage data within database objects.
What is DML?
DML commands are used to insert, update, and delete data in a database. Unlike DDL commands, which work on the structure of the database, DML commands work on the data itself.
Key DML Commands
INSERT
- Definition: The
INSERTcommand is used to add new rows of data to a table. - Syntax:
INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);
UPDATE
- Definition: The
UPDATEcommand is used to modify existing records in a table. - Syntax: Note: The
UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition;WHEREclause is crucial! If you omit it, all records in the table will be updated.
DELETE
- Definition: The
DELETEcommand is used to remove existing records from a table. - Syntax: Note: The
DELETE FROM table_name WHERE condition;WHEREclause is crucial! If you omit it, all records in the table will be deleted.
π» Exercises: Day 93
Please see the exercises.sql file for today's exercises.
Previous: Day 92 β Day 92: Data Definition Language (DDL) β’ Next: Day 94 β Day 94: Data Query Language (DQL)
You are on lesson 93 of 108.