Professional Documents
Culture Documents
SQL-1 Introduction
SQL-1 Introduction
(SQL)
Asif Sohail
University of the Punjab
Punjab University College of Information Technology (PUCIT)
Note:
The slides are adapted from “Oracle Corporation”
SQL statement
is entered Statement is sent to
SQL> SELECT loc database
2 FROM dept;
Database
Data is displayed
LOC
-------------
NEW YORK
DALLAS
CHICAGO
BOSTON
Server
SQL*Plus
INSERT
UPDATE Data manipulation language (DML)
DELETE
CREATE
ALTER
DROP Data definition language (DDL)
RENAME
TRUNCATE
COMMIT
ROLLBACK Transaction control
SAVEPOINT
GRANT
Data control language (DCL)
REVOKE
Selection Projection
Table 1 Table 1
Join
Table 1 Table 2
SQL> SELECT *
2 FROM dept;
DEPTNO LOC
--------- -------------
10 NEW YORK
20 DALLAS
30 CHICAGO
40 BOSTON
Operator Description
+ Add
- Subtract
* Multiply
/ Divide
NAME SALARY
------------- ---------
...
ENAME 12*SAL+COMM
---------- -----------
KING
DEPTNO
---------
10
30
10
20
...
14 rows selected.
DEPTNO
---------
10
20
30
Asif Sohail
Assistant Professor
University of the Punjab
Punjab University College of Information Technology (PUCIT)
Allama Iqbal (Old) Campus, Anarkali
Lahore, Pakistan
Tel: +92-(0)42-111-923-923 Ext. 154
E-mail: asif@pucit.edu.pk