Implementing object-relational version of the mpf database

Assignment Help Database Management System
Reference no: EM132302797

Tasks of the Assignment

Part 1

Scenario: Mechanical Production Factories (MPF) Database System

MPF is a company that produces customised mechanical products within Europe. The company produces a rang of mechanical products at several factories. Information about which work force are assigned to which production orders and kept in the force usage register.

In order to access information quickly and to ensure that all past records are available for audit purposes, the company developed a database. Figure 1 shows a UML class diagram, which provides a conceptual model of the database.

Relational Design for MPF Database System

A conceptual model of a database may be implemented using any database system (e.g. relational, object-relational, object-oriented). However, to start with, we have mapped the MPF's conceptual model onto a relational logical model. Figure 2 details the relations for an implementation of the database using a relational database system. Note that Figure 2 uses shorthand / abbreviated notation for data types / domains for describing various attributes of the relations involved in the database.

TASKS

Implementing Object-Relational version of the MPF Database

Implement the MPF Database using object-relational (O-R) features of Oracle 10g//11g. You need to discuss your approach to the implementation (2 marks) and provide complete code.

The discussion of your approach should highlight the choices you have made during implementation of your O-R version of the database. You need to justify your approach/choices (e.g., why object types / tables you created are appropriate for the database).

Note that all relationships (e.g. one-to-one, one-to-many, many-to-many) must be bi- directional. Moreover, each to-many side of a relationship (e.g., in case of many-to-one and many-to-many) should be implemented using nested tables. In addition, your implementation should allow all objects to be shareable (i.e. all relationships should be REF based).

Oracle (2013) provides more detailed documentation on Oracle object-relational features.

Populating the O-R version of the MPF Database

Using PL/SQL and/or SQL, populate your O-R version of the MPF Database with some sample data. This part can be seen to contain the following sub-tasks:

(a) Creating / inserting objects in your object tables.

(b) Establishing one-to-many, many-to-one, and many-to-many relationships (see the UML class diagram) among the objects created in sub-task (a).

Querying the O-R version of the MPF Database

For this part, you must use PL/SQL procedures (2 procedures, each worth 4 marks). Answer the following questions after populating the object-relational database (i.e., after completing part 3.2):

Q a) For each of the production order, display production details, dates and hours of their workforce usage and names and ids of the associated workforce staff.

Q b) For each of the product, display product details, details of the associated production orders and details of the factories where the products are produced.

NOTE the following important points for Parts 3.1 to 3.3:

- You must submit all the SQL and PL/SQL code used for creating, populating and querying the O-R database.
- You must submit the output of running your code (e.g., spool files).

Contrasting your O-R version with the relational version of the MPF Database

Compare and contrast the relational version of the MPF Database with your object- relational version from part 3.1. You should highlight the advantages and disadvantages of both versions. Comment on which version will best suit the MPF Database.

Part 2

1. The Sales History (SH) Data Warehouse

SH is a sample database schema provided by Oracle, which has been extensively used in the Oracle's Data Warehousing Guide (Lane, 2013) The SH schema, as shown in Figure 3, consists of a big fact table, SALES, and five relatively small dimension tables: TIMES, PROMOTIONS, CHANNELS, PRODUCTS and CUSTOMERS. The additional COUNTRIES table linked to CUSTOMERS creates a simple snowflake. The model and the attributes are aimed at demonstrating data warehousing functionality like star transformation and query rewrite. They do not necessarily represent the optimal approach for this kind of data warehouse in real productive environments; and such a design would be driven more by business requirements than by the star itself. Table 1 shows the cardinalities of the tables in the SH schema.

Table

Number of Rows

Customers

55,500

Countries

23

Products

72

Sales

9,18,843

Times

1826

Promotions

503

Channels

5

Table 1: Cardinalities of SH tables.

Usually, a star schema includes a single fact table and few dimensional tables, however, the SH schema designer identified another useful fact table called COSTS, which is linked to the TIMES and PRODUCTS dimensional tables. Figure 3 shows two fact tables: SALES and COSTS.

1. Implementation of SH schema

Table 2 shows the files that constitute the implementation of the SH schema using Oracle 10g/11g/12c.

File

Description

sh_cre.sql

Script for creating the base tables of the SH data

warehouse.

sh_cons.sql

Script for enabling constraints.

sh_drop.sql

Script for dropping the SH schema objects.

sh_idx.sql

Script for creating indexes.

sh_pop1.sql

Script for loading data into COUNTRIES and CHANNELS

tables.

sh_pop2.sql

Script for populating the TIMES dimensional table.

sh_schema_objects.sql

Script for calling other scripts e.g. sh_cre.sql for creating

base tables and populating the small dimensional tables.

sh_cremv.sql

Script for creating materialized views.

sh_ext_table.sql

Script for creating an external table.

sh_main.sql

Script that calls several other scripts including e.g.

sh_cremv.sql, sh_idx.sql etc.

sh_costs.sql

Script for populating the COSTS fact table.

sh_hiera.sql

Script for creating dimensional hierarchies, which are

called DIMENSION in Oracle.

Table 2: Files used to implement the SH schema.

3. Two versions of SH schema/database

1) The default and optimized version of the SH database is created under the SH2 user. You have read-only access to query any of the tables of SH database by prefixing any table or view name by "SH2.", e.g., to query the contents of CHANNELS table, use:

SELECT * FROM SH2.CHANNELS;

2) An un-optimized version of the SH database has been created under your own username DWn. You will be given a special username and password for doing this part of the assignment (i.e. an Oracle account starting with DW and followed by a number e.g. DW1, DW2, etc). Throughout this part, you MUST use this special username. However, it is assumed that you will not create any indexes on any of the tables in your own personal version of the SH until asked to do specifically. Moreover, neither materialized views (see sh_cremv.sql) nor dimensional hierarchies (see sh_hiera.sql) should be created in your version of the SH database.

4. Important Note

Whenever, you need to assess the performance of existing database structures (e.g., materialized view, index, dimensional hierarchies) you must refer to SH2 as above (using the "SH2." prefix). Any new database structures that you need to create should be created under your username. Likewise, when you need to assess the performance of any new database structures that you create under your DWn username, you need to prefix all tables/views/materialised views accordingly, e.g., to query the contents of your CHANNELS table, use:

SELECT * FROM DWn.CHANNELS;

5. Tasks of the Assignment

Note: You must submit all the SQL queries and any other code that you wrote in answering any of the parts / questions (e.g., the use of Explain Plan statements for the queries and their output).

(i) Study the index definitions in sh_idx.sql. Discuss in detail (using cost based analysis) why these indexes (at least two of them) are useful for answering queries over the SH2 and DWn versions of the database. You do not need to run the sh_idx.sql script at all.

(ii) Identify two new indexes and justify why they could be useful. Write the SQL code for creating these indexes under your DWn user. Give example queries with cost-based analysis for both DWn (which will have the new indexes) and SH2 users (which will not have any of your new indexes).

(iii) Given the materialized views (MVs) defined in sh_cremv.sql, discuss in detail why these MVs are useful for users of the SH database. You should provide detailed examples (cost based analysis, e.g., using Explain Plan for running sample queries on both SH2 and DWn) to illustrate your answer. You do not need to run the sh_idx.sql script at all.

(iv) Identify two other MVs based on the base tables in the SH schema under your DWn user and justify why they would be useful. Write the SQL code for creating these MVs.

(v) Prior to the introduction of the aggregation function ROLLUP, there was no possibility to express an aggregation over different levels within one SQL statement without using the set operation UNION ALL. Every different aggregation level needed its own SQL aggregation expression, operating on the exact same data set n times, once for each of the n different aggregation levels. With the introduction of ROLLUP in the recent editions, Oracle provided a single SQL command for handling the aggregation over different levels within one single SQL statement, not only improving the runtime of this operation but also reducing the number of internal operations necessary and reducing the workload on the system.

a. Using ROLLUP, write an SQL query over the SH schema under your DWn user involving one fact table (SALES or COSTS) and at least two dimension tables. Provide reasons why your query may be useful for users of the SH data warehouse.

b. Using set operation UNION ALL (and not ROLLUP), write an SQL query that produces the same result as the query in (a) above.

c. Using EXPLAIN PLAN, provide a detailed discussion analysing costs of evaluating the above queries (i.e. with and without ROLLUP).

Attachment:- Database Modelling.rar

Reference no: EM132302797

Questions Cloud

What is the most expensive car you can afford : You have saved $4000 for a down payment on a new car. The largest monthly payment you can afford is $350. What is the most expensive car you can afford
Discussion on team-building activity : Imagine that you are a new team leader. Suggest one (1) team-building activity that would allow you to learn about the different members of your team.
Likely to succeed in assignment as expatriate : What abilities make candidate more likely to succeed in assignment as expatriate? Which of these abilities do you have? How might person acquire these abilities
Person-focused pay is becoming more prevalent in companies : Person-focused pay is becoming more prevalent in companies; however, person-focused pay programs are not always an appropriate basis for compensation.
Implementing object-relational version of the mpf database : KC7013 - Database Modelling - Northumbria University - Establishing one-to-many, many-to-one, and many-to-many relationships (see the UML class diagram) among
Use different applications for inventory control : Different areas of a supply chain need to use different applications for inventory control.
Examine aspects of teamwork training : Examine two (2) aspects of teamwork training that change a person into a transformational leader. Justify your response. Predict your possible reaction.
Should formal education be required : What training should a bookkeeper have before working on any institution's accounting records? Should formal education be required? Is certification necessary?
Likely to succeed in assignment as expatriate : What abilities make candidate more likely to succeed in assignment as expatriate? Which of these abilities do you have? How might person acquire these abilities

Reviews

len2302797

5/10/2019 1:53:29 AM

Module Learning Outcomes (MLOs) assessed: Knowledge & Understanding: 2. Key concepts of data warehousing. Intellectual / Professional skills & abilities: 3. Conceptual data modelling, relational database design and implementation in SQL & PL/SQL, and object-based databases. 4. Design and Implementation of a data warehouse using Oracle database system.

Write a Review

Database Management System Questions & Answers

  How ubiquitous and resilient the given model

Zibuschka, J., Laufs, U. & Roßnagel, H. (2011). Towards ubiquitous emergency management systems presented a ubiquitous. How ubiquitous and resilient this model?

  Design the logical structure of a database

Relational Database Systems COMP 1005 - Design the logical structure of a database using Entity-Relationship diagram - Apply normalization techniques

  Design a normalized relational database management system

Design a completely Normalized Relational Database Management System that meets both the high-level and technical requirements of the web-based project management system.

  Queries on joins and unions

Provide an explicit JOIN SQL statement that returns the store ID, store name, manager employee first and last name fields, manager employee grade, the city and state fields of the store

  Identify a unique type of file in windows or linux

Identify a unique type of file in Windows or Linux with which you are familiar. Suggest the key factors that in your opinion make this a unique type of file

  What are the appropriate primary keys in each relation

IT-244 Introduction to Databases Assignment Questions. Consider the Bank database: What are the appropriate primary keys in each relation

  Create the complete erd that contains all primary keys

Some Tiny College staff employees are information technology (IT) personnel. Some IT personnel provide technology support for academic programs.

  Why do you expect to see seasonality in sales of shampoo

Why do you expect to see seasonality in sales of shampoo? Why? If the goal is forecasting sales in future months, which of the following steps should be taken?

  Dba at premiere products

The DBA at Premiere Products wants you to investigate biometric identification techniques for potential use at the company for computer authentication purposes.

  Compare different types of partitions-disks and volumes

You are tasked to design Windows 2008 servers to host a database and the company's Web application that will be used heavily by 1,000 employees. The goals are to minimize the downtime, provide the best possible performance for both the application..

  Prepare a report for yash and the pfi executive team

Prepare a 300-word executive summary for Yash that describes each deliverysystem you identify and outlines the current or likely near-term availability of each systemfor content providers such as PFI.

  Design the logical structure of a database

Relational Database Systems - COMP 1005 Design the logical structure of a database using Entity-Relationship diagram and Apply normalization techniques to reduce redundancy in a database.

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