Professional Documents
Culture Documents
Objectives
After completing this lesson, you should be able to do the following: Use S !"#lus and iS !"#lus to access the Oracle Database $%g Describe the logical structure of tables Use S ! to &uery, manipulate, and define data Identify common database interfaces
4-2
'hat Is S !(
S ! provides statements for a variety of tas)s, including: uerying data Inserting, updating, and deleting rows in a table *reating, replacing, altering, and dropping objects *ontrolling access to the database and its objects S ! unifies all of the preceding tas)s in one consistent language+
4-3
Using S !
,here are several tools for interfacing with the database using S !: Oracle S !"#lus and iS !"#lus Oracle -orms, .eports, and Discoverer Oracle /nterprise 0anager ,hird1party tools
4-4
4-5
'hat Is S !"#lus(
*ommand1line tool Used interactively or in batch mode
$ sqlplus /nolog SQL*Plus: Release 10.1.0.2.0 - Production on Tue e! 1" 0#:1":1$ 200$ %op&rig't (c) 1*+2, 200$, -racle. .ll rig'ts reser/ed. SQL0 connect ric 1nter pass2ord: %onnected. SQL0 S1L1%T * R-3 dual4 5 6 SQL0
4-6 Copyright 2004, Oracle. All rights reserved.
'hat Is iS !"#lus(
4-7
Using iS !"#lus
4-
Describing Data
4-!0
uerying Data
,he S1L1%T has three basic parts: ,he S1L1%T !ist ,he R-3 clause ,he 781R1 condition 2optional3
4-!!
SQL0 S1L1%T last9na:e, depart:ent9id, p'one9nu:!er 2 R-3 e:plo&ees ; -R51R <= last9na:e4 L.ST9>.31 51P.RT31>T9?5 P8->19>@3<1R --------------- ------------- -------------------.!el +0 011.$$.1#$$.$2*2#" .nde +0 011.$$.1;$#.#2*2#+ .tAinson B0 #B0.12$.#2;$ .ustin #0 B*0.$2;.$B#* <aer "0 B1B.12;.++++ <aida ;0 B1B.12".$B#; <anda +0 011.$$.1;$#."2*2#+
4-!2
4oining ,ables
5etting data from more than one table
4-!3
0anipulating Data
SQL0 2 ; $ B # " ?>S1RT ?>T- e:plo&ees (13PL-=119?5, ?RST9>.31,L.ST9>.31,13.?L,P8->19>@3<1R, 8?R195.T1,C-<9?5,S.L.R=,%-33?SS?->9P%T, 3.>.D1R9?5,51P.RT31>T9?5) E.L@1S (****,F<o!F,F<uilderF,F!o!Ga!c.co:F,>@LL,s&sdate, F?T9PR-DH,>@LL,>@LL,100,*0)4
1 ro2 created. SQL0 @P5.T1 e:plo&ees S1T S.L.R=I#000 2 781R1 13PL-=119?5 I ****4 1 ro2 updated. SQL0 51L1T1 Jro: e:plo&ees 2 781R1 13PL-=119?5 I ****4 1 ro2 deleted.
4-!5 Copyright 2004, Oracle. All rights reserved.
Defining Data
4-!6
Overview of ,ransactions
,ransaction $
%-33?T4
,ransaction 6
4-!7
!oc)ing Data
Oracle Database $%g automatically loc)s data so that only one user can ma)e changes at a time+
4-!
4-20
'hat Is #!7S !(
#!7S ! is a bloc)1structured language, which e8tends S ! with: Declarations:
# 9ariables # *onstants # *ursors
*ontrol structures:
# *onditional control # Iterative control # Se&uential control
/rror handling
4-2!
4-22
Uses of #!7S !
:loc)s of #!7S ! are used in: Anonymous bloc)s -unctions #rocedures #ac)ages ,riggers Object types
4-23
'hat Is 4ava(
4ava is an industry1standard, object1oriented programming language+ It includes the following concepts: A 4ava 9irtual 0achine 24903, which provides platform independence Automated storage management techni&ues !anguage synta8 that borrows from * and enforces strong typing
4-24
4-25
'hat Is O*I(
O*I provides for: ,he Oracle *all Interface 2O*I3 is how all database features are made accessible to application developers+ O*I ma)es scalable and high1performance applications possible+ ;igher1level A#Is and tools use O*I indirectly for database access+
4-26
Other A#Is
4ava Database *onnectivity 24D:*3 #ro"*7*<< #ro"*O:O! Oracle *<< Interface 2O**I3 Open Database *onnectivity 2OD:*3 Oracle Data #rovider for +=/, 2OD#+=/,3 Oracle Objects for O!/ 2OO>O3
4-27
Summary
In this lesson, you should have learned how to: Use S !"#lus and iS !"#lus to access Oracle Database $%g Describe the logical structure of tables Use S ! to &uery, manipulate, and define data Identify common database interfaces
4-2
4-30