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

  Application important part of security model for databases

Using Internet as the research tool for extra information not presented in text, describe why application roles are important part of the security model for databases.

  Create 3 rows of data for each table ensuring

Write SELECT statements for the following (include a screenshot of the SQL and its execution, including the resulting data).

  Build a gantt chart using microsoft project

Discuss what it will take to build a Web architecture, move an existing Website with minimal downtime, and provide a disaster recovery solution to ensure the site is always available.

  Design er schema to keep track of information of votes

Design an er schema for keeping track of information about votes taken in the U.S. House of Representatives during the current two year congressional session.

  Implement a series of queries on the database

As a way to demonstrate success, you are to implement a series of queries on the database to reflect the business logic of Best Home real estate.

  Define set of relational schemas and identify primary keys

We want to construct a database for a world-wide package delivery company. Define a set of relational schemas and identify primary and foreign keys. Try not to include redundant schemas.

  Write sql select statements to retrieve

How many models of the Titanic have been shipped? What was the date of the first shipment and when was the last shipment sent - Write SQL SELECT statements to retrieve

  Benefits and current trends of data warehousing

Explain the benefits and current trends of data warehousing and data mining and provide two (2) examples of quality companies successfully using a data warehouse to support your answer.

  Write procedures using counter and sychronisation techniques

Write the following procedures: woman_wants_to_enter, man_wants_to_enter, woman_leaves, man_leaves, using counters and sychronisation techniques to ensure that the correct behaviour will occur.

  Explain techniques for distributed data placement

Create a diagram using Visio, Microsoft Paint, or other graphical creation utility of your choosing to illustrate the diagrams supporting your conclusion. Note: The graphically depicted solution is not included in the required page length.

  How to connect to the oracle database

Instructions: You can use any source you prefer, the text, Internet, etc. The answers should not take more than 1 - 2 paragraphs of text, please submit a word processing document, please make sure it's compatible with MS Word.

  Explain use of sequential file over database

Explain these situations. When would the database be more beneficial than sequential file? Is it possible for two kinds of permanent storage to be used interchangeably?

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