Obtain data and information from a database

Assignment Help Other Subject
Reference no: EM133010928

Assignment - Spatial and Document Database Assignment

Purpose

The purpose of the assignment is to provide students with the opportunity to apply knowledge and skills developed during the semester with particular reference to:

1. Interpretation of business rules from additional information for case study;

2. Knowledge acquisition with respect to Spatial and Document Databases:

a. Creation of a spatial database and a document database;

b. Creation of spatial data within that spatial database and creation of document data within the document database;

c. Querying of that spatial and document data.

Learning Outcomes
The learning outcomes directly assessed are:

Knowledge:

K4. Design a relational database for a provided scenario utilizing tools and techniques including ER diagrams, relation models and normalization

K5. Describe relational algebra and its relationship to Structured Query Language (SQL).

Skills:

S1. Interpret entity-relationship diagrams to implement a relational database.

S2. Demonstrate skills in designing and building a database application using a commercially available database management system development tool.

S3. Use a query language for data manipulation.

Application of Knowledge and Skills:

A1. Design and implement a relational database using a database management system.

A2. Utilise a query language tools and techniques to obtain data and information from a database.

Assignment Requirements

Overview
Students are expected to read the case study further details part A and then interpret that description in terms of implementing the changes to their existing Postgres database. Students then need to:

1. Install the PostGIS spatial database software (if not already completed during week 7);

2. Extend their own existing assignment 1 PostgreSQL relational database to a PostGIS spatial database;

3. Write SQL commands in pgAdmin4 to create spatial data in the extended database;

4. Write spatial queries using SQL;

Students need to read the case study further details part B and then:
5. Install the MongoDB document database software, MongoDBCompass GUI and associated software (if not already completed in week 8);

6. Understand the embedded schema proposed and understand the examples given in Appendix A:

7. Use MongoDBCompass or mongosh to:

a. Create a document database;

b. Create a collection in that document database;

c. Create documents within that collection;

d. Write MongoDB commands to populate the collection;

e. Write MQL to query the database.

It is a requirement of this assignment that students use Postgres/PostGIS and MongoDB for the database components of this assignment.

Case Study - Appliance Deliveries System

The following information should be read in conjunction with the case study information from the first assignment.

You have decided after analyzing the information from assignment 1 and completing that work by implementing a database with test data (your work for assignment 1), that you should make additional changes to the original database you designed.

Part A

You believe that spatial information could be very important to the operations of AppliancesToYourDoor. They could use this information for customer analysis, delivery analysis and other parts of their business. To introduce the concept you decide to provide an example in the existing database. You suggest that the warehouse table should be populated with spatial data and as a starting point, you decide that an outline of the warehouse itself, the location of the nearest weighbridge and a location and elevation for the office of the warehouse is needed. You decide to implement these changes and then demonstrate some of the functionality available with this information and hope that AppliancesToYourDoor can then see the benefit in other areas of their business and would ask to you develop this spatial aspect further. At the moment though you are only going to concentrate on the warehouse as your spatial

focus. To that end you determine, using Google Earth the office, warehouse and weighbridge points for warehouses for three of the eastern seaboard warehouses.

The table below summarises this information (all coordinates are in (longitude, latitude (WSG-84 in decimal degrees), elevation in metres)*:

Part B

You also understand that AppliancesToYourDoor feel they have a data requirement that hasn't been met. Deliveries are conducted according to a schedule and this was explained in the case study for the first assignment. What was missed though was a record of the log of events that occur on a delivery. Drivers and jockeys do other things besides deliveries. They might, for example have mechanical issues, fill up with fuel, have other short breaks and meal breaks or they might contact the office about some issue or other. At present, each truck has a log/diary that the driver and jockey are supposed to fill in but some employees don't do this and some keep notes on their company supplied mobile phone instead. They also often take photos for installation purposes and for other information. AppliancesToYourDoor are frustrated about all the various bits and pieces of information that they need to access to know what happened on a delivery schedule and want some sort of standardized data repository that they can update and query.

You determine that this log of events would be a good candidate for recording in a document database. You also know of an example logging app that could be installed on each employee's company supplied mobile phone. This app allows real time download of the logged information but users can perform a bulk download at the end of the schedule if they need to. You know that you can configure the app to meet the needs of the logging but that is not your focus now. You want to understand the data needs of this functionality so you have collected some sample information of some delivery schedule logs and based on this have decided the data could be arranged and stored in the following manner:

{_id: <scheduleID>, vehicle:<vehicleID>,
driver:<the driver's employeeID>, drivername:<the driver's full name>, jockey:<the jockey's employeeID>, jockeyname:<the jockey's full name>,
deliverytype:<the description of the type of delivery i.e.one of "Suburban", "Inner Regional', Regional Outer", "Regional Remote" and "Regional Extreme">,

date:<the date of the schedule>,

warehouse:<the warehouseID where the delivery schedule started>, departuretime:<time departed warehouse>, departurecomment:<any comments at start of journey>, finishtime:<time returned to warehouse>,
finishcomment:<optional information about how schedule went or issues encountered>, logdetails: <an array of event objects for the schedule showing what happened>
[starttime:<the start time of the event>,

finishtime:< the finish time of the event>, eventdescription:<information about event>, eventlocation:<where the event happened>,
eventtype: <one of "break", "delivery", "mishap" or "other">, eventpictures:<array of pictures>[],
delivereditems:<an array of what was delivered> [delivereditem:<description of delivered item>
delivereditemtype:<one of "Refrigerator", "Washing Machine", "Microwave", "Dryer", "Oven", "Cooktops", "Air Conditioner", "Television", "Other">
deliveredqty:<the number of these items delivered> installationtime:<the number of minutes required to install, if any>],
deliveryattempt:<a value of "Success" or "Failure" for an attempted delivery>]

}

You now have an opportunity to model the schedule log information and test out if what happens can be stored in the DDBMS.

Detailed Requirements

This assignment is an individual assignment. It is a requirement of this assignment that students use PostGIS for the spatial database components and MongoDB for the document database components.

Students should submit a report that follows the format of a business/professional report and contain, at a minimum, a Title Page, Table of Contents, Executive Summary and References (if cited) and the following content with appropriate identifying headings:

A. The spatial database tasks (you should use the Spatial Reference ID (SRID) of 4326 for your spatial data):

1. Three pgAdmin 4 GUI screen shots of SQL and output for adding spatial columns:

a. geom_office POINT of 3 dimensions;

b. geom_warehouse POLYGON of 2 dimensions;

c. geom_weighbridge LINESTRING of 2 dimensions;

2. Nine pgAdmin 4 GUI screen shots of SQL and output for adding spatial column data for:

a. Laverton North warehouse office location;

b. Laverton North warehouse polygon;

c. Laverton North weighbridge line;

d. Campbelltown warehouse office location;

e. Campbelltown warehouse polygon;

f. Campbelltown weighbridge line;

g. Logan Park warehouse office location;

h. Logan Park warehouse polygon;

i. Logan Park weighbridge line;

3. Seven pgAdmin 4 GUI screen shots of SQL and output for the following queries/output:

a. Show the name of each of the warehouses with their office and warehouse coordinates. Use the St_AsText function to show the coordinates in a readable (longitude and latitude) format;

b. Show the name of each warehouse with their office and warehouse coordinates. If you have correctly entered your data, you should have the geometry viewer eye available in the column headings for your office and warehouse columns. Highlight one of the warehouse cells (move your mouse pointer to the cell and click it). Then select the geometry viewer eye in the heading (next to the padlock) to change your view to a plan/map view of the warehouse in the OpenStreetMap # app. To return to the view of the output, select the Data Output option. Select another warehouse cell and select the geometry viewer eye. The query in the Query Editor will remain the same whilst you are changing your view. You should provide a screen shot of the SQL and Geometry Viewer view for the warehouse that is not a rectangle;

# (A geometry viewer was added in v3.3 of pgAdmin4 but it only works for an SRID of 4326

(OpenStreetMap uses the WGS 84 Spheroid), so we have used that SRID in this assignment. For more information on this see Alger, 2018).

c. Show the name and the centre point (use the ST_asText and ST_Centroid functions for this) of each factory in degrees of longitude and latitude;

d. Show the name, area of each factory in metres squared (label this column "Areas(m2)") and its perimeter in metres (label this column as "Perimeter(metres)") . You will need to transform (ST_Transform) your SRID for Laverton North to 7855 and to 7856 for Campbelltown and Logan Park;

e. Show the name of the warehouse, the length in metres of its accompanying weighbridge - label as "Weighbridge length(metres)" - and the distance between the office and the weighbridge (in metres) - label as "Distance from Office to Weighbridge". Again, you will need to transform your SRID for Laverton to 7855 and to 7856 for Campbelltown and Logan Park;

f. Using one of the spatial relationship functions, show which factory office/s i.e. which points, are within the boundary of its own factory (look at slides 33-35 of the week 7 lecture slides for an idea on how to do this);

g. Show the sphere distance and the spheroid distance measurements in kilometres between the Campbelltown and Logan Park factory offices (look at slide 43 of the week 7 lecture slides for an idea on how to do this);

B. The document database tasks:

1. You need to create a MongoDB database called itech2004yourStudentIDDB and a collection named schedulelog within that database. Information about how to create a database and collection are given in the SEITPS ITECH2004 MongoDB Installation Guide V1.0 and also in the course textbook.

2. Load the document information from the commands in Appendix A of this document and include a MongoDBCompass screen shot of the loaded documents (expand all arrays and objects) after you have completed this;

3. Show the mongoDB commands to insert the following information into your database collection (you will only receive half marks if you do not provide the commands but instead construct the data and import/insert manually into the collection) :

a. Create a new schedule document that has an id of 7001. The vehicle with a registration of "QAS

127" is assigned to it, you are the driver (your employee number is "800652") and your lecturer is the jockey (their employee number is "100089"). The schedule is for a "Suburban" delivery type, the schedule date is 9/8/2021, starting at the Laverton North warehouse (V01) and you drive out of the warehouse at 9:00am in the morning.

b. You create a log entry for the first delivery of two microwaves which occurs at 9:15 to a construction site at 25 Thompson St Caroline Springs. The delivery is over in 5 minutes; no installation is necessary.

c. You take two pictures on your company supplied mobile phone of the microwaves in the lunchroom of the building site and record their ids in the log;

d. Both are Panasonic models called the Lunchroomer (P22_LR) and you update the log entry with this information;

e. You then update the log with the finish time, tick success and you are on to the next delivery;

f. You create another log entry for the second delivery of one refrigerator and a washing machine to 67 Fielding Crescent, WaterGardens. You arrive at 9.45.

g. You need to do a bit of installation at this place so you take your time to be careful and not damage any goods. When you are finished you take two pictures on your company supplied mobile phone one of the refrigerator and the other of the washing machine installed in the premises. You make a note of this in the log.

h. The refrigerator is a Westinghouse 605L SSFD model and it takes you 15 minutes to install. The washing machine is a Miele twin tub MTT-18 model and you take 15 minutes to install that also. You record the items installed and the time it took to install them. You update the log with the finish time, tick success and you are ready for your next delivery.

i. Disaster strikes. You realise you have a flat tyre and you need to change to the spare. You take a photo, and ask the jockey to start with changing the flat tyre while you make an entry in the log with the time of the event, a description about the flat tyre, a location (it's a bit embarrassing as you are outside the house you just delivered to) and an event type of "mishap".

j. You help change the flat tyre and when you have finished you take another photo and then update the log entry with the photo details and a finish time.

4. Provide screenshots of the mongosh shell with the command and successful running of the following

queries/requirements:

a. Change the drivername on the document with _id = 7000 to your name and the corresponding employeenumber to your student number;

b. Show all information in the schedulelog for a document with _id = 7001;

c. Show the event log details for any event that is of type, "mishap";

d. Show the event log details for any event where the delivered quantity of a particular appliance at the same address was greater than 1.

e. A mistake was made in the schedulelog on schedule _id = 7000 and the delivery event to the Stawell St. Ballarat East address. The Panasonic Microwave was not delivered so you need to pull it out of the array.

Attachment:- Document Database Assignment.rar

Reference no: EM133010928

Questions Cloud

What is expected to happen to the planet resources : Today, the human population continues to exponentially, resulting in increased consumption rates. According to the video, if these trends continue into the futu
Difference between a theory and a hypothesis : Draw on the assigned reading and the lecture material to explain, what Berger & Luckmann mean by the concept 'the social construction of reality'?
Briefly discuss values in social welfare : Briefly discuss values in social welfare.
Outline five best practices to select suppliers : When planning for HR services, it is important you identify and engage the most appropriate service providers for your organisation. Outline five best practices
Obtain data and information from a database : Design and implement a relational database using a database management system - Utilise a query language tools and techniques to obtain data and information
Define individual plans : Define individual plans, team plans, and factory-wide performance compensation plans. Finally, based on the advantages and disadvantages of each, explain which
Section on bloom taxonomy : Bloom developed his taxonomy in the 1950s. Throughout the years, some of its original language and classification have been tweaked or adopted.
Section on bloom taxonomy : Bloom developed his taxonomy in the 1950s. Throughout the years, some of its original language and classification have been tweaked or adopted.
Proactive about in organizations : -What are the three most compelling issues HR professionals should be proactive about in their organizations to support and promote positive employee relations?

Reviews

Write a Review

Other Subject Questions & Answers

  Compromised in proposed research process

What would you do to ensure that ethics are not being compromised in the proposed research process?

  Why study situational approaches to leadership

Why study situational approaches to leadership? Describe the House-Mitchell Path-Goal Theory and their view of appropriate leadership styles. What are the potential outcomes of having lower level employees participate in the MBO process?

  Description of two forensic psychology professional roles

a description of two forensic psychology professional roles. Then, analyze the impact of each role in both an internal context (i.e., within the police department) and an external context (i.e., outside the police department-n neighborhoods, schoo..

  Identify the change you would like to implement

Identify the change you would like to implement and explain the plan you would use to bring about the change.

  What is a current challenge faced by group

When it comes to Polynesians can you explain a historical fact about this group that has implications in the present?

  What has been the pattern of immigration

What has been the pattern of immigration to the United States and how has this changed over time (perhaps because of changes in law, custom, attitudes, etc.)?

  Develop a backup and recovery strategy for the company

develop a backup and recovery strategy for this company that could be implemented regardless of whether lawywers were in their local office, or out in field.

  Why do some people disagree with the given position

Share the essay topic you are exploring for the argumentative essay. Describe why you think it is an arguable topic. What is your position in the topic?

  Report and discuss types of police corruption

Report and discuss types of police corruption.  Explain the term noble cause corruption. Give an example of this in contemporary law enforcement. Be specific and defend your response

  Different areas of a project plan

Which aspects or areas of a project plan are more likely to be affected by risk responses and how do risk responses affect the different areas of a project plan

  Do they reveal different perspectives or change over time

Briefly summarize and analyze two primary sources, identifying their intended audience, purpose, context in which they were produced.

  Discuss pain in the critically ill patient

Perform a search in two scholarly databases for an article that is relevant to that topic. Share the name, URL and a brief description of the two databases

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd