🗃️Create, Read, Update, Delete (CRUD)
Also known as CRUD, CRUD Operations, CRUD App
The four jobs you do on data: add it, read it, change it, and delete it.
Think of it like
It is like a box of cards. You add a card, read it, fix it, or throw it away.
Example
Jack builds a to-do app. Adding a task, listing tasks, ticking one off and removing one are its four CRUD jobs.
Why it matters
Most apps are CRUD at heart. Once you can do these four jobs, you can build the core of a lot of software.
Definition
Example code
sql
INSERT INTO tasks (title) VALUES ('Buy milk');
SELECT * FROM tasks;
UPDATE tasks SET done = true WHERE id = 1;
DELETE FROM tasks WHERE id = 1;Common mistake
Key takeaways
- 1Four jobs. Create, read, update, delete.
- 2Same in many places. SQL, web APIs and app screens.
- 3Aim before you change. UPDATE and DELETE need a WHERE.