CRUD means create, read, update, delete. In SQL, INSERT creates rows, SELECT reads, UPDATE changes, and DELETE removes. Explicit column lists make value placement clear. This self-contained sequence starts with the setup dataset and rolls its changes back:
BEGIN;
INSERT INTO books (title, shelf_id, pages) VALUES ('Stone Garden', 3, 64);
UPDATE books SET pages = 72 WHERE title = 'Stone Garden';
SELECT title, pages FROM books WHERE title = 'Stone Garden';
DELETE FROM books WHERE title = 'Stone Garden';
ROLLBACK;
The SELECT returns Stone Garden and 72. A transaction groups changes; COMMIT completes the transaction and makes its changes permanent, subject to the database’s durability settings and storage behavior. ROLLBACK discards uncommitted changes. An UPDATE or DELETE without WHERE affects every row. Preview the same condition with SELECT, check counts, use an appropriate transaction, and maintain tested backups. Transactions are not a substitute for backups, particularly after commit. Concurrent changes can complicate a preview.
The INSERT omits id and published: SQLite assigns an ID and uses the declared default of 1. The UPDATE then changes only matching rows. A title is not declared unique in this schema, so a real update should normally use a known primary key rather than assume a title identifies one book. If a statement fails, inspect the error and transaction state; do not assume every database or every error automatically rolls back the entire transaction.
A soft delete marks a row instead of removing it; queries must consistently exclude marked rows, and retention and privacy requirements still apply. Foreign keys can reject a delete or trigger configured actions; check the schema. An ORM maps application objects to database operations, often generating SQL. It does not remove the need to understand queries, transactions, or security.
For a production-design example of who may change workflow records, see HyperQuote’s approval handoff.