Lab 1 - Getting Started With UML, Your Virtual Machine and SQL
Lab 1 - Getting Started With UML, Your Virtual Machine and SQL
Scope
This laboratory includes the tasks related to the applications and software systems that will be
used in DPIT115 Data Management and Security in Spring session 2020.
The outcomes of the laboratory are due by Sunday 1 November 2020, 11.55 PM
This laboratory work consists of 4 tasks, and the specification of each task starts from a new
page.
All files left on Moodle in a state "Draft(not submitted)" will not be evaluated.
An implementation that does not compile or run due to one or more syntactical errors scores
no marks.
It is expected that you will solve all tasks individually without any cooperation with the
other students. If it is suspected that you have received assistance from another person to
complete the tasks, the matter will be investigated as an alleged breach of the UOW College
Academic Integrity and Student Conduct Policy, in accordance with the Procedure for
Managing Alleged Student Misconduct. As part of this investigation, you may be required to
undergo an oral examination to verify your understanding of the assessment content.
If you have any doubts, questions, etc. please consult your lecturer or tutor during lab classes
or office hours.
Software required for this subject
The software required for this subject can be download via the Moodle site and installed on
your personal computer. The software will be pre-installed on your university computer
laboratory. Consult your tutor during lab classes for further details.
You can install Microsoft Office 365 Applications for Mac and PC on your personal
computer. Login to https://portal.office.com/ with your UOW email address to download.
Download UMLet 14.3 from the link on the Moodle and unzip to a folder called
Programming Apps on your Desktop. You will use UMLet 14.3 to draw database
schema in this subject.
This subject requires you to use a Virtual Server to develop and administer MySQL
databases. To install on your personal computer, Download VirtualBox and Extension Pack
from https://www.virtualbox.org/wiki/Downloads
The Virtual Machine is a large file (2.72 GB) only download if you do not already have the
file. Note that the virtual machine can be downloaded from computer labs on campus if you
have limited bandwidth and downloads.
Consult your tutor during lab classes for further details on how to import the Virtual Machine
into Virtual Box.
Further details are published on Moodle and CSIT115 Data Management and Security, "How
to ... ?" Cookbook.
Tasks
Task 1 (1 mark)
The objective of this task is to show you how to create a conceptual database schema with
UMLet 14.3.
(2) UMLet 14.3 is a tool for drawing UML diagrams. To start UMLet 14.3 use UMLet
shortcut available in a folder Programming Apps located on Desktop. The shortcut
has an icon that consists of a red circle crossed with a horizontal red bar with a white text
UMLet.
(3) When UMLet is started, navigate to the right upper corner of UMLet window and pick a
palette CSIT115-815Palette. Do not use any other palettes.
(4) Use UMLet application to draw a diagram given below. It is explained in the Cookbook,
Recipe 2.1, Steps 1 and 2 "How to create very simple conceptual schemas with UMLet?"
how to use UMLet to create class diagrams. For a moment, do not worry about the
meanings of a diagram created. It will be explained to you later on during the lecture
classes.
(5) When ready, add one more attribute to a class SUBJECT and one more association
between the classes STUDENT and SUBJECT. The new attribute and the new
association are up to you.
(5) Add your name, student number and the date to your diagram. You can use a box that is
not connected or part of your diagram to show this.
(6) Use an option File->Save to save your diagram in a file solution1.uxf. Do not
delete a file solution1.uxf.
(7) Use an option File->Export as… to export your diagram into a file
solution1.bmp in BMP format. Do not delete an exported file. You will submit it as
one of the deliverables from your laboratory work.
Deliverables
A file solution1.bmp that contains a diagram given above extended with an attribute and
with an association. A submission of a file solution1.uxf is not expected and it scores
no marks. Submission of a file with a different name and/or different extension and/or
different type scores no marks as well. It is strongly recommended to check the contents of a
file solution1.bmp BEFORE the submission and not after the submission.
Task 2 (1 mark)
The objective of this task is to learn how to use SQL Workbench a Graphical User
Interface (GUI) to the MySQL database.
(2) To start VirtualBox use the shortcut to the Oracle VM Virtual Box
application.
This is explained in Cookbook, Recipe 1.1, Step 1 "How to start VirtualBox ?" how to
start VirtualBox.
(6) When the Ubuntu 18.04 operating system displays an orange box with a name
CSIT115 user press Enter key and then type csit115 into a Password field. Then,
patiently wait until an operating system displays a column of icons on the left-hand side
of a screen.
(7) To start SQL MySQL Workbench GUI left-click at the 6th icon from the top with
the icon with a silhouette of a white dolphin.
(8) Next, to open the csit115 connection, left-click at an icon associated with
csit115 connection within MySQL Connections (localhost:3306).
(9) Select Connect, type csit115 into a field Password, and click at OK button.
Type
use csit115;
The results from processing the script are displayed below in the Action Output
sub-window.
(11) Type the following lines of code with the SQL CREATE TABLE statement into the
panel Query1 panel.
SQL statement listed above creates a single column relational table FIRST_NAME.
Move the mouse cursor to any location within CREATE TABLE statement and left-
click the second yellow lightning icon to process the statement.
The results from processing will be displayed below in Action Output sub-
window.
(12) Save the text typed in the previous step as a SQL script file task2.sql. To do this,
use the blue floppy disk icon to save the file. Do not delete a file task2.sql. You
will submit it as one of the deliverables from your laboratory work.
(13) Type into the following INSERT statement of SQL into the task2 sub-window.
(14) To process, the statement above, left-click the second yellow lightning icon in the icon.
This time you should get an error message in a bottom sub-window.
(15) The problem is that the keyword VALUES is missing between FIRST_NAME and left
bracket (. Add the keyword and process the statement again. I hope you do not get any
errors that this time :).
(16) Add and process the following SELECT statement to list the contents of a relational
table FIRST_NAME.
(17) Finally, add the SQL statement DROP TABLE, this will drop the relational table
FIRST_NAME.
Processing this statement will DROP TABLE the relational table FIRST_NAME.
(18) Now, the SQL script is complete. Save it in a file names task2.sql.
(19) In the previous steps, we processed a SQL script in a statement by statement mode.
This method is good when creating or when debugging a script. It is also possible to
process an entire script with a single mouse click. To do so left-click at an icon with a
small green triangle next to an icon with a large green triangle.
The sequence of steps explained above is typical of the way SQL scripts are developed.
We create the SQL statement, test it, saved the present state of a script in a file and add
additional SQL statements, check again, removing errors whenever necessary, and saving the
most recent version of a script.
It is strongly recommended that you work in this way when creating and testing SQL scripts.
It is an approach that can be summarized as implement a bit, test a bit, save a bit.
Writing an entire script and trying to test in one go may result in a large number of errors,
usually contributing to panic, frustration, and unhappiness.
Resolve all errors and verify your script before progressing to Task 3 where you will run your
saved script
Deliverables
A file task2.sql with SQL script created and tested in Task 2. Submission of a file with a
different name and/or different extension and/or different type scores no marks.
Task 3 (1 mark)
The objective of this task is to learn how to use a command-line interface of MySQL to
process SQL scripts and how create saved reports of the processing of SQL scripts.
In the future, we shall frequently ask you to provide a report from the processing of SQL
scripts. In other laboratory and assignments we will ask you to submit a report from the
processing of SQL and not SQL script itself.
So, how do you create a report from processing the SQL script developed in the previous
task?
(1) If you have not done Task 2 yet then do it now! Otherwise, proceed from the next step.
Check that your task2.sql script is saved in the home location on your virtual machine.
(2) Start the Terminal program. It has the a grey rectangle icon with rounded corners and
small white >_ signs in a column as its icon on the left-hand side of a screen (it is the
5th icon from top).
(3) To start a command-line interface (CLI) MySQL database server type at a command
prompt in the Terminal window:
mysql –u csit115 –p –v -c
(4) When the command-line interface to MySQL database server has started. Use the
following commands:
use csit115;
(5) Next, process the following commands in the Terminal window at the mysql> prompt
tee solution2.rpt;
source task2.sql;
notee;
to submit the script task2.sql for processing by MySQL and to save a report from
the processing of the script in a file solution2.rpt. Do not delete the file
solution2.rpt. It will be submitted as one of the deliverables for your laboratory
work.
(6) It is also possible to modify the contents of SQL script file at this stage. To do it
process at mysql> prompt a command
exit;
To quit mysql CLI. Next, at $ prompt in the Terminal window process a command
gedit task2.sql
to open a text editor with SQL script file task2.sql. Now, you can change the script,
save it, and process it again in the way explained above. It is possible to develop SQL
scripts with an editor and command-line interface (CLI) to a database server, however,
using a graphical user interface (GUI) SQL Developer is much easier.
Deliverables
The files solution2.rpt with a report from the processing of SQL script task2.sql.
Submission of a file with a different name and/or different extension and/or different type
will not score marks.
Task 4 (2 marks)
Review the lecture material and references tests and form answers to following questions
using your own words, diagrams and examples:
(1) What are the differences between Data and Information? How are they connected?
(2) What are the limitations of File systems? How can they be solved using Database
systems?
You are expected to engage in a discussion regarding these questions during your
tutorial in order to gain marks for this task.
Deliverables
The file questions4.pdf with your answers to the questions, your name student number
and the date should be included on each page. Submission of a file with a different name
and/or different extension and/or different type will score no marks.
Submission
End of specification