Академический Документы
Профессиональный Документы
Культура Документы
• English-like
• Non-procedural
• Platform Independent
• Transparent Physical Organization
Advantage SQL
(pronounced sequel)
• Native language of Relational databases RDBMS
Standard language to access data in RDBMS
• Functionally complete
Allows users to define, store, retrieve and manipulate data
• User friendly
Easy to use English like syntax.
SELECT NAME, SALARY FROM EMPLOYEE WHERE ID = 7092;
• Focuses on what rather than how
Other languages are procedural. They have instructions on how to open What How
files, get data, print and close files step-by-step. SQL focuses on what to
get. Acts on sets of data.
• Industry standard (ANSI 99)
It is ANSI and ISO standard language.
Database
SQL
Example:
SELECT empno, ename, job, sal
FROM emp
WHERE sal > 2500
ORDER BY job, ename
NOW()
CURRENTUSER()
THE ARITHMETIC OPERATORS
OPERATION OPERATOR
ADDITION +
SUBTRACTION -
MULTIPLICATION *
DIVISION /
EXPONENTIATION ^
PARENTHESES ()
THE ARITHMETIC
SELECT ENAME,
(SAL +NVL(COMM,0))*12
+ SAL ANNSAL
FROM EMP;
ONE TO MANY
DEPT EMP