Directions: Write your answers to the exam questions on this document.
Bulleted items denote a deliverable.
Midterm: DBST 652 spring 2017: There are 5 questions. Each question is worth 20 points.
Items
Directions: Write your answers to the exam questions on this document.
Bulleted items denote a deliverable.
Midterm: DBST 652 spring 2017: There are 5 questions. Each question is worth 20 points.
Items 1 – 5 refer to a purchase order database created in Microsoft Access. You will create a version of the database in Oracle.
Below is a relational diagram of the MS Access database. (For simplicity, some fields are not visible.)
Figure 1 – Relational Diagram MS Access
Some videos on MS Access relationships are located following these links:
1. (20 Points)
• Briefly describe the business rules implied by the relational diagram in the space below.
• Name the primary keys and foreign keys suggested by the relational diagram – complete the table below.
Table Name Primary key Foreign key
• Create a relational diagram of the PO database using Oracle SQL Data Modeler.
Use the MS Access relational diagram as a model for a new relational diagram made in Oracle Data Modeler.
Show evidence that you successfully created the diagram – in the space below show a screenshot of the diagram.
• Provide a brief explanation of any weakness in the data model and any suggestions for improving the model.
2. (20 Points)
Write the Oracle DDL commands to create the 4 tables, primary keys and referential integrity constraints implied in the MS Access relational diagram. Check your Oracle DDL for correctness.
• Submit a copy of the Oracle DDL as a separate file with the name DDL_Midterm.SQL in the assignment folder for the midterm.
• Show evidence that you successfully created the tables – show screenshots below.
• Write a brief explanation on how your solution supports your relational diagram.
3 (20 Points)
Write the Oracle DML commands to populate each of the 4 tables with a minimum of 3 rows data. Use the INSERT statement. Check your DML for correctness.
Minimum data requirements:
At least two rows with different values for Status in the table Purchase Order Status
At least two rows with the same values for Purchase Order ID in the table Purchase Orders Details
• Submit a copy of the Oracle DML as a separate file with the name DML_Midterm.SQL in the assignment folder for the midterm
• Show evidence that you successfully populated the tables in Oracle – in the space below show screenshots of the result set of a SELECT and COUNT statements.
4. Part 1 (10 Points)
4.a Write 1 query demonstrating the use of one of Oracle’s SQL Datetime functions on the Oracle purchase order database. See a description of Datetime functions here: https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions001.htm
• Show evidence that you successfully executed the query – show screenshots below of the result of the queries.
• Explain the query: What is the purpose and expected result of the query?
4.b Write 2 views that have business value on the Oracle purchase order database.
• Show evidence that you successfully executed the views – show screenshots below of the queries and the result of the queries.
• Explain the business value and expected results of the views
4.c Create 2 indexes that have business value on the Oracle purchase order database.
— Do not create an index on a primary key
• Explain the value of the index in the space below.
• Show evidence that you successfully created the indexes – show screenshots below that show the indexes in Oracle SQL Developer.
• Submit one file with the name Question_4_Midterm.SQL to the midterm assignment a copy of the Oracle SQL commands for the queries, views and indexes as i
5. (20 Points)
Design a denormalized version of the PO database that would minimize the number of joins required to write a query that shows the status of an order for a particular product.
Create a new or modify the existing PO database relational diagram to illustrate the denormalized database.
• Show evidence that you successfully created the diagram of the denormalized database– in the space below show a screenshot of the diagram.
Extra Credit 1
Implement the denormalized version of the database. Show evidence that you created a denormalized version of the PO database. Alter the original database. Show deletion of records and tables and updates to e