WeCodeAcademy

Creating, Reading, Updating and Deleting (CRUD)

Almost everything an application does to data is one of four operations, known as CRUD:

OperationSQL
CreateINSERT INTO table (cols) VALUES (...)
ReadSELECT cols FROM table WHERE ...
UpdateUPDATE table SET col = value WHERE ...
DeleteDELETE FROM table WHERE ...

Always include a WHERE on UPDATE and DELETE unless you truly mean every row. Always pass values as ? parameters, never by pasting them into the text. Changes are held until you commit() them to make them permanent.

Examplepython
Open in editor »
Quick check

Which statement changes existing rows?

Your turn: write the code

Raise every price by 10 for products whose name is 'pen' and print the prices as a list ordered by id.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.