PST Assignment 1
PST Assignment 1
PRIMARY KEY
msre than ene candidate key, in nelation
Thee an be
eut of hich one can be chaen as dhe primay key.
" t åa wrique key.
idertyfu erly one tupe at a tme.
Tt cannat be NULL
t has he dupleate values, it has Uniqe values.
SUPER KEY
a
The set of attibutes that can
tuple is krsn as Super key. A supe key k a quaup
Koy tat ldentfiens es in
of sigde or nultiple kajs
a tible
clbe
etun "'No";
3
int main ()
nt 0;
begin i
Cout
if (ie 00)
netion 0;
Vs Hashing
5.
Tndaing
4. It &a tchnique hat t ` a tehnigne tat
Hodin
alleus to qutck netnve alleus to sesch lcatin of
seCds fxem 'database desied data en disk witheut
inder sttne
2. It uses data
to hald eference It L3es mathtmatcal functrs
block.
addass of dk kneen as hash funoten to
calculate diredt locatin of vecerb.
3. It i not considered beit It i cenaideed beat fo
fr dange databasas ard it Jarge databases.
is
god fr snal! databuia.
4 Typa of indedrg ndhidas Typca of hashiny kncldes
oleed ndaings pinany statit and djpanle haabing
irdadngs sucndaxy indaig
cluteld trdaing
5. Its main puopose is t Its rain pwpse is to se
provide basis for bothma prblim tt egurize
rapid andem lockups od data into caily deanchable
ceD of odeud
etficiert acces bucets.
6. Explain this ' pointer.
preqramning, 'Bhis' is a keyuond that sefers
&
In Ctt nce of he clás.
Lnst nce
te the Cuvient lngth
paramler
It can be sed to pass cuvert object as a
methsd.
ancther nethed
inatance vawiable.
can be sed to nefer cuert cls
can be used te declare lndexers.
IH
EXAMPLE
# Incude < iosteam >
Using ntmcspace std:
class Eployee
public :
int id ;
string name;
fleat salary ;
Eplaye (it id, stig rame, flot salany)
this ’ id = id ;
thi's name hame
this
salauy salaryi
void diplay () ( < name < sdlauy < ondl;
3 3;
int main (votd ) {
"Sonu 390000 );
Emplye el Employee (104, "Nakl
=
it maà )()
stsing stn -
9ersivekeverse (sty);
Cout << st
etm 0;
9. Remoe duplicates fron a
# include < bits / stdctt.h
Using nancpace std :
chor * neneve Duplicat (chan stn (), int n)
int ndex = 0;
for (int i: 0; i<n; itt)
int i:
for (f-0; j<1; jtt)
if (stn C] =stn LË] )
byeak i
int man ()
chan str []: "Hells World ";
int n- size of (st)/ Stzeof (str CoJ);
K ere Duplicate ( Stn, n);
Cout <
sretsn O;
10. Revense wond na king ?
# inclde < stdc ttih?
Using hame space std ;
sting 91evSe stiy (striny te)
ieNRe (str. begin (), stn. erd 0);
stn . inset (stn. end 0, );
it n =stu. length 0;
=
int i 0;
fer (it i- 0; icn; ir+)
If (str [J ")
netivn O;