Saturday, April 17, 2010

Chapter 01: An Introduction to Databases

Download Video Source: High-Quality : 40 MB

Click below arrow to download….

What:

We all know Database is used for storing Data. There are billions of technical definitions available, but we will just continue with this simple definition for now ;-)

Why:

Once upon a time, Computing is used for only Mathematical Calculations. A need for permanent storage of data was not there then. In this new age of Computing, we need to permanently store data for future processing. Example situations are available in millions. Be it, a list of employees in a company or students in a school/university, online reservation systems and lot more. We just can't keep records in hand-written notebooks anymore.

Problem with Previous Techniques:

When we talk about Permanent storage, don't we have files ? Text documents ? Word Documents ? Excel spreadsheets ?
  1. Open a Notepad
  2. Type a list of 10 or 20 employees
  3. Save it as Employees.txt
Well, yes. We did it. We permanently stored data. Why need a Database then? Answer lies behind the advancement of Computing. Consider the following situation.
  • I need the list of employees joined this year ?
  • I need the no. of employees retiring this year ?
  • How many employees have a P.G Degree in Mathematics ?
  • Which department has the most number of Employees ?
Now, doing this manually would be a herculean task.You open the employee.txt file, check and count the employees. If it is 10 or 20 employees, fine. But how about, 100 ? or 1000 ? or assume 20 Million ?
It has just become impossible. Retrieval was extremely difficult. Even managing the data would be even more difficult, in terms of adding a new record or modifying an existing one, say for example - changing phone/address of an employee. Such tasks can be achieved in Micro Seconds if you are using a Database. That's why Computing has advanced and created a data storage TECHNOLOGY called DATABASE using which data can be stored,retrieved & maintained easily & effectively.
Well, we just got an Improved definition !

Database Model

Now that you understood Database stores data somewhere & helps you maintain it efficiently, you should also know that there are different Database Models available that define HOW THE DATA IS STORED !
Some standard models available are Relational Model, Network Model, Object-Oriented model...
You should remember that in all those models, the Data is still stored in a file BUT the way it is stored and retrieved is different. This is performed by something called DBMS.

DBMS

DBMS is the next buzzword used most of the times in Databases technology.
  • It's the abbreviation of DataBase Management System.
  • DBMS is a software.
  • It helps you create and manage a DATABASE.
  • It will work based on one of the Database models described above.
  • RDBMS is a DBMS software that implements the RELATIONAL Model.
  • RELATIONAL Model uses TABLES to represent data.
  • TABLES are a collection of rows and columns.
  • Below is a good example of TABLE
Emp_IdEmp_NameAgeDateJoined
1001Vignesh23OCT-22-2008
1002Raju25NOV-13-2007
1003Sachin35APR-24-2006

Most of the Prominent Databases available these days are RDBMS.
Few examples are - Oracle, MySQL, MS SQL Server.
    Hmmm.....Familiar names, aren't they ?

    Apart from storage & retrieval, DBMS softwares provide some extraordinary features like the following.
    • Allows concurrency
    • Control security
    • Maintain data integrity
    • Provide options for backup and recovery
    • Control redundancy
    • Provide non-procedural query language
    • Perform automatic query optimization

    Database Schema

    • Once you install an RDBMS, you need to create a database schema.
    • A database schema is a collection of Database objects.
    • Database objects are the various concepts/features provided by a DBMS like, Tables, Views, Indexes, Sequences, Functions, Procedures, etc.,
    • For Example, we can have a schema named UniversityXYZ which will contain some 15 tables, 10 views, 32 functions etc.,
    • So, Schema helps us GROUP the database objects together.

    SQL

    You have something called DATABASE which will store data. Now, to STORE and RETRIEVE, you will need a STANDARD FORMAT to communicate with the DBMS software. If you are going to store some employee details in a Database like ORACLE, how will you add a new employee ?
    Two approaches.
    1. Hi Computer, Mr.X has unfortunately joined our company TODAY. Please add this pathetic young man to your database.
    2. INSERT INTO Employees VALUES('Mr.X', '17-APR-2010')
    We are storing data of one employee in database. And the important thing here is - how you STORE it in database. First example, English sentence...the compter cannont undertstand.....That's why you have a standard language......named as SQL. The beauty is that the above Query will be accepted by any RDBMS !

    Because SQL is a common standard and is understood by all the RDBMS like Oracle, MySQL etc.,
    • SQL is the abbreviation of Structured Query Language.
    • It was accepted as the STANDARD language for Databases.
    • SQL has a set of KEYWORDS using which you write a Query.
    • A Query is a request to the database to perform an operation.
    • There are two basic type of SQL namely, DDL & DML.
    • DDL - Data Definition language - used to create, delete database objects.
    • Some standard DDL Keywords are CREATE & DROP.
    • DML - Data Manipulation Language used to retrive & modify data.
    • Some standard DML Keywords are SELECT, INSERT, UPDATE & DELETE.

    7 comments:

    1. Wow wonderful blog post about the post "IT kids". This blog post presented in many languages. This would be useful for all blog readers. Great idea. Keep it up!!

      videos

      ReplyDelete
    2. nice blog to study! please visit my blog

      itenshares.blogspot.com

      ReplyDelete
    3. Very very Useful.....Very easy to understand.Thank u so much for sharing

      ReplyDelete
    4. This is an awesome post ...Stores so many effective and informative inputs. Thanks for your brilliant words.
      web designing company

      ReplyDelete
    5. superb... very nice tutorial.. i like ur way of teaching...

      ReplyDelete
    6. Hi Bro, you are genius.. superb your study method. I am eager to read, so plz continue your DBMS.. I want to learn a lot from you. please put your next tutorial...

      can you explain MySql and Oracle?
      how to create DBMS in MySQL? please put tutorial about that....

      ReplyDelete

    Our Google Group

    Our Facebook Group