SQL (Structured Query Language)
It was developed by IBMC in the year 1969.
the first name of sql was ‘se quel’.
sql is a common language for all rdbms softwares, because sql is called as universal language.
sql is also called as 4th generation language or non procedural language.
Non-Procedure Language
sql tells to oracle database “what should be done, but not how to do it”
ex: select name,salary from employe;
Differences Between sql and sql*plus commands
====================================
sql
1)every sql command must be teriminated by a semicolon.
2)it allows to type the sql command for more than one line for readability. (do not split the keyword)
3)most recently typed sql command will be stored in sql buffer.
sql*plus
1)every sql*plus command may or may not be teriminated by a semicolon.
2)sql*plus command must be typed in a single line.
Note: if you want to type the sql*plus command in multiple lines, you must use one special character that is hyphen [ – ] at the end of a line.
3)these commands are not stored in sql buffer.
what is SQL Grammar ?
————————-
Grammar means rule or syntax.
every sql command must be terminated by a semicolon.
SQL-The Structured Query Language
SQL is a simple, powerful database access language that is the standard language for relational database management systems. The SQL implemented by Oracle Corporation for Oracle is 100 percent compliant with the ANSI/ISO standard SQL data language.
SQL Statements
All operations on the information in an Oracle database are performed using SQL statements. A SQL statement is a string of SQL text that is given to Oracle to execute. A statement must be the equivalent of a complete SQL sentence, as in:
SELECT ename, deptno FROM emp;
A SQL statement can be thought of as a very simple, but powerful, computer program or instruction. SQL statements are divided into the following categories:
- Data Definition Language (DDL) statements
- Data Manipulation Language (DML) statements
- Transaction control statements
- Session control statements
- System control statements
- Embedded SQL statements
- Data Definition Statements (DDL)
DDL statements define, maintain, and drop schema objects when they are no longer needed. DDL statements also include statements that permit a user to grant other users the privileges, or rights, to access the database and specific objects within the database.
- Data Manipulation Statements (DML)
DML statements manipulate the database’s data. For example, querying, inserting, updating, and deleting rows of a table are all DML operations; locking a table or view and examining the execution plan of an SQL statement are also DML operations.
- Transaction Control Statements
Transaction control statements manage the changes made by DML statements. They allow the user or application developer to group changes into logical transactions. Examples include COMMIT, ROLLBACK, and SAVEPOINT.
- Session Control Statements
Session control statements allow a user to control the properties of his current session, including enabling and disabling roles and changing language settings. The two session control statements are ALTER SESSION and SET ROLE.
- System Control Statements
System control commands change the properties of the Oracle server instance. The only system control command is ALTER SYSTEM; it allows you to change such settings as the minimum number of shared servers, to kill a session, and to perform other tasks.
- Embedded SQL Statements
Embedded SQL statements incorporate DDL, DML, and transaction control statements in a procedural language program (such as those used with the Oracle Precompilers). Examples include OPEN, CLOSE, FETCH, and EXECUTE
Standard set of sql commands
—————————————-
1)data definition language commands (ddlc)
These commands are used for creating ,altering and removing the structures.
2)data manipulation language commands(dmlc)
These commands are used for adding, deleting, updating data.
3)data query language commands(dqlc)
These commands are used for retrieving the data from the specified table or tables.
4)transaction control language commands(tclc)
These commands are used for controlling the dmlc transactions. (insert, delete or update)
5)data control language commands(dclc)
These commands are also called as security management commands or dba commands.
These commands are used for controlling and accessing the oracle database.
6)session control language commands (sclc)
These commands are used for controlling the current session default settings.

