DBMS Record PartA
DBMS Record PartA
ÉSS
workoNNonoters
De Pendent
ON
bn
Has
IDaw Expt...No.. :
woRK& DEPT DATE)
RELAPRoJECT(PNAME,
TToNSHIP)
DEPENDENT DERARTMENT(DNME, SALARX Bchema
3upER3SN,
EMpLOXEE(ENA database
Consiclex ships
oNLolATTons tof-R
ESSN,
oiththe
elaioaqramDia
ESRN, Compang
PMuBER,
PNO ( ME,
DauMBER. table
MTNTI,LNAME3SN.
DE
HouRS) DNunßER. DND) and
PENDEN_NAML
toY
Convet
r's
re
PLOCATION,
02ocATToN]
a
MLn Slenasio
givenEntiteSand
R3SN,
DNum BDATE
SEX, MSRSTART tollouoinq No.:....Page Date:
in
OUtDut
CYeated
sevte
Expt.
INSERTTNSERTTNTO
TnsERT lczeatin a.vieuoinq
2pextoxmalthe No.:
13. (12, TNSERTiL
Ioserting
CREATE
Agwwithout
e uNTQUE AR(20)Name
CREATE DATABASE
CYeatiag Studert
CREAT Tnsezting
Commit)
Bavinagnd Vie ..
'AKi Constairte
oith uoiagq 2
Abha1e,Ajith23, Tn1
TNTo VARCHARlso)
TN)o TABLE
TABLE
21,TNTO Constaints
Emojl tablessith tables(aith ox al)
meiAgeStudent(Id, Recosde
Student
AsQgmail. StudentToTNT,
3tudeatAk Database upda Tables Data
base
Databa.sae
Abh VARCHAR Student(TdTNT
4mailcom) 9
ay bag ollouoing
NoT in
to and
Td.NameAge,
meAqeEmail)VALuEs
gmai.om coo the (50)) NULL, back)(ol pY
wndoinq and Q
NAME.Age, cthout
cher'
natures Databa.se
Deleting
tale Aqe utthout
Nàme PRTMARY
Email) Emai) TNT, RecoxdS
Fnal) coastaintc) Date:
VARCHAR( Constraint] Page
No...2.:
VALUES Emai
4luEe vAlUES kÊY in
so) VARCH a
Table
Date:
Expt. No.: Page No.: ...3.
toansat boo
3totement poce SSed
Soviag
CommTT
vshree
varsha kusuma inseted
shrovya Tju r0wls)inserted
inserted Yowls)
| | 0wls) inserted
|ols) I 1
NAME CYeated
Table
inserted
owts)
Odtput
19 19 18 AnE
syagmai).
O tom com
qmoil.coan
msVoxsha
Kösumaggmai.
il.com Tiegmail.com
ExptNo..3.:
3.PRotoxm
tollouingthe
|[tu,Vaxsha'
Student(Td,Name,Age,Emal)
TNSERTInTo TNSERT
VALUE TNSERTTNTO (12,
Vieaing
SELET manushxee s.13,'Shaaya TNSERT TNSERT
l4 Aqe Restoiny
CREATE Gacking Dropping
Tuncating
Renaming Alteing
Tnserting (2atinq
Table o
kusuaa.kusuna
TNT,
the INTD TNTO
TNTO TABLE
Student
ERom 14, 19, Email a a a
ecexd StudentlTd, StucdentStudent Teceds
Student(Td, aeTable
Table Tabl
mseAonallCom NaxshaShxaa Student(Td
VARCH Table
in
the (Td,Name LTd, to
Oqmai)com the AR
Na
toble qmailcom)
gmail.om)ne, NaName (2o))'
nature
cher's
me, table
AseEmatl TNL,
Ae
AqeEmail)VALUES Age,
Emaii)vALUES Emoal) Name
)VALUES PageNo..A.: Date:
VALUE VARCHR(20).
.....e..
Date:
Alteziag a Table
Table Ateed LALTER TABLE Student
ADD CoUxSe VARCHAR(20)
TD NAME AhE EMATL CooRSE Attey Alteratioh.
11
t2
Teju
kusuma
19
18 TSegnailorm
kusumaggmail tom
3ELELT FRomn Stident
|3
shovya 19 ShsayaGgmaion
voxsha 19 VashaOfoai\com
manushee 19 meogmail. . Com:L
Renamiaq a table
Table altered LALTER TARE Student RENAME To neuw Studets
Dropping Table
Table doppod: LDROP TÁNE Studant
TIuncatag a Table
Table Tuncated TRUNCATE TASLE _Student
Aten Trunta king
No data found 3ELECT * ERom_ 3tudent
Teacher's Signature
inseted 1Youwls)inserted
T0wls) 1 inserteod
ouwl)inseteol | owls) I0wls) I
Cveated
Table Ceated
Table ceoted
Table
insey
otput
td
4Foz No.:.4
Expt.
y)vALUEs(14,
|Scalan) TNSE TNSERT TNSERTSalary) TASERT Cxatinqa CREATECeate Balaxy|CKEY.
Tosk Pname
CREATEtable REATE land
Salag)vADESC13 TNSERT3alay)
Tasrtinq (so).f-id Aa4azqate
Ceate unks
ALuEs/IS, TNTo RT VALUESCI2, VAluE yARCHARÍ3oStogtdate Emp-namm pxoxm a
qi
TNTo TND TN?o TNTO TABLE DEC TABLE VenSet
TABZE a a with
mplbyeelEmp Emplayce 5o00)'Teimds TNT table TMAL tunttions
Enplogeel s1,Rasa
EmplaelEmp-id, Employeel Task(Task-id table
the
Ag
Radha, Roych Ravi, Radha
ReseaaahBLZon000): Emp-id EmplnyeeC
VARCHAR gregate of
CEmpid, to rosectCPidproject
LIo,2 )) Emplo4ee (grouptollouoin elatino
&5ooo)' Accouat EmpidFinanle Emp-io, Enploee
CSo),
oEmp-rame,
INT, Emp-id funcboos, byschemee
Empname, TNT1o.Sk_name Simple
TNT Depaztment
nature
cher's
Empname, Table DATE,
loo000)
partneat,
nameDe
looooo) Enp
Houxs-coorked ang
PRTMARY TNTqueslinple
Queriee Ceate
Departnent ame Enddate hauing Date:
...........
Page
No.:
Depaztment
Department,. vARC
PRTMAR
De
poatment.DECTYAL/S)) VARCHAR clause) oith tables
KEX HARLS),!
Date) Y
Date:
HouRSoRkED
TotAL
100 130 200
Expt.No.: ,
Pic,Houzsuotked
touSLIDTK«lARoup
HAvTNS so BX
ERomTask
3ELELTPilClause
HANTNn
sum(Houx
coorkec!
er's
ure
As
TotalLhousoke!
Date:
Page
....
No.:
Date:
Expt. No.: ..S. Page No.: ..L........
oulpot
SExetute the dollouoinq Queries
a Hou) the resulbing álaries ! eVery emplayee
ooTkiaq on the kesearch Depazt mat ik iven
b.Eind the Sum oi the Salaxies ot al employeesC
the' AcQunts' de poxtneak as cwill ad the monimn
Saloz4 the minimum salors and the averqe
Salozy in this departmet.
Create
table Emplayee
CREATE TABLE Emplo4ee CEmpid TNI, Empame
Table CYeoted
vARAAR L2o). Depaatnent iARCHAR(20),Salary TNT)
Tnsexio g2coxds in to Table Employee
I owl) inted TNSERT 0NTo Employee(Enap-id, Emp îame, De paztonert,
Salas) VAlUES(1LAnuy 'Reseaxch,coDoD)
I ouls) inserted INSERT INTo Emplyee(Enp id, Empname, Department,
Slar)VAluES (12, An Accoutsloooo)
wls) insrteo! TNsERT TNîo Employeel(Empjd Empaame, Depatment,
Salco)vAlUESLIS,'Ancop 'Résearch,&ooDo)
NSERT TNTD Emplogce(Emp_id,Empname, Depastonent,
Solona YALDES(4¤nY Accountc sooon)
1 0wls) inseted TNCERT TN)o EmplayeelEnpid,Empomt, Departnent,
Salay)vAlUES(IS AnixudhAceut 9ooaa
DEARTAENT SALARY
Anuj Research 50000 Niing SeCOrds in Emplayee table
12 Anu A
ccounts SELECT i FRoM Emplayce'
Resecoch
13
Anonp
Anvi Accounts SO00o
Aaivdh Accounts
Teacher's Signature
Date:
shavona Teamteos
Bhasko Lmorag
DEPLNm lDEPTNAmE PROSECLNAnE Nieutag Records in Depatmat table
Project A SELECTFROMn Departnat
Projc t B 2
TT 13
irence prajet
S Reseaoch Projet£ aRetrive thename od the lach employee tontaollud by Departma
umbey cluse ETTS Operator
SELECI Emp name
Eap-neme FRoM Employee
Bhanu LottER E EXIS TSCSELECT Deptum
Sharana FRoM Employee
shaskay LoHERE Dept auma
Teacher's Signature
Date:
Expt. No.:
Page No.: ..4...
lRetrie ye the name od eoch dept and nuabx od empoy
es nkng in each
Depaxtment hich haso4 least
DEPT Num NUmEmplo XEEs
9ELECT Dept-aum,LaunT(A) AS num Lmployeel
EROM Emplayee
HAVTNa CoUNT( =2
Teacher's Signature
Ernp-name
Empid
|2
2oco
sheta Chandini
chandhana rocwcs)
chanda Chandsa
Output
CatedTa
ble
Inserted
Insert Tnserte
Project-oum
o9-jan9to
ol-jul9Y
b-l999 BithDate Inested
5 2
ExptNo.. : ..
b.RetiVe 4Eeute
Laum)VALUES(42'
VALUES(|Lehandin'ol-ju
Viawina
SELECT
andashekai(oaa-2000,
numVAuESCIL
num)VAlUES(1, ThisERTTNSERTTasext |CREATE
2-quq-l9932
cLnäm)
handhaa.
199y)
T'NSERTTNSERT ARo)Employee
execte
Table thatname, fox
each
Bixth pDject and
TeLoTd îN)o TNTO TNTO TN+oecOYds TABLE theARme the the
Rom F pnjectTetie
Emple Employee Date Cuse kollousn
Fployee Eonployee(Empd,
Émnployee Employeel AumbY
Chaneloa'o-eb-
od to
EmploeelFmp_id
DATE ot
Employee
Fmplo4ee
(Emp-ld,Empnane,
(Emp-id.Empname, (Emp.id, emploaRouP q
Emp_îc,PaDjetnum D4
Quexie
By) the
employee
ya
ature
her's Enp table
table Empnome, peat
Emp-name,
199 nama,tìth TNT TNT,
who
ohonumb
Bith
BthDate, ben
4) Birth Emp-name eDIk .15..
PageNo.: Date:
4
sowls) jnseted
Owts) |
projetEprojproject
eet DcPaject Vowls)
Proet-
name Projnum,et
CNateo
Table
A insertedinseyted inseyteol
Employee
num
Project
name
DPrejctB A
pojectprojetprojeet
prnject
Expt.No.:
alfor etxeeate
paojet
taable
eaRoup5ELECT anc ProctEJ)
NALUEShs, s,NALOES
TNGERT
project
TNTo TNSERT
IBsl3,3,'Poject TSERT
NAJD NALDES
TNSERTCTnsexing
Project-nme
VARHAR(2))
Prnject(ue
Pzoject
FRom yieueing
3ELECT
Ppct
EROm VALVES(Lproct Å) CREATE
Tnsert
the each Cy
BY numbey
TNTO
{2,2,"paojet
TNTO R)
name.lOUNT(Emp
prnject,trive a 4, TNTO TTO TABLE
Projet ProjectlEmp_idProject
reord Poect
aRouPBY ProjectEnpiel
project(Emp coxde Project
pjectlEmpid,Praje
D
Dem,project employee
inlEnpid. ) in
the table (Enpid,
to
project id.projt poiet
ature
her's
pajctname)
paojectnum, projectaum,
pojeLt
nome ho panect_
numbex nuen,
u0rk num,
poajeot_nne) t
proectname) poojct num, TNT.
num
.Jh.
PageNo.: Date:
er
the
Dn
Fmpoyee
idDAsAum
project Pojt
that
name)
name nam)
Enf-one
chandini
chandhana
chantra
Expt.
No.:
bRative
Emp_ame
OHE SELET
Emloyee
ERom
RE
Birth the
nome
Date
od
Bettieen employces
199D
her's
ture toho
AND
1999 bazO PageNo..14: Date:
in
the
Date ......o.*..**
Teacher's Signature
Cnseskol
Tou) insod
tate)
Towls)
(cTeated)
insrtd
Touw) insoed
reatec)
vOuls)
Cveateo)
insevted
Towl) caeato
Table CTeated
Table
Expt.No.:
9foy
_TNDINSERT
n?.
NSERT Tnsatina (2.'TNSERI TASERT1minho'
nuERT TNSERT TNERT)'TNSERT idINT)
Insrhna CREATE CHeating
EmpCxeahaq CREATE
TABLE eoork
2.changSbeugmìa
1in2) CL,'[2, Bangchan
numbey
he
each
TN*O INTO ,etiele
INTD aîo TNÍO panjec
TN*O TABLECphojetlenum
2ecods
Pagect Emeloyee TO table a od
EmpkeelEmpid.Empname EMpiaelEmp-id,
EmployrelEmpid,£mp-name, ecerds
Emplayee a t
fmployee table eaployees the on
(Pnum, trCEmpid.Em_ to projectnumbeuohth
Employee
(EmErp Prajett Employce
ak,p_Aum)utLES
ran. Pajcct oho more
Pnae
er's ork thun
Es fmp
name, P Table onano tusa
praject
nome
ure Empi ÎNI
name,P_nunm)AluEs fame thct
employee&
aum) am) P
Paum)VALuES Pname .2.0....
PageNo.:
vtluE<
vtluEsC!, f majeek
vtl0E num)
jct VA
VAlUEs RctAR20)
'pc
Date:
Empi Emp_ame
Records in Table Emploqe
FROM Employee
Bangehan
Han L
2 minho 12
2
2
Saunqmin 2
Changbin 2
Teacher's Signature
Expt. No.: Page No.: ..22.....
Teacher's Signature
|3 |2 Em
id 1
CYeatedVie |
SOwls) ceated
Table
insrto
ols)
inserted
Tawls)
Racha Raja RaVi Emame Cuptut
Rarga Rama
inserteo
inksteof
inserteo
Expt.
..{.
No.:
Io.
CREATE
SELECT Mwing TNSERTTNSEPT
Emplaee
3ELECT
FRom TNSEPT TNsexbeg Leating
HNERT
TNCERT Cseatiaa fos
CREATE eletbiag
vieusc,
mployee
oE CREATE
fRomSELET wHEREERoM
E Empid=s Cseabiaa
a
RE, qiven
Emplayee Snlo 1NÍo TNto TTOTN Vieussloith
meid EmpioV(Êw
Fmpnome, EmpnameVIEW erd To Empayee
TABLEtable a
a Enpbgee(Emp-id Emplogce secord
FnploeeEmploqee et
Viewluith Fmployre(Emp od
|s stait
Emp Emp_ Fnm Emploel avieusom
lEmpid lEmptd to relabioo
Emp.stot4 lEmp aad
lmplocee cmploqee
jd and ie othouttableJ
Emp Enp
Empam) Fmp Emid
AS
er's
ure uotthaatA table,Empnam)loEs
namgrame) ram)
Table checle
Pexdon(9
VAlUES((9,
VALUESdha) VAlUEC12, INT,Emp opben).
Check AlUs(3' the Page
.3.No.: Date:
ophon ttlouoiag
Droppinsy
ame)
jaRangen
'e; ,
Date:
Page No.:
Expt. No.:
the View
vieo doroppeo Drapping
Orop vÍEw Emp taf
Teacher's Signature