2023-05-05 - CRUD with SQL
main topics
- SQL
- SELECT
- INSERT
- UPDATE
- DELETE
- MVC with a DataBase
INSERT
INSERT INTO table (field1, fieldN)
VALUES (value1, valueN);
UPDATE
Important
NEVER forget to use a WHERE
when using UPDATE
(unless you really know what you're doing).
UPDATE table
SET field = new_value
WHERE id = some_id
DELETE
Important
NEVER forget to use a WHERE
when using DELETE
.
DELETE FROM table
WHERE condition