Write a procedure called listoverduebooks

Assignment Help Database Management System
Reference no: EM132667076

COMP2350 Database Systems - Macquarie University

Database Programming and Implementation

Task 1
Create the tables listed in the relational data model as shown in Figure 1 below, by running the DDL script provided in the 'Assignment 3' folder. Then insert sample records to the tables by running the provided DML script. Verify that the tables are created and populated as intended.

1174_Relational Data Model.jpg

Figure 1 : Relational Data Model

Task 2
In this task, you will write a BEFORE INSERT trigger called TR_BORROWING which fires when a member wishes to borrow a book from a branch (that is, when a new row is to be inserted into the borrowedby table).
In the trigger body, the following checks would need to be done first:
• The member's status is "REGULAR".
• The branch is holding copies for borrowing at the branch (i.e., OnLoan < InStock).
• The member has not borrowed any copies of this book from any branch.
• The return due date of the borrowed book is normally in exactly 3 weeks from the borrowed date, however, it cannot be past the membership expiry date.
If the above checks pass, then the INSERT statement is allowed to proceed, and the OnLoan
value in the holding table is also updated (+1).

Task 3
In this task, you will write a procedure called ListOverdueBooks which takes a member ID and lists all the books borrowed by the member whose return is overdue. Furthermore, if the number of such overdue books exceeds a threshold number (say 2 in this case to make it simple) the member is suspended from borrowing books until further notice by SL.
Note that the procedure needs to be implemented using a cursor FOR LOOP.

Task 4

This task involves testing the code developed in Tasks 2 & 3.

First you are required to test the programs you wrote against the sample data provided. The tests to be carried out, in the order given, is provided in the supplied file: test_script.sql. These tests constitute a minimal test against a very small number of records. Look at this file carefully to understand what is being tested and what should be the expected result. Note the roles of setting autocommit off and the rollback statements.

Next you carry out a more extensive test by testing the programs against a larger set of records that are designed to easily expose any flaws in your programs. You do that by deleting records, adding records, or modifying the records in other ways, and then calling different procedures. You accordingly modify the file test_script.sql, and save it as
<yourLastname_yourFirstname>_test_script.sql, and submit among other files.

3 Report Specification
You will also prepare and submit a report (in the PDF format). A word file template for this purpose will be provided which you will complete, convert to pdf, and submit. The file you submit would be named: <yourLastname_yourFirstname>_report.pdf.
Your report should have the following sections:

1. Initial State of the database. Paste to the word file the screen shots showing the provided sample data in the tables.

2. Stored Programs. Paste into this section the programs you wrote (the sql file
<yourLastname_yourFirstname>_programs.sql that you prepared).

3. Required Testing against Sample Database. Paste into this section the initial tests you ran (one by one) and then the corresponding results as screenshots. The provided script file lists what tests to run, how, and in which order.

4. More Extensive Testing. Explain what sort of changes you are going to make to which tables, what tests you are going to run, and why. Copy and paste from your file
<yourLastname_yourFirstname>_test_script.sql the DML statements you used to modify the tables followed by the screenshots of the records in those tables; then copy and paste the procedure calls you made, and the screenshots of the records in the relevant tables (or the error messages).

5. Notes (optional). In this optional section, you might wish to note anything, such as whether you faced any particular difficulty in completing any of these tasks, the nature and extent of any help you received from anyone, and why.
Remember to convert this file to pdf and submit only the pdf file.

Attachment:- Database Programming and Implementation.rar

Reference no: EM132667076

Questions Cloud

Focus on the issuance of engineering : Detailed design in which you focus on the issuance of engineering documents leading to the manufacturing of one piece of equipment. For example the reactor
How the outcomes of one system level effect the other level : Describe the selected problem from two of the three systems levels (micro-, meso-, and macro). Explain how the outcomes of one system level effect the other.
Compute the fixed amount of the production cost : Compute the total production cost using 17, 500 machine hours. Compute the fixed amount of the production cost. Compute the variable rate per machine hour
BSBPMG522 Undertake Project Work Assignment : BSBPMG522 Undertake Project Work Assignment Help and Solution - Newton College, Australia - Assessment Writing Service
Write a procedure called listoverduebooks : Write a BEFORE INSERT trigger called TR_BORROWING which fires when a member wishes to borrow a book from a branch (that is, when a new row is to be inserted
What do you value most about your learning the week : What do you value most about your learning this week? What else do you need to explore to further grow as a DNP practice scholar?
Find what amount of custodial supplies expense would expect : Find what amount of custodial supplies expense would you expect to be incurred at an occupancy level of 14,800 occupancy-days?
Define archaeology : Define archaeology. How does archaeology inform us of our past? What does it mean to be "transitional" in the evolutionary sense of the word? Discuss examples.
What amount should reported as current liability for deposit : The lessor appropriately classified the lease as an operating lease. What amount should be reported as current liability for deposit?

Reviews

Write a Review

Database Management System Questions & Answers

  How information would enable businesses to accurately scale

vide a real-world example that demonstrates how this information would enable businesses to accurately scale its data processing requirements.

  Answer the given queries in Oracle SQL

BUS-ADM 749 Data and Information Management Assignment, University of Wisconsin-Milwaukee, USA. Answer the following queries in Oracle SQL

  How can i read serialized objects from a database

How can I read and write serialized objects to and from a database? Can a Vector or a Hashtable be serialized and deserialized?

  Design a database - what is the purpose of your database

Design a database, a database planner should spend a considerable amount of time thinking about what kind of information will be included in the database and how it will be organized.

  Create oracle database tables

Create Oracle database tables using SQL Data Definition Language (DDL) for each table listed in Project 1. Make sure that entity and referential integrity are enforced by declaring a primary key for each table (these may be composite keys) and dec..

  Describe the data structure that will store all data element

Provide an Entity Relationship Model (ERM) that will describe the data structure that will store all data elements. Note: The graphically depicted solution is not included in the required page length.

  Develop a use-case description for each major use case

Advanced Business Systems (ABS) is a consulting and staffing company providing specialized staffing and consulting services to clients in a variety.

  Draw basic entity relationship diagram

Colleges and universities must draw a clear connection between the requirements of the field for which the student is being prepared and the things required of the student as part of that preparation process.

  Analyse and comprehend a provided er diagram

Analyse and comprehend a provided ER diagram and Database Schema and mplement a database based on the provided ER diagram and Database Schema

  Would you consider implementing an erp system

When you started your small business, you managed all business processes on your own. Now, your business is expanding and you have hired employees to help.

  Draw an er diagram for database scenario

Draw an ER diagram for database scenario. Design a set of 3NF tables for your database scenario.

  Explain the impact of databases on businesses

Explain the impact of databases on businesses. What industry has databases made possible? Give examples of database supported business applications or technology.

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