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

FacultyofScience

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

CRICOS Provider No. 00103D

Page 1 of 1

You might also like