Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CSIT115 Data Management and Security

Laboratory 1

2022

Scope

This  laboratory  includes  the  tasks  related  to  the  simple  applications  of the  software systems that will be used in the subject CSIT115 Data Management and Security in the Autumn session 2022.

The outcomes of the laboratory work are due by Saturday 12 March 2022, at 7.00 pm (sharp).

Please read very carefully the information listed below.

This laboratory contributes to 3% of the total evaluation in a subject CSIT115. A submission procedure is explained at the end of the specification.

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

It is recommended to solve the problems before attending the laboratory classes in order to efficiently use supervised laboratory time.

A submission marked by Moodle as  Late is treated as a late submission no matter how many seconds it is late.

A policy regarding late submissions is included in the subject outline.

A submission of compressed files (zipped, gzipped, rared, tared, 7-zipped, lhzed, … etc) is not allowed. The compressed files will not be evaluated.

All  files  left  on  Moodle  in  the  state   "Draft(not submitted)" will  not  be

evaluated.

An implementation that does not compile due to one or more syntactical errors scores no marks.

It is expected that all tasks included within Laboratory 1 will be solved individually without any cooperation with the other students.  If you have any doubts, questions, etc. please consult your lecturer or tutor during lab classes or office hours. Plagiarism will result in a FAIL grade being recorded for the assessment task.

Tasks

Task 1 (1.0 mark)

An 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 system.

(2)  Click  UMlet14.3  (umlet-14.3.zip) under  the  section  Resources to download a file umlet-14.3.zip.

(3)  Extract all the files include sub-folders from umlet-14.3.zip into a new folder on a drive of a computer. E.g. create a folder UMLet on drive C, extract all the files from umlet-14.3.zip into the folder UMLet.

(4)  UMLet 14.3 is a tool for drawing UML diagrams. To start UMLet 14.3, go to a folder that contains all files of UMLet  14.3. e.g. UMLet. Execute the application UMLet.exe (or umlet.jar).

(5)  When UMLet is started navigate to the right upper corner of UMLet window and pick a palette CSIT115-815Palette. Do not use any other palette!

(6)  Use the 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 during the lecture classes.

 

(7)  When ready, add one more attribute to a class SPORT CAR. The new attribute is up to you.

(8)  Use an option File->Save to save your diagram in a file solution1.uxf. Do not delete a file solution1.uxf.

(9)  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 with one more extended attribute. 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 submission and not after submission.

Task 2 (1.0 mark)

An objective of this task is to learn how to use a graphical user interface (GUI) SQL Developer to create and process SQL scripts.

Perform the following steps.

(1)     Start your computer system. If you use a laboratory computer, you may start from step (6) since the VirtualBox has been installed. Otherwise, you need to start from step (2).

(2)     Download and install Oracle VM VirtualBox on your computer.

(i) Click the link VirtualBox downloads from the subject Moodle site under the Resources section.

(ii) Download the latest VirtualBox platform packages suitable for your platform.

(iii) Download the latest Oracle VM VirtualBox Extension Pack.          (iv) Install  Oracle VM VirtualBox platform packages on your platform.

(v) Install Oracle VM VirtualBox Extension Pack.

Watch the video   Install VirtualBox and Extension packs (mp4) for the details .

(3)     Click  An ova image of VirtualBox that contains MySQL 8.0.18  (download  from  OneDrive) or   an  ova  image  of VirtualBox that contains MySQL 8.0.25  (download from OneDrive) from  the  subject  Moodle  site  under  the  Resources section  to download  an  ova file  on  the  computer.  Watch  the  video  Import MySQL appliance for VirtualBox(mp4) for more details.

Note that if a computer has 4GB or lower (at least 2GB) RAM, it is recommended to   download   the   MySQL  community  server from   the   link   MySQL community server under  the  section  Resources and  install  it  on  the platform.  Watch  the  video   Install MySQL community server on Windows 10 (mp4) or the video Install MySQL community server on Mac OS (YouTube video) for more details.

(4)     Start Oracle VM VirtualBox.

It is explained in Cookbook, Recipe 1.1, Step 1 "How to start VirtualBox ?" how to start VirtualBox and  the  video  Import MySQL appliance for VirtualBox (mp4).

(5)     When VirtualBox is started, import the ova appliance downloaded in step (3).

It is explained in Cookbook, Recipe 1.1 Step 2 "How to import an appliance to VirtualBox ?" how to import an appliance and the video Import MySQL appliance for VirtualBox (mp4).

(6)     Power on a virtual machine that has been imported in step (5). It is explained in Cookbook,  Recipe 1.1 Step 4 "How to power on a virtual machine ?" how to power on a virtual machine and the video Import MySQL appliance for VirtualBox (mp4).

(7)     When the virtual machine operating system displays an orange box with the name of CSIT115 user press Enter key and then type csit115 into a Password field. Then, wait until the operating system displays a column of icons on the left-hand side of a screen.

(8)     Start MySQL Workbench User Interface (GUI). To start MySQL Workbench GUI left click on the icon with a dolphin.

(9)     Next, open csit115 connection. If the connection does not exist, left click at an icon plus (+ in a circle) associated with MySQL Connections in the welcome panel. Input a name  (e .g. csit115) in a field Connection Name, type csit115 into a field Username, and click on the OK button.

(10)  MySQL Workbench now has a new connection icon  csit115. Click the icon csit115. Input the password csit115 in the popup window, then click the OK button. In the new window of Query (Initially it start with Query 1) panel, type

use csit115;

Move  a mouse  cursor to  any  location  within the  use command,  and  click the second yellow lighting icon (with 1 in it) to process the command. This command chooses csit115 as a default database.

The results from processing are displayed below in the Action Output sub- window.

(11)  Download SQL script files dbcreate.sql, dbdrop.sql, dbload.sql and dbcount.sql from the section Sample database. The files are saved in the folder Downloads.

(12)  In MySQL Workbench, click File -> Open SQL Script…, then double click the folder Downloads, click the file dbcreate.sql, then click Open button (a green  button).  A  new  tab  with  the  name   dbcreate appears  on  MySQL Workbench.

You can click the second button   Open a SQL script file in a new query tab to open a new SQL script file . The second button is below the menu bar of MySQL Workbench.

Open the SQL files dbload.sql, dbdrop.sql and dbcount.sql that have been downloaded in step (11) in MySQL Workbench.

(13) Click the tab dbcreate, move a mouse cursor to the first yellow lighting icon to process all the statements in the SQL script file dbcreate.sql. We can create all the relational tables with no data inside.

The results from the processing are displayed below in the Action Output sub- window.

(14)   Click the tab dbload, move a mouse cursor to the first yellow lighting icon to process all the statements in the SQL script file dbload.sql. We can load all data into the empty relational tables that created in step (13).

The results from the processing are displayed below in the Action Output sub- window.

(15) Click the tab dbcount, move a mouse cursor to any location within the SELECT command between line 1 and line 6, and click the second yellow lighting icon (with

1 in it) to process the command. This command display number of rows in each table.

The  results  from  the  processing  are  displayed  below  in  Result Grid and

Action Output sub-window.

(16)   Click the tab Query 1 (the Query that appears in step (10)), type into the Query panel the following lines with SQL statement INSERT below the use command.

/* Insert a new product record */

INSERT INTO Product VALUES (24, 15.55, 'DEF Pty Ltd',

NULL);

Move a mouse cursor to any location within the INSERT statement and left click at the second yellow lighting icon (with 1 in it) to process the statement.

The results from the processing are displayed below in the Action Output sub- window.

(17)  Type into the Query panel the following lines with SQL statement SELECT.

/* Display total number of products */

SELECT COUNT(*) FROM Product;

Move a mouse cursor to any location within the SELECT statement and left click at a yellow lighting icon (with 1 in it) to process the statement.

The results from the processing are displayed below in both Result Grid and Action Output sub-window.

(18)   Save the text typed in the previous steps (10), (16) and (17) as SQL script in a file solution2.sql.  To  do  so  click  File->Save Script As… options  of MySQL Workbench. Double click Desktop, fill in file name solution2.sql, then click the Save button.

(19)  Take a screenshot of MySQL Workbench. From the Oracle VM VirtualBox, click View -> Take Screenshot…, choose a folder on your platform, input a file name  solution2.bmp, then click  Save to save the screenshot into an image file.  The file solution2.bmp will be submitted later.

Note  that  the  image  file  solution2.bmp must  contain  the  sub-windows include   the   script   file   solution2.sql,   Result Grid and  Action Output.

A sequence of steps except the last one listed above is a typical development procedure for SQL scripts. We create an SQL statement, test it, save the presents state of a script in a file and progress to create the next SQL statement, test it, remove errors whenever it is necessary, and save the most recent version of a script. It is strongly recommended to 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.

Deliverables

A file  solution2.bmp with SQL script that has been 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.0 mark)

An objective of this task is to learn how to use a command line interface mysql to process SQL scripts and how to create and save the reports from the processing of SQL scripts.

In the future, we shall frequently ask you to provide a report from the processing of SQL script earlier created and tested with SQL Developer. In other laboratory and assignment tasks, we shall ask you to submit a report from the processing of the SQL script and not the SQL script itself. So, how to create a report from the processing of 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.

(2)     We will refresh the sample database affected in Task 2.

In MySQL Workbench, click the tab dbdrop, move a mouse cursor to the first yellow  lighting  icon  to  process   all  the   statements  in  the   SQL   script   file dbdrop.sql. We can drop all the relational tables created in Task 2.

Click the tab dbcreate, move a mouse cursor to the first yellow lighting icon to process all the statements in the SQL script file dbcreate.sql. We can create all the relational tables with no data inside.

Click the tab dbload, move a mouse cursor to the first yellow lighting icon to process all the statements in the SQL script file dbload.sql. We can load all

data into the empty relational tables that were just created above.        In this case, we have restored the sample database to the initial status.

(3)     Start the Terminal program. It is visualized as a grey rectangle icon with rounded corners and small white >_ signs in a column of icons on the left-hand side of a screen.

Note that the file solution2.sql is in the current folder Desktop.

Use a shell command

ls

to display all the files in the current folder.

(4)     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 Enter key. A password is csit115.

The option –u csit115 connects MySQL server by using a user csit115; The option –p requires MySQL sever verify the user by a password; The option –v corresponding to a short term –verbose, which will display the command that typed in. Option  -c allows the comments included in the original version of a script file to be displayed in the logging file.

(5)     When a command line interface to MySQL database server is started, process a command:

use csit115;

at mysql> prompt to select csit115 database.

(6)     Next, process the following commands in Terminal window at mysql> prompt

tee solution2.rpt;

source solution2.sql;

notee;

to generate a report file solution2.rpt.

The command

tee solution2.rpt;

opens the file solution2.rpt for the processing logging.

The command

source solution2.sql;

tells the server to process the SQL script file solution2.sql from the current folder. Since the logging file solution2.rpt is ready, all the processing results include SQL script, processing results and comments are saved in the logging file.

The command

notee;

closes  the  logging  file  that  opened.  In  this  case,  logging  into  solution2.rpt  is disabled.

Do  not  delete  a  file  solution2.rpt.  It  will  be  submitted  as  one  of  the deliverables from your laboratory work. If any errors or mistakes happened in the processing (no error allowed in solution2.rpt), you must delete the file solution2.rpt, refresh the sample database (step (2)), then repeat the commands in step (6).

(7)     It is also possible to modify the contents of the SQL script file at this stage. To do it, process at mysql> prompt a command

exit;

To quit mysql CLI. Next, at $ prompt in Terminal window process a command gedit solution2.sql

to open a text editor with SQL script file solution2.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) MySQL Workbench is much easier.

A report that contains no listing of processed SQL statements scores no marks, and a report that contains errors of any kind also scores no marks!

Deliverables

The  file  solution2.rpt with  a  report  from  the  processing  of  SQL  script  file solution2.sql. Marks will be deducted for the missing comments. Submission of a file  with  a  different  name  and/or  different  extension  and/or  different  type  scores  no marks.

Submission

Note, that you have only one submission. So, make it absolutely sure that you submit correct files with the correct contents. No other submission is possible!

Submit  the  files  solution1.bmp,  solution2.bmp,  and  solution2.rpt to Moodle in the following way:

(1)  Access Moodle at  http://moodle.uowplatform.edu.au/

(2)  To login use a Login link located in the right upper corner the Web page or in the middle of the bottom of the Web page

(3)  When  logged  select  a  site  CSIT115 (S122) Data Management and Security

(4)  Scroll down to a section Submissions

(5)  Click at a link In this place you can submit the outcomes of Laboratory 1

(6)  Click at a button Add Submission

(7)  Move  a  file  solution1.bmp into  an  area  You can drag and drop files here to add them. You can also use a link Add

(8)  Repeat step (7) for the files solution2.bmp, and solution2.rpt

(9)  Click at the checkbox with a text attached: By checking this box, I confirm that this submission is my own work,  to confirm the authorship of your submission

(10) Click at a button Save changes

End of specification