Tuesday, June 30, 2009

Learn SQL Server - What is SQL?

SQL is an acronym for Structured Query Language which is used in almost all of the Relational Database Management Systems (RDBMS) to arrange, manipulate and secure the data stored in a database system.

It is a Non-procedural language. By this we mean, we tell RDBMS - what output do we want? - And - how to do it? - is a job of RDBMS, in contrast with other procedural languages like C, C++, C#, Java where we need to code for how a particular problem should be solved.

Some databases like Oracle have a procedural version of SQL called as PL/SQL.

USES OF SQL:
It is used to communicate with DBMS for-

1. Data Structure Operations:
For creating/altering data structures for data storage and data manipulations. Creating and altering tables, procedures, function and triggers etc.

2. Data Manipulation Operations:
a. Putting new data into the database (Create/Insert Operation).
b. Retrieving data (Retrieve/Select Operation).
c. Updating the existing data (Update Operation).
d. Deleting the existing data (Delete Operation).

These basic data operations are collectively called as CRUD operations.

3. Data Access Control Operations:
To secure data stored in a database system, one needs to have facility to protect the data from unauthorized users. For this, SQL provides commands for creating users, roles and allowing/disallowing them from accessing the data from a database system.

4. Transaction Control Operations:
Most of the real life situation is a collection of related actions. If any one of these action fails, we should be able to restore situation at the start of the scenario. The collection of related actions together is called as Transaction. And each action will be represented as SQL command. SQL provides us the facility to handle these kinds of SQL Transactions with the help of in-built commands.