ICT285 Databases
Assignment 1
Individual Assignment (20% of the final mark for the unit)
Please check the LMS for the due date
Submission Instructions:
Please submit a SINGLE Word/PDF document using the link in Moodle. The due date is on
the LMS. You MUST include your student number as part of your document. Your name and
student number MUST also be included within the assignment document.
From the Unit Information Guide:
• It is your responsibility to keep a copy of any assignment handed in for assessment. Make
sure you keep a copy of the final (submitted) version as well as the backups you make as
you create the assignment. It is recommended that you also keep a hard copy of any
written assignments.
• It is especially important to maintain regular backups of all your practical work. You
should ensure you keep a separate backup on a thumb drive, cloud or similar. It is
recommended that you keep both a hard copy and an electronic copy.
• The deadline for submission will be specified in LMS. Murdoch University’s new
Assessment Policy states that any submission received after the specified due date (i.e. is
submitted late), will not be marked, and will instead, receive a grade of 0 (zero). The only
exception will be if an extension has been requested prior to the due date stated.
• Under exceptional circumstances an extension can be provided. Extensions for
assignment submissions can only be granted if requested in advance of the due date for
submission, and with a good reason. Applications for extensions should be made to the
Unit Coordinator, not to the student's lecturer/tutor who is unable to grant extensions.
• This unit uses software called Ouriginal when viewing work that you submit. TurnItIn is a
pattern-matching system designed to compare work submitted by students with other
sources from the internet, journals/periodicals, and previous submissions. Its primary
purpose is to detect any submitted work that is not original and provide a thorough
comparison between the submitted document and the original sources.
• The University takes academic integrity very seriously. Instances of academic misconduct
include Submitting work that has been produced by someone else or in part of whole
using Artificial Intelligence tools. More information about academic integrity is contained
within the Murdoch Academic Passport (MAP) unit
https://www.murdoch.edu.au/mymurdoch/support-advice/learning-study/murdoch-
academic-passport
This assignment requires you to answer several questions on relational database principles
and SQL, and to design a database based on a case study.
The assignment addresses the following learning outcomes for the unit:
[OFFICIAL]
1. Apply your knowledge of relational database principles and theory to create effective
and efficient database designs.
2. Define, create, and manage relational database systems using SQL.
You will need to ensure that your materials reflect a high professional standard*. The marks
allocated for the Assignment will be allotted in terms of the percentages shown in the
following table.
Question 1: Relational algebra 20
Question 2: SQL Select queries 20
Question 3: Further SQL 15
Question 4: Normalisation 20
Question 5: Conceptual design 25
Total 100
*Formatting and presenting your assignment appropriately are important, and the
assignment includes marks for the overall organisation and presentation of the document
(up to 5 marks). This includes marks for things such as:
• Standard Font Size and Colour i.e., Arial/12.
• Formatting and layout: double line spacing, page number, separate sections
(Headings/Subheadings), aligning paragraphs.
• Includes a title page and table of contents. Correct use of equations, footers, and
headers.
• Good technical style, avoiding excessive jargon, grammar, and spelling errors.
Before you submit your assignment, make sure to check the formatting and overall
presentation of your document. Make sure the file type is a single MS word document. If
you're not sure about what’s required contact your teaching staff or UC.
[OFFICIAL]
Question 1: Relational algebra (20 marks)
You are working with a database that stores information about suppliers, parts and projects. The
Supply relation records instances of a Supplier supplying a Part for a Project.
The schema for this database is as follows: (note that primary keys are shown underlined, foreign
keys in bold).
SUPPLIER (SNo, SupplierName, City)
PART (PNo, PartName, Weight)
PROJECT (JobNo, JobName, StartYear, Country)
SUPPLY (SNo, PNo, JobNo, Quantity)
Provide Relational Algebra (NOT SQL) queries, with description as necessary to find the following
information. Each question is worth 2 marks.
NOTE:
• You can use the symbols σ, Π, etc or the words ‘PROJECT’, ‘RESTRICT’ etc as you prefer.
• You do not need to try to make efficient queries – just correct ones.
• Where you use a join, always show the join condition.
• Provide a description to explain how the query will run.
1. List the quantity of parts supplied on JobNo 4745.
2. List the weight of the Part named “Left-handed screwdriver”.
3. List the Project name and Part name of any Parts where fewer than 500 of the part has been
supplied to a particular project.
4. List the name of any Suppliers who have supplied Parts to the Project called “New Academic
Building” or to the Project called “Removal of Asbestos”.
5. List the name of any Suppliers who have supplied Parts to the Project called “New Academic
Building” and to the Project called “Removal of Asbestos”.
6. List the names of Suppliers who have supplied the Part with the name “Fufful Valve”.
7. List the names of Projects that have had Parts supplied by “Insightly Co#” or a Supplier located in
Dubai.
8. List the details of any supplier who has supplied parts to a project that stared in 2020 and (the
project is) located in Singapore.
9. List the name of any part that was not used on a project that commenced in 2020.
10. List the name of any part that has been supplied to all projects that commenced in 2020.
[OFFICIAL]
Question 2: SQL – SELECT queries (20 marks)
Provide SQL queries and the result tables for the following (20 marks):
Please ensure that you include the result table as well as your SQL; you can copy and paste this from
either your ssh client or SQL Developer. Each query is worth 2 marks. These tables exist in Rhea and
are owned by the user “tutorials”. You may, if you wish, create your own copies of the tables under
your own account. If you do so, you should ensure that you copy the sample data from tutorials’
tables.
These queries are based on the View Ridge Gallery database you have been using in the Lab sessions.
Please see Chapters 6 and 7 of Kroenke ford background to the case and table structures.
Marks are allocated not only for correct answers, but also for best practice in the creation of the
queries. You should also include a description along with each query to explain how it will run.
1. List the details of any work of art (including the name of the artist who created the work)
that has ‘Signed’ in their description.
2. List all the nationalities with more than one artist represented in the database, and the
number of artists of that nationality.
3. List the number of works in each medium, ordered from highest to lowest number.
4. List the names of all the customers and the names of the artists each customer has an
interest in, in alphabetical order of artist last name within customer last name.
5. List the full name and email of any customers who have no address recorded.
6. List the work ID, title and artist name of all the works of art that sold for more than the
average sales price, and the price they sold for.
7. List the full name of any customers who haven’t bought any works of art.
8. Which artist (give his/her full name) has the most customers interested in him or her, and
how many customers are interested in them?
9. List the total dollar amount of sales each artist (give his/her full name) has made on their
works, in descending order of total.
10. List the name of any customers who have an interest in all the artists from the United States.
[OFFICIAL]
Question 3: Further SQL (15 marks)
1. Provide ALL of the SQL statements required to insert the details of the following: A customer,
Joseph Bloggs, of 13 Murdoch Street, Hyden, WA (Western Australia), 6359, Australia (email:
[email protected]) has sold a work of art called “Gorillas in the Mist” by the renowned
French artist, Gallic Symbol (b. 1972) to the Gallery (i.e., the Gallery purchased it from him). It is
a unique Watercolour on Paper and is 45 * 35cm signed by the Artist. The purchase price was
$4600 and the transaction took place on 27th July 2020. (7 marks)
2. You have been given the following specifications of a simple database for a netball association
that keeps record of players, teams and matches.
Player Match
Team
PK PlayerID PK MatchID
PK TeamID
FirstName Date
LastName TeamName Result
DateOfBirth Grade FK1 HomeTeamID(FK)
FK1 TeamID AwayTeamID(FK)
Give the SQL to create the Match table. You may assume that the Player and Team tables have
already been created, and that the PlayerID and TeamID colums are of the data type VARCHAR2(5).
The result of the match refers to the result for the HomeTeam and can be only W, L or D (win, lose
or draw). (5 marks)
3. Your match table must also include record the scores of both teams in the match. Provide the
SQL to amend the original table design to allow for this change in requirement. It is most
unlikely (impossible) that a team would ever score more than 999 goals in a match. (3 marks)
[OFFICIAL]
Question 4: Normalisation (20 marks)
The following question is based upon the Patient-Treatment relation which records the details of
transactions occurring in a medical surgery. You may assume the data are representative.
PATIENT ID PATIENT PATIENT CONSULT ITEM ITEM FEE PROVIDER DOCTOR
NAME DOB DATE NUMBER DESCRIPTION NUMBER NAME
437 REARDON 4/08/1989 19/7/2020 A012 Standard 56 S55768 Leahy
437 REARDON 4/08/1989 20/7/2020 A012 Standard 56 D42433 Meuller
562 BILSTEIN 12/05/2001 20/7/2020 A013 Short 35 S55768 Leahy
361 WILSON 13/08/1997 20/7/2020 A014 Long 75 S55768 Leahy
895 LEMOS 13/10/1952 20/7/2020 A013 Short 35 D42433 Meuller
895 LEMOS 13/10/1952 20/7/2020 A014 Long 75 D42433 Meuller
678 MORTAL 27/02/1969 20/7/2020 A014 Long 75 S55768 Leahy
432 SOAPIER 1/08/1976 21/7/2020 A012 Standard 56 S55768 Leahy
You have been asked to design a relational database for this system. You know that there are
problems with the current design and that it will need to be modified in order to work effectively.
You need to write a 1–2-page report that addresses the following:
1. What are the specific problems associated with the current design and why do they arise?
2. How would you change the current design and how does your new design address the
problems you have identified with the current design.
In order to receive high marks for this question, you will need to demonstrate an understanding of
the theories discussed in Topics 1, 2 and 3, how they apply to this problem, and justify the changes
you are making to the system. Simply providing the amended design (even if it is correct) will only
attract a small percentage of the marks for this question.
[OFFICIAL]
Question 5: Conceptual Design (25 marks)
Bronwyn is a university student who has been picking up meals from certain restaurants for her family
on the way home from Uni for the last two years and has now hit upon the idea of making it into of
business, which she is calling Feast4U. She intends to make available the menus of all the local
restaurants for delivery to the homes in his neighbourhood and has recruited several members of her
family and some of her closer friends to make the deliveries. If the trial run is successful, she plans to
make it into a business like DoorDash or UberEats.
Bronwyn has phoned around the higher rated ethnic restaurants in her suburb and has made a list of
20 who are willing to co-operate with her. Each restaurant has selected a subset of the items on their
menus that they think will last the journey from their kitchen to the customer. They have decided that
no high-cuisine meal can last more than 10 minutes in a heated container, so that has limited
Bronwyn’s area of service – customers can only be from the same suburb as the restaurants.
Customers will order their food via a webpage, after registering on the site. They can register from
any location but won’t be able to use the site unless the delivery address is in the same suburb as the
restaurants. They can select a restaurant and choose a number of dishes from it, referring to the
information available on the web page. They can also select dishes directly, by searching on
requirements such as ‘vegetarian’ or ‘pizza’. However, they can only order from one restaurant per
delivery.
Once they have selected their dishes, the customer enters the delivery date, time and address
required and pays the cost of the meal plus delivery via PayPal. The information about the order is
sent to the restaurant and also to Bronwyn, who assigns a driver who is currently free to pick up and
deliver the order. The driver collects the meal from the restaurant and delivers to the customer. The
driver records the actual date and time delivered, as Bronwyn needs to keep track of whether she can
live up to her promise to deliver on time.
Bronwyn has heard that you are studying Databases and has asked you to design a database to keep
track of the information requirements of her business. She wants the database to record information
about customers, restaurants, dishes, drivers, and of course orders and deliveries. At this stage she
does not want you to model any of the financial side of the business.
She wants to record various items of information about each restaurant, including its ethnicity (Malay,
Indian, Chinese, French, Italian, Australian…) and predominant style (BBQ, formal, pub grub, noodle
house, open spit, dim sum, fast food …). A brief description of each restaurant (‘About Us’) is to be
included, as well as a general description of their food. She also wants to record any special
certifications the restaurant has (e.g. vegan, locavore, organic, nut free, Jain, Halal, Kosher).
The dishes at each restaurant also need to have enough information stored about them so that the
customers know what they are selecting. As well as name and brief description, customers are likely
to want to know how in general terms how the dish was prepared (fried, steamed, raw etc), its main
ingredient (fish, cheese…), what type of course it is (soup, starter, main, dessert, side dish) and of
course its price. As customers are increasingly aware of health issues, Bronwyn also wants to record
the number of kilojoules in each dish, and also whether it is gluten free, dairy free, and/or vegetarian,
and possibly other nutritional aspects of the dish in the future.
Customers also need some indication of how long the dish will take to arrive: Bronwyn guarantees 10
minutes delivery from when the dish is picked up, but obviously some dishes take longer than others
[OFFICIAL]
to prepare. She has a rough categorisation of ‘fast’ (under 15 minutes, including delivery), ‘regular’
(15 minutes to half an hour), and ‘worth the wait’ (over half an hour) total time to door for each dish.
Although all the actual ordering will be done through the website, Bronwyn wants to print a booklet
for each restaurant, so they can have it available to their in-house customers for advertising.
Below are several queries and reports that Bronwyn has requested the database must be able to
support. There may well be many others as Bronwyn analyses her business and plans for the future;
therefore, you should design for flexibility.
The database will have to support at least the following querying and reporting requirements:
1. All the details of an order for a particular customer. The driver needs this to pick up the dishes
from the restaurant, and to confirm with the customer on delivery.
2. All the vegetarian dishes that can be delivered to the customer in less than half an hour.
3. The details of the orders for a particular restaurant on a particular date.
4. A list of all the vegan restaurants and the names, description and prices of the dishes they
offer.
5. List of all drivers, and the customers (if any) they delivered to on a particular date.
6. List of drivers who are currently free (i.e. not out on a delivery).
7. The total number of orders for each restaurant so far.
8. The booklet which lists the dishes available from a particular restaurant, with their names,
descriptions, course type, prices and delivery time.
What you have to do:
1. Create an entity-relationship diagram showing the data requirements of the system. Your ERD
should be able to be implemented in a relational DBMS. You should use the ERD notation we
have been using in the lectures and should include a legend to explain the notation. You
should include attributes in the ERD. The use of a drawing tool such as Visio will make this task
easier. However, whichever tool you use, you must copy and paste the ERD into a word-
processed document. This is because your tutor might not have access to the tools you have
used. Please note that hand-drawn ERDs are not acceptable.
2. List and explain any assumptions you have made in creating the data model.
3. Follow the best practices taught in this unit! Refer to the lecture slides and learning materials.
[OFFICIAL]
Some important things to note:
1. Part of understanding a system at sufficient enough detail to model well, involves asking
appropriate questions. If you are not sure about some detail of the case study, you should
ask on the Discussion Forum in LMS.
2. Marks will be allocated to each of the following functional areas:
a. Legend
b. Entities
c. Have you included all required entities in the design?
d. Have you included specialisation hierarchies where appropriate?
e. Relationships
i. Have you designed relationships between the entities that will support the
functional requirements?
ii. Are your relationships correctly annotated?
f. Will the overall design support the enterprise requirements?
g. Following the best practices taught in the unit e.g., correct naming formats (entities,
attributes, others), etc.
As Assignment 2 will require you to implement the Feast4U database, you will need to take into
account the feedback you receive on your conceptual design when commencing your logical and
physical designs.
[OFFICIAL]