New Assi.
New Assi.
CSE2/4DBF 2024
Assignment 2 (30%)
Due date: 11:59pm Wednesday, October 9th 2024
AIMS AND OBJECTIVES:
This is an individual Assignment. You are not permitted to work as a group when writing this
assignment.
Copying, Plagiarism: Plagiarism is the submission of somebody else’s work in a manner that gives
the impression that the work is your own. The Department of Computer Science and Information
Technology treats plagiarism very seriously. When it is detected, penalties are strictly imposed.
Students are referred to the Department of Computer Science and Information Technology’s
Handbook and policy documents about plagiarism and assignment return, and also to the section of
‘Academic Integrity’ on the subject learning guide.
No extensions will be given: Penalties are applied to late assignments (5% of total assignment mark
given is deducted per day, accepted up to 5 days after the due date only). If there are circumstances
that prevent the assignment being submitted on time, an application for special consideration may be
made. See Student Handbook for details. Note that delays caused by computer downtime cannot be
accepted as a valid reason for a late submission without penalty. Students must plan their work to
allow for both scheduled and unscheduled downtime.
SUBMISSION GUIDELINES:
All queries listed under Task 1 should be saved to a file named ‘task1.txt’. The file needs to be
submitted in soft-copy format using the CSE2/4DBF submission link provided on LMS by
11:59pm, October 9th, 2024.
NOTE: No built-in ORACLE column numbering (such as ROWNUM, TOP, FETCH, etc.) or
other ORACLE ranking facilities (such as RANK) can be used in this assignment.
Download the file SFSchema.sql from the LMS site and run it on APEX. This file contains all the
CREATE and INSERT statements you will need for this assignment. Run the schema file on APEX
following the same process we followed to run a schema during the lectures and labs.
NOTE: YOU DO NOT NEED TO INSERT MORE DATA INTO THE TABLES.
CSE2/4DBF-Assignment 2-S2-2024 Page 2 of 3
Using the tables provided above, provide SQL select statements for the following queries.
a. Display the name and contact details of all employees who have 'CertIII' qualification.
[10 marks]
b. List the contact details (name, email, and phone) for all members of the branch with ID 'B005'
along with their emergency contact. [10 marks]
c. List all maintenance work that was carried out in the last one month in the organization. Sort
them based on the maintenance date-time in descending order. [10 marks]
Note: You may find using SYSDATE useful in this case, as demonstrated in the lab. In addition,
if you subtract two dates in Oracle, for example, date1-date2, you will get back the number of
days between them.
The output of this query will vary based on the time of execution.
d. List the IDs of all branches that have at least three strength training programs currently on offer
for members to sign up for. [10 marks]
e. List the branch details that have the highest number of equipment. [10 marks]
f. List all equipment in the 'Central Gym' that has their next service date within the next 3 months.
[10 marks]
g. List all members and their health conditions who have signed up for a HIIT program that is
currently ongoing. [10 marks]
h. Display the title and the lead trainer’s name for the CrossFit program(s) that has the longest
duration. [10 marks]
i. List the name, email, and phone of all employees who are either assisting or leading the
strength training program with ID 'P001'. [10 marks]
j. List all branches that have greater than the average number of members among all branches.
[10 marks]