bg_image
header

Data Manipulation Language - DML

ChatGPT:

Data Manipulation Language (DML) is a subset of SQL (Structured Query Language) used to manage and manipulate data within a database. With DML, users can insert, query, update, and delete data — essentially everything you'd typically do with data stored in a database.

The main DML commands are:

Command Purpose
SELECT Retrieve data from a table
INSERT Add new data
UPDATE Modify existing data
DELETE Remove data
-- Insert
INSERT INTO customers (name, city) VALUES ('Müller', 'Berlin');

-- Query
SELECT * FROM customers WHERE city = 'Berlin';

-- Update
UPDATE customers SET city = 'Hamburg' WHERE name = 'Müller';

-- Delete
DELETE FROM customers WHERE name = 'Müller';

Key Points:

  • DML deals with the data inside tables, not with the structure of the tables themselves (that's handled by Data Definition Language, DDL).

  • DML operations can often be rolled back (undone), especially when transactions are supported.

In short: DML is the toolset you use to keep your database dynamic and interactive by constantly adding, reading, modifying, or deleting data.


Create Read Update Delete - CRUD

CRUD is an acronym for the four basic operations used in data processing and database management. CRUD stands for:

  1. Create: Adding new data or records to a database or system.
  2. Read: Retrieving or reading data or records from a database or system.
  3. Update: Modifying or editing existing data or records in a database or system.
  4. Delete: Removing data or records from a database or system.

These four operations are fundamental for managing persistent data in applications, whether in relational databases, NoSQL databases, or other data storage systems. CRUD operations form the foundation of many software applications, especially those that heavily utilize databases, such as web applications, business applications, and many other types of software systems.

In practice, CRUD operations are often implemented using specific commands or methods of a programming language or a database system. For example, SQL commands such as INSERT, SELECT, UPDATE, and DELETE in a relational database.