In this assignment you will build a small database to

Assignment Help Database Management System
Reference no: EM13371401

In this assignment you will build a small database to support the needs of a private library company called Libloan. To do this you will need to create tables to support the following scenario.

Libloan is a small library company that lends books to customers. Customers may borrow books for a period of 5 days and pay fees to hire the books of between one and five pounds depending on the book. The start date of each hiring of a book, and the borrower are recorded. Customer names, gender, telephone numbers, and address need to be recorded. Each time a customer borrows a copy they will give an opinion of the book (the evaluation is a number from 0 to 5). Libloan need to record the evaluation of each book by customers who borrow it. It is not a requirement that all books recorded on the system have copies in the library and it is also not required that they are actually borrowed. Neither is it required that every customer has to have borrowed a book. In order to cater for demand, the library stocks multiple copies of books in different locations (towns) as appropriate.

1. Design an Entity model and construct a set of tables with suitably defined columns to support this scenario. 

2. Populate the tables with appropriate test data, bearing in mind the following :

a. There may be some books that have yet to be borrowed.
b. There may be some customers who have yet to borrow a book.
c. All copies of books are uniquely identified by a single key column called copy_id
d. Loan records are identified by a combination of foreign key columns (not by a single column surrogate key)

3. Create appropriate primary and foreign key constraints on the tables.

4. Develop a set of queries as follows :

a. Find details of all books stocked in London

b. Find the book that has the most copies.

c. Find the total number of hirings of each book.

d. Show details of the books with the total revenue that they each generate based on the hirings of copies of those books.

e. Show details of customer names and the titles of the books that they have borrowed

f. Write and test a query to list the title and purchase price of each book. Add a column that compares the cost of the book to the average cost i.e., shows the difference between the book cost and the average cost of all books.

g. List all customers who have not hired a book located in York.

h. Find the copies of books that have their number of hirings below
the average hirings for copies of that book.

i. Write and test a query to list the customer ID and name of every
Customer along with the books that they have hired within the past 200 days. Include starting date, ending date, and location name for those hirings. All customer details (ID and name) should be included in the output, whether or not they have actually borrowed any books.

j. Find names of all female customers who have borrowed a book
in 2005.

5. Develop a view that shows details of all books on record, along with the details of their copies. Include books for which there are presently no copies in the library. Display the contents of the view.

Test the view to show its ability to support DML activity. This should include examples of :

i Separate updates on each individual column within the view
ii Inserts of new rows into the view
iii Deletes of rows from the view

Comment on the outcomes with respect to the ‘updatability' of the view

Hint : You may wish to rollback any changes you have made to the data in order to obtain a consistent set of test data ready for question 6.

6. Create triggers that enforce the following business rules :

a Ensure that copies of books stored in London cannot be
borrowed during December.

b If a customer gives a zero evaluation, the details of their hiring (customer name, which book, the date of hiring, location of the copy and evaluation) must be placed in an audit table.

Hint: You will need to construct an audit table with the appropriate columns of correct datatype.

c Ensure that records cannot be deleted from the loan table if the start_date of the loan is earlier than the current date.

Test all of your triggers with statements that fire the trigger. Show the trigger code and the output that they generate Discuss their behaviour in your tests.

Reference no: EM13371401

Questions Cloud

Sas is a leading business analytics software company that : sas is a leading business analytics software company that consistently ranks well in fortune magazines best places to
1 you need to select a different topic topics should be : 1. you need to select a different topic. topics should be sufficiently specific avoiding general topics such as
Question 1 over 90 of the nations school districts : question 1 over 90 of the nations school districts according to a recent research published in the journal of education
1 the following equations characterize the goods : 1. the following equations characterize the goods market in an open economy c 600
In this assignment you will build a small database to : in this assignment you will build a small database to support the needs of a private library company called libloan. to
Question 1write a perl subroutine for temperature : question 1write a perl subroutine for temperature conversion named converttemp. it should be able to handle both
1customers perceptions of what they get for what they have : 1.customers perceptions of what they get for what they have to give up is referred to as customer
You are expected to complete a project related to : you are expected to complete a project related to inferential statistics. the project must contain the following
1 math is a rectangle dh htthe area of triangle dht is : 1. math is a rectangle. dh ht.the area of triangle dht is 8 .the area of triangle aht is 3 .what is the area of

Reviews

Write a Review

Database Management System Questions & Answers

  Demodulator circuits and amplitude modulator

Explain how much the modulating signal power is required to generate 100 percent modulation? What is the approximate center frequency of filter required to pass the lower sideband?

  Create a table for patients with information

Create a table (by your own imagination) which comprises the least 25 patients with next information (columns): Calculate average of Value1 for each Gender.

  Draw the er diagram using industral-style notations

Each department is described by a name, department code, office number, office phone, and college. Both name and code have unique values for each department.

  Designing and documenting your system

Create a document named: surnameStudentIDAssign1.doc .  In your document, you must include the following section headings:  System Overview, Class Diagram, Class Descriptions, Testing.

  Diagram and determine the possible iterative steps

Determine the steps in the development of an effective Entity Relationship Model (ERM) Diagram and determine the possible iterative steps / factors that one must consider in this process with consideration of the HR core functions and responsibili..

  How to change content in order for new list

To what kind of list would you change it? What would you require to change about content in order for new list type to be effective for purpose of list?

  Coastal seafoodcoastal seafood is a family-owned business

coastal seafoodcoastal seafood is a family-owned business that operates on the east coast. the company already uses

  Find names of students who have higher gpa from table

List the students ID, name, GPA, and course Number such that all students have GPA greater than 3 . 5 and enrolled in a course in Jan 1, 2011. Find the names of all students who have GPA greater than 3.

  describe capability of Good Eat Enterprise Resource Planning

This system will also provide administrators with the ability to create custom reports and filter data based upon a wide variety of information captured from each store.

  Design and develop an it help desk system

The system has to be Web-based system using Design interface of the system using visual basic.

  Worst-case performance of the fifo

Construct a scenario leading to the worst-case performance of the FIFO buffer replacement policy - determine if it is conflict serializable or not

  Determine functional dependencies of table

Using your knowledge of Premiere Products, determine the functional dependencies that exist in the following table.

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