teach-ict.com logo

THE education site for computer science and ICT

2. C.R.U.D

A transaction changes the state of a database and there are only four basic operations. You can memorise this with the acronym CRUD

The table below shows the actions and the typical SQL command to carry it out.

Action SQL equivalent
CREATE INSERT or CREATE
READ SELECT
UPDATE UPDATE
DELETE DELETE, DROP

Each action can be relevant at different levels - it could be for a single record or a specific table or even the database as a whole.

For example, the SQL command CREATE can set up an empty database or an empty table within a database. DELETE could delete an entire database, a table or a record.

A set of rules, called ACID, have been developed to help make sure that the contents and layout of a database aren't damaged or broken even if a transaction fails part way through. These rules are built into database management systems.

 

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: What is ACID transaction