Thursday, 25 November 2010

Database Basic - C.R.U.D.


Salam Anak IT readers~ Yes... You...
A lot of people (more than one a.k.a two) were asking me what are required actions to be taken by the database when we develop a system and I was like "apakan?..." hahaha but now I understand apa maksud bisdia ane... So here is my BRIEF explaination...
It actually depends on what kind of system are you developing... Does it require any data? If yes, do you need to record the data? Will the data be used in the future? If yes then of course we need to store the data in a place called "database" and the overall system is called "Information System" since we deal with information... Clear? Blur? Samar-samar? We move on...
Maksudnya atue, there are certain system yang memerlukan informasi and ada yang inda memerlukan langsung for example this "My Personal Alarm Clock" program. Click on it if you asked "apakan tue?" =) Banyak lagi sebenarnya system yang inda memerlukan "stored information" and the best example will be hmmm.... Game Solitaire? Calculator? etc. but mostly games yang canggih-canggih masa ane require database to save the user's information (like name, nickname) as well as their latest achievement/level or even weapon used in the game...
So what are the examples of system that requires information? Have you heard about "Student Information System" where it stores students' information? Book Keeping System? Document Management System? Library System? Store Keeping System? Dan yang sewaktu dengannya as long as it deals with data...


Back to their question, there are many actions we could apply when we deal with data. The most basic and crucial actions are CRUD:
  1. Create - you create and store a data into database
  2. Read - then, you read the stored data by retrieving it from the database
  3. Update - if you think you need to change some data, you may update the data stored in the database
  4. Delete - last but not least, mun rasanya inda lagi beguna, you may delete the data by removing it from the database
In order to manipulate the data, you must have at least basic skill on SQL (Structured Query Language). It is a syntax that is required in order to establish a communication between Front End application/software/program/system and the database. If you think you already know how to use SQL, click here to read Khadijah's post on SQL Zoo or else, hmmm click here kalie bisai...
Here are examples of the CRUD's SQL syntaxes:
  • Create - INSERT INTO table_user (name) VALUES ('zul')
  • Read - SELECT * FROM table_user
  • Update - UPDATE table_user SET name='fadly' WHERE name='zul'
  • Delete - DELETE FROM table_user WHERE name='fadly'
There you go... Even though it is not in detail but hopefully tane sama-sama mendapat ilmu yang bermanfaat serba sedikit...
Sekian, wassalam...

P/S: I you feel like ada kan ditambah, give your comments! =)