Saturday 21 July 2012

Structured Query Language : Database Language

SQL - 

             SQL is known as Structured Query Language (pronounced as S-Q-L) was developed by IBM in mid-1970's. It’s a non-procedural language (i.e. one does not have to specify all the steps required to perform a action).
It’s an international language used for querying and creating relational databases (database that stores data in the form of tables i.e. rows and columns) and the most common SQL standard is SQL-92 (standard is known as SQL-92 because the standard was approved in 1992).However the standards SQL-99 extensions are used by most vendors.

SQL CLASSIFICATION - 

              SQL command can be divided into 3 categories - 

  1. DDL 
  2. DML
  3. DCL
DDL is referred as Data Definition Language. It generally includes commands that are used for defining  a database i.e. creating, altering, dropping database, tables and establishing constraints such as primary-foreign key constraints. For Example - 
  • CREATE command is used to create a database or table. CREATE DATABASE db_admin.
  • DROP command can be used for various purposes such as deleting a database,  table or an index. DROP DATABASE db_admin.


DML is referred as Data Manipulation Language. It generally includes commands that are used for maintaining and querying a database i.e. inserting, deleting, searching or updating a record in a table. For Example - 


  • INSERT command is used to insert a new record in the table in database. INSERT INTO tbl_admin VALUES ('a','b').
  • SELECT command is used to select and view a record depending in the way query is used. SELECT * FROM tbl_admin.
DCL  is referred as Data Control Language. It generally includes commands that are used to control a database i.e. administering, privileges and committing data. For Example -
  • GRANT is used to allow specified users to perform specified tasks. GRANT SELECT ON TABLE tbl_admin TO PUBLIC.
  • REVOKE to cancel previously granted or denied permissions. REVOKE CREATE TABLE FROM testing. (testing is a role)

No comments:

Post a Comment