SlideShare una empresa de Scribd logo
1 de 19
--BY SAURAV VERMA
-B.TECH CS 2ND
YEAR
(SGVU,JAIPUR)
COMMUNITY WORLD
Personal DBMS Vs Client/Server DBMS
Oracle 8 Environment
SQL – syntax and examples
PL/SQL-introduction
Server
Gets file requests from clients
Sends files to client
Receives files back from clients
NETWORK
Client A
Sends file requests to server
Receives files from server
Updates data
Sends files back to server
Client B
Sends file requests to server
Receives files from server
Updates data
Sends files back to server
Personal
DBMS
Demand on the client and the network
Does not perform table locking
automatically
Not fault tolerant in the case of client failure
Do not have file based transaction logging
Server
Gets data requests from clients
Adds, Deletes and updates data
Sends results to clients
NETWORK
Client A
Sends data requests to server
Receives results from server
Sends new data or changes to server
Client B
Sends data requests to server
Receives results from server
Sends new data or changes to server
Client/server
DBMS
Minimal load on the client and the network
Performs table locking automatically
Fault tolerant in the case of client failure
File based transaction logging
SQL * Plus
PL/SQL
Query Builder
Developer
Enterprise Manager
Web application server
Sqlplus username/password
ALTER USER user-name IDENTIFIED BY newpassword
START filename | @ filename
CLEAR SCREEN
HELP <command>
SAVE filename[.ext] REPLACE|APPEND
EXIT
Both an ANSI and ISO standard
Types of commands:
1. Data Definition Language (DDL) : Create, Alter, Drop,
Rename,Truncate
2. Data Manipulation Language (DML): Insert, Delete,
Update
3. Data Retrieval: Select
4. Transaction Control: Commit, Rollback, Savepoint
5. Data Control Language (DCL): Grant, Revoke
PositionPosition
IDID
PositionPosition
DescriptionDescription
11 PresidentPresident
22 ManagerManager
33 ProgrammerProgrammer
44 AccountantAccountant
55 SalesmanSalesman
QualificationQualification
IDID
QualificationQualification
DescriptionDescription
11 DoctorateDoctorate
22 MastersMasters
33 BachelorsBachelors
44 AssociatesAssociates
DeptDept
IDID
DeptDept
NameName
LocationLocation
1010 FinanceFinance CharlotteCharlotte
2020 InfosysInfosys New YorkNew York
3030 MarketingMarketing WoodbridgeWoodbridge
4040 AccountantAccountant CaliforniaCalifornia
DEPARTMENT
POSITION
QUALIFICATION
EmpEmp
IDID
LastLast
NameName
FirstFirst
NameName
PositionPosition
IDID
SuperSuper
IDID
HireHire
DateDate
SalarySalary CommComm DeptDept
IDID
QualQual
IDID
111111 SmithSmith JohnJohn 11 04/15/6004/15/60 265000265000 35003500 1010 11
246246 HoustonHouston LarryLarry 22 111111 05/19/6705/19/67 150000150000 10001000 4040 22
123123 RobertsRoberts SandiSandi 22 111111 12/02/9112/02/91 7500075000 1010 22
433433 McCallMcCall AlexAlex 33 543543 05/10/9705/10/97 6650066500 2020 44
543543 DevDev DereckDereck 22 111111 03/15/9503/15/95 8000080000 20002000 2020 11
200200 ShawShaw JinkuJinku 55 135135 01/03/0001/03/00 2450024500 30003000 3030
222222 ChenChen SunnySunny 44 123123 08/15/9908/15/99 3500035000 1010 33
135135 GarnerGarner StanleyStanley 22 111111 02/29/9602/29/96 4500045000 50005000 3030 55
EMPLOYEE
Data Definition Language:
CREATE TABLE {table}
( {column datatype [DEFAULT expr]
[column_constraint] ... | table_constraint}
[, { column datatype [DEFAULT expr]
[column_constraint] ...
)
ALTER TABLE {table}
[ADD|MODIFY {column datatype [DEFAULT expr] [column_constraint]}
[DROP drop_clause]
DROP TABLE {table} [cascade constraints]
DESC {table}
CREATE TABLE Emp
(
empid Decimal(10) NOT NULL,
positionid Number(2),
supervisorid Number(3),
deptid Number(2),
qualid Number(1),
lname varchar2(10),
fname varchar2(10),
salary Decimal(10,2),
hiredate Date,
commission Decimal(4,2),
PRIMARY KEY (empid),
FOREIGN KEY (positionid) REFERENCES Position(positionid),
FOREIGN KEY (deptid) REFERENCES Dept(deptid),
FOREIGN KEY (qualid) REFERENCES Qualification(qualid)
);
ALTER TABLE EMP MODIFY Commission decimal(7,2);
Data Manipulation Language:
INSERT INTO {table | view} [ (column [, column] ...) ]
VALUES (expr,expr ...)
UPDATE {table | view }
SET { (column [, column] = { expr | }
[WHERE condition]
DELETE [FROM] {table | view} [WHERE condition]
INSERT INTO Dept( deptid,deptname,location)
VALUES(50,'IT','Dallas');
INSERT INTO Emp(empid,
lname,fname,positionid,
supervisorid,hiredate,
salary,deptid,qualid)
VALUES(227,'howser','Barbara',4,111,'25-AUG-83',45000,10,3);
UPDATE dept SET deptname='Sales' WHERE deptID=50;
DELETE FROM dept
WHERE deptid='50';
Data Retrieval:
SELECT [DISTINCT | ALL] {table|view}
FROM {table | view}
[WHERE condition ]
[GROUP BY expr [, expr]]
[ORDER BY {expr} [ASC | DESC]]
select * from dept;
select deptname from dept where deptid='10';
select lname,fname from emp order by lname desc;
select max(salary) from emp group by positionid;
select deptname from dept,emp where
dept.deptid=emp.deptid and emp.empid='111';
Transaction Control:
COMMIT
ROLLBACK [ to {savepoint}]
SAVEPOINT {name}
commit;
savepoint point1;
rollback to point1;
Data Control Language:
GRANT [privileges]
ON object TO user|public
[WITH GRANT OPTION]
REVOKE [privileges]
ON object TO user|public
[CASCADE CONSTRAINTS]
grant select,update on emp to XYZ ;
revoke update on emp to XYZ;
A PL/SQL Example:
CREATE OR REPLACE PROCEDURE raise_salary (empno INTEGER,
increase REAL) IS
current_salary REAL;
salary_missing EXCEPTION;
BEGIN
SELECT salary INTO current_salary FROM emp WHERE emp.empid =
empno;
IF current_salary IS NULL THEN
RAISE salary_missing;
ELSE
UPDATE emp SET salary = salary + increase WHERE
emp.empid = empno;
END IF;
EXCEPTION
WHEN salary_missing THEN
UPDATE emp SET salary=0 where emp.empid=empno;
END raise_salary;

Más contenido relacionado

La actualidad más candente

DBMS information in detail || Dbms (lab) ppt
DBMS information in detail || Dbms (lab) pptDBMS information in detail || Dbms (lab) ppt
DBMS information in detail || Dbms (lab) pptgourav kottawar
 
ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...
ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...
ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...Altinity Ltd
 
Efficient Pagination Using MySQL
Efficient Pagination Using MySQLEfficient Pagination Using MySQL
Efficient Pagination Using MySQLEvan Weaver
 
Joining tables
Joining tablesJoining tables
Joining tablespunu_82
 
Sqlxml vs xquery
Sqlxml vs xquerySqlxml vs xquery
Sqlxml vs xqueryAmol Pujari
 
PostgreSQL 9.6 새 기능 소개
PostgreSQL 9.6 새 기능 소개PostgreSQL 9.6 새 기능 소개
PostgreSQL 9.6 새 기능 소개PgDay.Seoul
 
SQL || overview and detailed information about Sql
SQL || overview and detailed information about SqlSQL || overview and detailed information about Sql
SQL || overview and detailed information about Sqlgourav kottawar
 
The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84Mahmoud Samir Fayed
 
Database administration commands
Database administration commands Database administration commands
Database administration commands Varsha Ajith
 
Tech Talk: Best Practices for Data Modeling
Tech Talk: Best Practices for Data ModelingTech Talk: Best Practices for Data Modeling
Tech Talk: Best Practices for Data ModelingScyllaDB
 

La actualidad más candente (20)

DBMS information in detail || Dbms (lab) ppt
DBMS information in detail || Dbms (lab) pptDBMS information in detail || Dbms (lab) ppt
DBMS information in detail || Dbms (lab) ppt
 
Python database access
Python database accessPython database access
Python database access
 
My sql1
My sql1My sql1
My sql1
 
ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...
ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...
ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...
 
Sql queries
Sql queriesSql queries
Sql queries
 
Efficient Pagination Using MySQL
Efficient Pagination Using MySQLEfficient Pagination Using MySQL
Efficient Pagination Using MySQL
 
Joining tables
Joining tablesJoining tables
Joining tables
 
Sqlxml vs xquery
Sqlxml vs xquerySqlxml vs xquery
Sqlxml vs xquery
 
PostgreSQL 9.6 새 기능 소개
PostgreSQL 9.6 새 기능 소개PostgreSQL 9.6 새 기능 소개
PostgreSQL 9.6 새 기능 소개
 
Materi my sql part 1
Materi my sql part 1Materi my sql part 1
Materi my sql part 1
 
DB2 Native XML
DB2 Native XMLDB2 Native XML
DB2 Native XML
 
SQL || overview and detailed information about Sql
SQL || overview and detailed information about SqlSQL || overview and detailed information about Sql
SQL || overview and detailed information about Sql
 
The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84
 
Dbms lab Manual
Dbms lab ManualDbms lab Manual
Dbms lab Manual
 
Database administration commands
Database administration commands Database administration commands
Database administration commands
 
Quick reference for spark sql
Quick reference for spark sqlQuick reference for spark sql
Quick reference for spark sql
 
Oracle ORA Errors
Oracle ORA ErrorsOracle ORA Errors
Oracle ORA Errors
 
mysqlHiep.ppt
mysqlHiep.pptmysqlHiep.ppt
mysqlHiep.ppt
 
Tugas praktikum smbd
Tugas praktikum smbdTugas praktikum smbd
Tugas praktikum smbd
 
Tech Talk: Best Practices for Data Modeling
Tech Talk: Best Practices for Data ModelingTech Talk: Best Practices for Data Modeling
Tech Talk: Best Practices for Data Modeling
 

Destacado

Direct memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA ControllerDirect memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA ControllerMuhammed Afsal Villan
 
8237 / 8257 DMA
8237 / 8257 DMA8237 / 8257 DMA
8237 / 8257 DMAAJAL A J
 
Profil singkat pt hasindo nusa teknika
Profil singkat pt hasindo nusa teknikaProfil singkat pt hasindo nusa teknika
Profil singkat pt hasindo nusa teknikaBima Azis
 
Supply chain management new
Supply chain management newSupply chain management new
Supply chain management new113080IMRAN
 
Business studies review
Business studies reviewBusiness studies review
Business studies reviewSusan Hua
 
παρουσίαση 8 2
παρουσίαση 8 2παρουσίαση 8 2
παρουσίαση 8 2jennydav
 
What you need to know about
What you need to know aboutWhat you need to know about
What you need to know aboutMakarete10
 
Travel Insurance Direct Ireland Policy Documents
Travel Insurance Direct Ireland Policy DocumentsTravel Insurance Direct Ireland Policy Documents
Travel Insurance Direct Ireland Policy DocumentsJean Andrews
 
Mc ilhenny company interview questions and answers
Mc ilhenny company interview questions and answersMc ilhenny company interview questions and answers
Mc ilhenny company interview questions and answersKateWinslet88
 
Tjb advertising ltd marketing
Tjb advertising ltd marketingTjb advertising ltd marketing
Tjb advertising ltd marketingTJB Advertising
 
Inplant training for_mechatronics_1
Inplant training for_mechatronics_1Inplant training for_mechatronics_1
Inplant training for_mechatronics_1anushaanu3092
 
Brazilian prezi vicky+ella+may
Brazilian prezi vicky+ella+mayBrazilian prezi vicky+ella+may
Brazilian prezi vicky+ella+maylozme
 
Picture framing tools and equipment
Picture framing tools and equipmentPicture framing tools and equipment
Picture framing tools and equipmentDiyframed
 
Design in Mind
Design in MindDesign in Mind
Design in Mindobehave
 
Sandblaster Experiment
Sandblaster ExperimentSandblaster Experiment
Sandblaster ExperimentVictoria Tran
 

Destacado (19)

Worst
WorstWorst
Worst
 
Spatial Database Systems
Spatial Database SystemsSpatial Database Systems
Spatial Database Systems
 
Direct memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA ControllerDirect memory access (dma) with 8257 DMA Controller
Direct memory access (dma) with 8257 DMA Controller
 
8237 / 8257 DMA
8237 / 8257 DMA8237 / 8257 DMA
8237 / 8257 DMA
 
Profil singkat pt hasindo nusa teknika
Profil singkat pt hasindo nusa teknikaProfil singkat pt hasindo nusa teknika
Profil singkat pt hasindo nusa teknika
 
Supply chain management new
Supply chain management newSupply chain management new
Supply chain management new
 
Business studies review
Business studies reviewBusiness studies review
Business studies review
 
παρουσίαση 8 2
παρουσίαση 8 2παρουσίαση 8 2
παρουσίαση 8 2
 
El Rol del Gerente
El Rol del GerenteEl Rol del Gerente
El Rol del Gerente
 
E1
E1E1
E1
 
What you need to know about
What you need to know aboutWhat you need to know about
What you need to know about
 
Travel Insurance Direct Ireland Policy Documents
Travel Insurance Direct Ireland Policy DocumentsTravel Insurance Direct Ireland Policy Documents
Travel Insurance Direct Ireland Policy Documents
 
Mc ilhenny company interview questions and answers
Mc ilhenny company interview questions and answersMc ilhenny company interview questions and answers
Mc ilhenny company interview questions and answers
 
Tjb advertising ltd marketing
Tjb advertising ltd marketingTjb advertising ltd marketing
Tjb advertising ltd marketing
 
Inplant training for_mechatronics_1
Inplant training for_mechatronics_1Inplant training for_mechatronics_1
Inplant training for_mechatronics_1
 
Brazilian prezi vicky+ella+may
Brazilian prezi vicky+ella+mayBrazilian prezi vicky+ella+may
Brazilian prezi vicky+ella+may
 
Picture framing tools and equipment
Picture framing tools and equipmentPicture framing tools and equipment
Picture framing tools and equipment
 
Design in Mind
Design in MindDesign in Mind
Design in Mind
 
Sandblaster Experiment
Sandblaster ExperimentSandblaster Experiment
Sandblaster Experiment
 

Similar a Oracle PL-SQL

6_SQL.pdf
6_SQL.pdf6_SQL.pdf
6_SQL.pdfLPhct2
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsOracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsAlex Zaballa
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c  - New Features for Developers and DBAsOracle Database 12c  - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsAlex Zaballa
 
DDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using OracleDDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using OracleFarhan Aslam
 
Adbms 21 sql 99 schema definition constraints and queries
Adbms 21 sql 99 schema definition constraints and queriesAdbms 21 sql 99 schema definition constraints and queries
Adbms 21 sql 99 schema definition constraints and queriesVaibhav Khanna
 
Oracle Database 12c New Features for Developers and DBAs - OTN TOUR LA 2015
Oracle Database 12c  New Features for Developers and DBAs - OTN TOUR LA 2015Oracle Database 12c  New Features for Developers and DBAs - OTN TOUR LA 2015
Oracle Database 12c New Features for Developers and DBAs - OTN TOUR LA 2015Alex Zaballa
 
Sql intro
Sql introSql intro
Sql introglubox
 
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...Jürgen Ambrosi
 
MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 CourseMarcus Davage
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...Alex Zaballa
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...Alex Zaballa
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
SQL Server Select Topics
SQL Server Select TopicsSQL Server Select Topics
SQL Server Select TopicsJay Coskey
 

Similar a Oracle PL-SQL (20)

6_SQL.pdf
6_SQL.pdf6_SQL.pdf
6_SQL.pdf
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsOracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c  - New Features for Developers and DBAsOracle Database 12c  - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
DDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using OracleDDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using Oracle
 
Mysql rab2-student
Mysql rab2-studentMysql rab2-student
Mysql rab2-student
 
Mysql rab2-student
Mysql rab2-studentMysql rab2-student
Mysql rab2-student
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
Adbms 21 sql 99 schema definition constraints and queries
Adbms 21 sql 99 schema definition constraints and queriesAdbms 21 sql 99 schema definition constraints and queries
Adbms 21 sql 99 schema definition constraints and queries
 
Oracle Database 12c New Features for Developers and DBAs - OTN TOUR LA 2015
Oracle Database 12c  New Features for Developers and DBAs - OTN TOUR LA 2015Oracle Database 12c  New Features for Developers and DBAs - OTN TOUR LA 2015
Oracle Database 12c New Features for Developers and DBAs - OTN TOUR LA 2015
 
Lab
LabLab
Lab
 
Sql intro
Sql introSql intro
Sql intro
 
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
 
Sql 2006
Sql 2006Sql 2006
Sql 2006
 
MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 Course
 
Sql
SqlSql
Sql
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
Sql (DBMS)
Sql (DBMS)Sql (DBMS)
Sql (DBMS)
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
 
SQL Server Select Topics
SQL Server Select TopicsSQL Server Select Topics
SQL Server Select Topics
 

Último

Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 

Último (20)

Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 

Oracle PL-SQL

  • 1. --BY SAURAV VERMA -B.TECH CS 2ND YEAR (SGVU,JAIPUR) COMMUNITY WORLD
  • 2. Personal DBMS Vs Client/Server DBMS Oracle 8 Environment SQL – syntax and examples PL/SQL-introduction
  • 3. Server Gets file requests from clients Sends files to client Receives files back from clients NETWORK Client A Sends file requests to server Receives files from server Updates data Sends files back to server Client B Sends file requests to server Receives files from server Updates data Sends files back to server Personal DBMS
  • 4. Demand on the client and the network Does not perform table locking automatically Not fault tolerant in the case of client failure Do not have file based transaction logging
  • 5. Server Gets data requests from clients Adds, Deletes and updates data Sends results to clients NETWORK Client A Sends data requests to server Receives results from server Sends new data or changes to server Client B Sends data requests to server Receives results from server Sends new data or changes to server Client/server DBMS
  • 6. Minimal load on the client and the network Performs table locking automatically Fault tolerant in the case of client failure File based transaction logging
  • 7. SQL * Plus PL/SQL Query Builder Developer Enterprise Manager Web application server
  • 8. Sqlplus username/password ALTER USER user-name IDENTIFIED BY newpassword START filename | @ filename CLEAR SCREEN HELP <command> SAVE filename[.ext] REPLACE|APPEND EXIT
  • 9. Both an ANSI and ISO standard Types of commands: 1. Data Definition Language (DDL) : Create, Alter, Drop, Rename,Truncate 2. Data Manipulation Language (DML): Insert, Delete, Update 3. Data Retrieval: Select 4. Transaction Control: Commit, Rollback, Savepoint 5. Data Control Language (DCL): Grant, Revoke
  • 10. PositionPosition IDID PositionPosition DescriptionDescription 11 PresidentPresident 22 ManagerManager 33 ProgrammerProgrammer 44 AccountantAccountant 55 SalesmanSalesman QualificationQualification IDID QualificationQualification DescriptionDescription 11 DoctorateDoctorate 22 MastersMasters 33 BachelorsBachelors 44 AssociatesAssociates DeptDept IDID DeptDept NameName LocationLocation 1010 FinanceFinance CharlotteCharlotte 2020 InfosysInfosys New YorkNew York 3030 MarketingMarketing WoodbridgeWoodbridge 4040 AccountantAccountant CaliforniaCalifornia DEPARTMENT POSITION QUALIFICATION
  • 11. EmpEmp IDID LastLast NameName FirstFirst NameName PositionPosition IDID SuperSuper IDID HireHire DateDate SalarySalary CommComm DeptDept IDID QualQual IDID 111111 SmithSmith JohnJohn 11 04/15/6004/15/60 265000265000 35003500 1010 11 246246 HoustonHouston LarryLarry 22 111111 05/19/6705/19/67 150000150000 10001000 4040 22 123123 RobertsRoberts SandiSandi 22 111111 12/02/9112/02/91 7500075000 1010 22 433433 McCallMcCall AlexAlex 33 543543 05/10/9705/10/97 6650066500 2020 44 543543 DevDev DereckDereck 22 111111 03/15/9503/15/95 8000080000 20002000 2020 11 200200 ShawShaw JinkuJinku 55 135135 01/03/0001/03/00 2450024500 30003000 3030 222222 ChenChen SunnySunny 44 123123 08/15/9908/15/99 3500035000 1010 33 135135 GarnerGarner StanleyStanley 22 111111 02/29/9602/29/96 4500045000 50005000 3030 55 EMPLOYEE
  • 12. Data Definition Language: CREATE TABLE {table} ( {column datatype [DEFAULT expr] [column_constraint] ... | table_constraint} [, { column datatype [DEFAULT expr] [column_constraint] ... ) ALTER TABLE {table} [ADD|MODIFY {column datatype [DEFAULT expr] [column_constraint]} [DROP drop_clause] DROP TABLE {table} [cascade constraints] DESC {table}
  • 13. CREATE TABLE Emp ( empid Decimal(10) NOT NULL, positionid Number(2), supervisorid Number(3), deptid Number(2), qualid Number(1), lname varchar2(10), fname varchar2(10), salary Decimal(10,2), hiredate Date, commission Decimal(4,2), PRIMARY KEY (empid), FOREIGN KEY (positionid) REFERENCES Position(positionid), FOREIGN KEY (deptid) REFERENCES Dept(deptid), FOREIGN KEY (qualid) REFERENCES Qualification(qualid) ); ALTER TABLE EMP MODIFY Commission decimal(7,2);
  • 14. Data Manipulation Language: INSERT INTO {table | view} [ (column [, column] ...) ] VALUES (expr,expr ...) UPDATE {table | view } SET { (column [, column] = { expr | } [WHERE condition] DELETE [FROM] {table | view} [WHERE condition]
  • 15. INSERT INTO Dept( deptid,deptname,location) VALUES(50,'IT','Dallas'); INSERT INTO Emp(empid, lname,fname,positionid, supervisorid,hiredate, salary,deptid,qualid) VALUES(227,'howser','Barbara',4,111,'25-AUG-83',45000,10,3); UPDATE dept SET deptname='Sales' WHERE deptID=50; DELETE FROM dept WHERE deptid='50';
  • 16. Data Retrieval: SELECT [DISTINCT | ALL] {table|view} FROM {table | view} [WHERE condition ] [GROUP BY expr [, expr]] [ORDER BY {expr} [ASC | DESC]] select * from dept; select deptname from dept where deptid='10'; select lname,fname from emp order by lname desc; select max(salary) from emp group by positionid; select deptname from dept,emp where dept.deptid=emp.deptid and emp.empid='111';
  • 17. Transaction Control: COMMIT ROLLBACK [ to {savepoint}] SAVEPOINT {name} commit; savepoint point1; rollback to point1;
  • 18. Data Control Language: GRANT [privileges] ON object TO user|public [WITH GRANT OPTION] REVOKE [privileges] ON object TO user|public [CASCADE CONSTRAINTS] grant select,update on emp to XYZ ; revoke update on emp to XYZ;
  • 19. A PL/SQL Example: CREATE OR REPLACE PROCEDURE raise_salary (empno INTEGER, increase REAL) IS current_salary REAL; salary_missing EXCEPTION; BEGIN SELECT salary INTO current_salary FROM emp WHERE emp.empid = empno; IF current_salary IS NULL THEN RAISE salary_missing; ELSE UPDATE emp SET salary = salary + increase WHERE emp.empid = empno; END IF; EXCEPTION WHEN salary_missing THEN UPDATE emp SET salary=0 where emp.empid=empno; END raise_salary;