Professional Documents
Culture Documents
ITECH1006 5006 Laboratory12 PDF
ITECH1006 5006 Laboratory12 PDF
ITECH1006/5006
DatabaseManagementSystems
Laboratory 12
Objectives:
Torevisedatabases
Activities
1) ThefollowingistherelationalschemaofpartofthedatabasethatAcmePtyLtdrecently
implemented:
DEPARTMENT(DeptNo,Name,Location)
EMPLOYEE(EmpNo,Name,Street,City,Postcode,HireDate,Salary,DeptNo)
LEAVE(EmpNo,FromDate,ToDate)
EMPQUAL(EmpNo,QualID)
QUALIFICATION(QualID,Qualification,Institution)
Usingtheaboveschema,writeSQLqueriesthatwillanswer/processthefollowing:
a) Listallcitieswhereanemployeelives.Onlyshowthecityonce.
b) WhatisthelowestsalarypaidforanyemployeethatlivesinthecityofMelbourne?
c) Foreachqualification,showthetotalnumberofemployeesthathavethatqualification.
Showqualificationid,qualificationandthetotalnumber.
d) Listanyemployeeswhoareonannualleaveon01/05/2004.Note,dateformatis#0105
2004#.Showemployeenumberonly.
e) WhatisthetotalsalarycostincurredbyAcmeforemployeesintheMarketing
department?
f) Listtheemployee(s)withthehighestsalary.Showemployeenumberandname.
g) Listtheemployeenamesandalloftheinstitutionsthattheyhavestudiedat.
h) Howmanyemployeeshavenoqualifications?
i) Deleteallleaverowsiftheleaveendedpriortothestartofthisyear.
j) Increasethesalaryofallemployeesby$80
Page 1 of 1