Sunday, January 21, 2007

SQL – Structured Query Language

SQL stands for Structured Query Language and it is generally referred to as SEQUEL. SQL is simple language to learn. SQL is a Nonprocedural language, as compared to the procedural or third generation languages (3GLs) such as COBOL and C.SQL was developed by IBM in the 1970s.

The American National Standards Institute (ANSI) published its first SQL standard in 1986 and a second widely adopted standard in 1989. ANSI released updates in 1992, known as SQL92 and SQL2, and again in 1999, termed both SQL99 and SQL3. Each time, ANSI added new features and incorporated new commands and capabilities into the language.

is a simple, yet powerful, language used to create, access, and manipulate data and structure in the database.

SQL Statements categories:DDL - Data Definition Language.

DDL is used to define, alter, or drop database objects and their privileges. DDL statements will implicitly perform a commit.

DDL Statements:

Create It is used to create objects(tables, views) in the database.
AlterIt is used to alter the structure of the database objects.
Dropdelete database objects (It will invalidate the dependent objects ,it also drops indexes, triggers and referential integrity constraints ).
Truncateremove all records from a table, including all spaces allocated for the records are removed (It is fast as compared to Delete and does not generate undo information as Delete does. It performs an implicit commit as it is a DDL. It resets the high water mark.)
Grantassigning privileges

DML - Data Manipulation Language.

DML is used to access, create, modify or delete data in the structures of the database.

DML Statements:

Select Select data from the database
InsertIt is used to insert data into a table
UpdateIt is used to update existing data within a table
DeleteIt removes rows from the table.

DCL - Data Control Language

Following are the examples of Data control Statements.

DCL Statements:

Commit It will end the current transaction making the changes permanent and visible to all users..
SavepointIt will identify a point(named SAVEPOINT) in a transaction to which you can later roll back
RollbackIt will undo all the changes made by the current transaction.
Set- TransactionIt is used to define the properties of a transaction.

This page is powered by Blogger. Isn't yours?

SQL PL/SQL Blog   QTP Blog   PL SQL   SQL Tutorials   PL/SQL Tutorials   Apple iphone Blog