Recent Posts

Recent Comments

Followers

View My Stats

Popular Posts

Monday, 16 April 2012

SQL Introduction



Overview 

SQL("Sequel"sometimes referred to as Structured Query Language) is a programming language designed for managing data in relational database management systems (RDBMS).

 SQL was initially developed at IBM in the early 1970s. 

 SQL is a Non-Procedural Language.It is used to Create,Access and  Manipulate data and Structure in the database.

 

SQL consists of these component languages: 


Language Examples
DDL Data Definition Create table, create index
DML Data Manipulation Insert, Delete, Update
DQL Data Query Select
DCL Data Control Grant, revoke
TPL Transaction Processing Begin work, Rollback, Commit




Data Definition Language (DDL)

The Data Definition Language (DDL) is used to create and delete databases and tables. The following SQL Commands are available;
  • CREATE DATABASE creates a new database.
  • DROP DATABASE removes a database and any tables it contains.
  • CREATE TABLE creates a new table.
  • DROP TABLE removes a table and any data it contains.
  • ALTER TABLE modifies the structure of an existing table.
  • CREATE INDEX adds an index to a table.
  • DROP INDEX removes an index from a table. 

Data Manipulation Language (DML)

The Data Manipulation Language (DML) is used to change, add and delete data in an existing table. The following SQL Commands are available:
  • INSERT
  • UPDATE
  • DELETE

Data Query Language (DQL)

The Data Query Language (DQL)is used to display the data in a table or tables. The following SQL Commands are available:
  • SELECT
SQL always produces a SET of data, which is basically a rectangular block of rows (records) and columns (fields). The data set produced is always a single table.

Data Control Language (DCL)

  • Grant
  • Revoke

Transaction Processing Language (TPL)

  • Begin work
  • Rollback
  • Commit

0 comments

Post a Comment