CRUD and databases

There’s an unpleasant-sounding acronym — CRUD — used in programming. In fact, there’s nothing unpleasant about it. It refers to these four basic functions: create, read, update and destroy (or delete). You now know how to do all four with SQL queries:

Create: INSERT INTO table ...
Read: SELECT * FROM table ...
Update: UPDATE table SET ...
Destroy: DELETE FROM table WHERE ...

The acronym CRUD might be used when referring to a mobile app such as a contact list. The user can create, read, update and destroy any contact in the list. WordPress (and any other content management system) is a CRUD app, based on a database containing posts, pages, comments, etc. If you have your own WordPress site, you can create, edit (update) and delete posts, etc. — and everyone else can read your posts.

Another way to think about CRUD: these are the basic operations we need to manage data in a database.

Now you know!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s