Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Amigpment-a

1Seplain E lo nelatioral maping algoithn with


Auitable rample oL each

Jo each egulaentiby type, Cooeate a nelation R that

Ihcude ony A§mple cornponant alibutes al a


Cempstita atlubuta.
Chose ene gl the key atubute al E as the primasy

·In es Srample cOMPANY databae, ne Create olotiene


EMPLOVEE, DEPAETMENT, ANp tR0TECT
. w chee sn, Dneh f Prumber a primay teys
helatien EMPLOVEE, DEPA PT MENT PROTECT.
EM PLOVEE
Frame Menit aame n Bdat Adooes ex
bEPARTMENT

|Drame Drumben
PROJECT

Prame Prambee |Plecation


P. in
ponda
io hat 84T relatione Jdenliky
the
ERsn R
elatiendip
tpe 4:2 nay ach foa -
Skep-3'
olationskip &exBdatz rame]
|EunDept-
eptname
DEPENDENT Sx!
ELETE ON UPDATE ONboth oesed becan This
attubute key teeign
7erne
DEPENDENT,
a a
Cegreponda helatien
ompagee ay
pranay
SSn -
PEPENDENT.
ENT elatiem the creale he
atthbute key
Sneude
2eation
R aeata typ, entiby each t
type ontiby weak Mappi
seak ng Sbp-2
. hese ae thae þosnble apnoaches:

menged nelatienahip approach


Crosefence/dationahip lbton aponch.
E DEARTMEN T ee in te sole
faatapation n MANAG1ES total
. The daausback in hautng ra selatien

Sdontiky he s that patipatng


bype at N- side ype.
the
nelation T hat nepreaunts the othe ontiby type k.
x: we map ooRKS_FOR, CONTROLS sUPERVSION

Skvp-5 Mapping of Binasy M:N


MiN Rolatonahip Iype
Joe sach M:N elaionahip bype;
- Croate a hew oolatiem S
Snchude prinaiy koy
Jnclude ang stmle atlubue e M:N
helatioaip ypes.
Ex: The pofmay hy oORKSON s the cenbnati
felgn key attubute Caen , Pnof
wORKS-ON
Exn Pnotouss

Sep-6: Mappay af mulkvalued attububes :


" Goeata a neo melatien

nclue simple comporenli.


e ceal latien DEPTLOCATIONS

DEPARTMENT

Drame Drunber MgAsn Mgn stast dat J


DEPT_ LOCATIONS

|Dnumbe Dlocatien

g N- asy Relatienhp Types ?.


Step-?: Mapping
.Caeale new ela s to epnesent R.

Sncudo sinple ttibutea.


.
S Conuider aelationhip tpe sUPrLY, whoee PE o

Shame
(Quantby
SuPPLIER
SuPPLY PROJeCTgj-rome

PERTPast_no
JDBC daine.
JBDC dBine ae:

This type at die toanulats JDeC functien calls


ue' call anoter APr that s hot natine
to DBMS
"An ex: is a sDBC to DDEC idge, an applica n can ue
JDBC cals to accOs an ODBC Cemplent dat tose
" Advantage- c y instale
- pisadvantage emttted
fuctrnalty
ypeD Aoect Taonlation to Natine APL ra Non
0
Java ine:
cala dinecty nto method
Thes tanlates JD8C func
kpeifle do 2ou7ce.
Îvocatien e the APL o ene
Uually wsitten uAg aa combination af Cttt Tava
Aduantaee- bettea tan TDRL - ODBC bridge
"Sisad antae- Apr
APL o2da to be Installed

tlks gwez a netwBek lo a nlddeao


" Thes dives
anglates the TDBc reaeaa nts DBMS
Bwee that
daaea laded by the applcatien is émall,
- The TDBC
must nplenent sencarg s&L stalanents lo middlena
8e9res.

. The can we Type D lo cennecto dala tource.


îv] Type - rect Toanlatien the Natine APr va
Java Qinee
tho' JAVA becketa
Comneicabes
into the natine ÁPr ol
. T tansla les JDBC Calls
DBMS laye
olu^does not Aauire ah entermedeal
Tois
tofomance
Ary:. The dfeeent
- CoUNT: ehusn te mo at tuplez e vawes as
Speei7eed n a quey
Ex: Count the ne deettnct saloy vaes in DE
sEECT CoUNT (DISTINCT 8alay)
FROM EMPLOYEE ;
multisee al
SUM ; MAX MIN R AVG: applied to
wied nSaECT e
umeic vales. The can be
HAVING AusE
- MAX f MiN tee ae ed Rth attcbutes tat hane
nen nwmeic demalhe.

the um all emgge,


ad alo, mar?mm, monmn aveage Jalaay
saECT SM (salany), MAX (slaay), NIN (Salaay),
SELECT
AVG Salay) FOM EMPLOVEE;
&: To elaiere the hames ak all employes whole
haveng 2 e more dezondona,
SaECT Lram,frame
FROM, EMPLOVEE
WERE (saET COUNT (*)
FEOM DEPEN DENT ;

You might also like