0% found this document useful (0 votes)
119 views

Lab 1 - Getting Started With UML, Your Virtual Machine and SQL

This document provides instructions for Laboratory 1 of the subject DPIT115 Data Management and Security. It outlines 4 tasks to complete by November 1, 2020 that contribute to 5% of the total subject evaluation. The tasks involve using software like UMLet and MySQL Workbench to draw a conceptual database schema, create a table in a MySQL database using SQL statements, and save the SQL script. Students are expected to complete all tasks individually without assistance from others.

Uploaded by

Kue Keju
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views

Lab 1 - Getting Started With UML, Your Virtual Machine and SQL

This document provides instructions for Laboratory 1 of the subject DPIT115 Data Management and Security. It outlines 4 tasks to complete by November 1, 2020 that contribute to 5% of the total subject evaluation. The tasks involve using software like UMLet and MySQL Workbench to draw a conceptual database schema, create a table in a MySQL database using SQL statements, and save the SQL script. Students are expected to complete all tasks individually without assistance from others.

Uploaded by

Kue Keju
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Diploma of Information Technology Session: Summer 2020

UOW College Australia

DPIT115 Data Management and Security


Laboratory 1
Published on 20 October 2020

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

Please read the information listed below very carefully.

This laboratory contributes to 5% of the total evaluation in a subject DPIT115.

This laboratory work consists of 4 tasks, and the specification of each task starts from a new
page.

The submission procedure is detailed at the end of the specification.

A submission in an incorrect file format, filename format, or as a compressed file (zipped,


gzipped, rared, tared, 7-zipped, lhzed, … etc) will not be evaluated.

A submission marked by Moodle as Late is treated as a late submission no matter how


many seconds it is late.

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.

Perform the following steps.

(1) Start and connect to your Windows system.

(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.

Perform the following steps.

(1) Start and connect to your Windows 10 system.

(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.

(3) When VirtualBox is started, import an appliance Ubuntu18.04-64bits-


MySQL8.0.21-31-AUG-2020 located in the location specified by your tutor. The
process is explained in Cookbook, Recipe 1.1 Step 2 "How to import an appliance to
VirtualBox ?" how to import an appliance.

(4) It is strongly recommended to copy a file Ubuntu18.04-64bits-


MySQL8.0.21-31-AUG-2020 to your USB drive if working in the university lab.
This will allow you to import it to VirtualBox installed on your system at home.
Using this approach, the same software as installed in a laboratory class can be used at
home. If only using your personal computer, use your local hard disk to store the file.

(5) Power on a virtual machine Ubuntu18.04-64bits-MySQL8.0.21-31-AUG-


2020. It is explained in Cookbook, Recipe 1.1 Step 4 "How to power on a virtual
machine ?" how to power on a virtual machine.

(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.

(10) MySQL Workbench opens in a new sub-window titled Query1.

Type

use csit115;

command into the Query1 sub-window.


Move a mouse cursor to any location within use command and left-click
the second yellow lightning icon to process the command; this will
choose csit115 to be the default database.

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.

CREATE TABLE FIRST_NAME(name VARCHAR(20) NOT NULL,


CONSTRAINT FN_PK PRIMARY KEY(name));

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.

INSERT INTO FIRST_NAME ('James');

(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.

SELECT * FROM FIRST_NAME;

(17) Finally, add the SQL statement DROP TABLE, this will drop the relational table
FIRST_NAME.

DROP 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?

Perform the following steps.

(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

and press the Enter key. The password is csit115.

(4) When the command-line interface to MySQL database server has started. Use the
following commands:

use csit115;

at mysql> prompt to select csit115 database.

(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.

tee solution2.rpt command copies the messages and results displayed on a


screen into a text file, in this case into solution2.rpt file. notee command stops
copying the messages and results displayed on a screen to a file.
source task2.sql command sends SQL statements included in script file
task2.sql for processing by MySQL database server.

(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?

(3) What are the abstraction levels of Database systems?

(4) What are the advantages and disadvantages of DBMS?

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

Submit the files solution1.bmp, task2.sql, solution2.rpt and


questions4.pdf to the Lab 1 submission area on the subject Moodle site.

End of specification

You might also like