MY mENU


Wednesday 7 March 2012

What is SQL and SQL*plus?


Structured Query Language (SQL):
Almost all relational database management systems use SQL (Structured QueryLanguage) for data manipulation and retrieval. SQL is the standard language forrelational database systems. SQL is a non-procedural language. 
SQL Commands are divided into four categories, depending upon what they do.
DDL (Data Definition Language)
DML (Data Manipulation Language)
DCL (Data Control Language)
Query (Retrieving data)

DDL commands are used to define the data. For example, CREATE TABLE.
DML commands such as, INSERT and DELETE are used to manipulate data.
DCL commands are used to control access to data. For example, GRANT.
Query is used to retrieve data using SELECT.

DML and Query are also collectively called as DML. And DDL and DCL are called as
DDL.



 SQL commands include commands of ANSI/ISO SQL and extra commands added to ANSI SQL by oracle.The following are the rules to be followed while entering SQL commands.
1. An SQL statement may be entered in multiple lines.
2. It is not possible to break a word across lines.
3. SQL statement must be terminated by semicolon (;).
The following is an example of SQL command. What this command does is not important at this moment.
SQL> select ccode,name
2 from courses
3 where fee > 5000;
In the above command, we entered the command in three lines. When you enter semicolon and press enter key then SQL*PLUS will take it as the end of the command.



SQL*Plus statements are available only in SQL*PLUS. They are not part ofstandard SQL. SQL*Plus commands are mainly used for two purposes – editing SQL commands and formatting result of query.
The following rules are to be followed while entering these commands.
1. The entire command must be entered on a single line.
2. No need to terminate command with semicolon (;).
3. Commands can be abbreviated. However, the amount of abbreviation isnot fixed. Some commands are abbreviated to one letter some are abbreviated to 2 and so on.
The following example show how to use CLEAR SCREEN command of SQL*PLUS.

SQL>clear screen
Or it can be abbreviated to
SQL>cl scr

No comments:

Post a Comment