Database server management

Assignment Help Database Management System
Reference no: EM1383996

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: EM1383996

Questions Cloud

Freeway capacity and los : A four-lane freeway (two lanes in each direction) is on mountainous terrain with 11ft lanes, a 5ft right-side shoulder, interchange spacing of one every 10 miles, and a 60mph base free-flow speed.
Analyzing the scenarios : A particular species of mouse feeds on the seeds of a single species of cherry tree. When the mice eat a seed, they digest it completely.
Plot transition from tangent to full superelevated section : The superelevation rate is 0.084. Prepare a plot showing the ordinates required for the transition from the tangent section to the full superelevated section, assuming that the pavement width is 7.3 m wide. Make any necessary assumptions.
Determine which animal have highest oxygen consumption : A beetle (0.06g), a gorilla (200kg), a gecko (5g) and a hedgehog (5g) are all kept individually in 5x5m rooms that are maintained at a constant temperature of 25 C.
Database server management : Design an Entity model and construct a set of tables with suitably defined columns to support this scenario and find details of all books stocked in London
Write the program to sustain person-s savings : Write down the program to sustain the person's Savings and Checking accounts. Program must keep track of and show balances in both accounts, and sustain a list of transactions.
Determine the cycle time for a single engine scraper : Determine the cycle time for a single engine scraper rated at 21 cy heaped that is used to haul material from a pit to a fill 900 ft away under severe conditions. The average haul speed will be 14 mph and the average return speed will be 20 mph.
Determine fraction of the offspring : Suppose that in rats, grey fur (T) is dominant to tan (t). If you mate a tan rat with a homozygous dominant rat, Determine what fraction of the offspring will be homozygous?
Percent of particles retained in the clarifier : If the settling velocity of a particle is 2.89 mm/s and the overflow rate of an upflow clarifier is 0.560 cm/s, what percent of the particles are retained in the clarifier?

Reviews

Write a Review

Database Management System Questions & Answers

  Developing a database

You have been asked to develop a database utilizing only the written problem description given by the client. In reviewing the description.

  What is the two-phase locking protocol

What is the two-phase locking protocol and what is the strict two-phase locking protocol? What is the rigorous two-phase locking protocol? What benefit does strict two-phase locking protocol provide? What benefit does rigorous two-phase locking pr..

  How to use traditional database design method

Explain how you would follow three phases of traditional database design method (Hierarchical, Network, and Relational), considering the following scenario.

  Create state transition diagram to describes student states

Create a state transition diagram that describes typical student states and how they change based on specific actions and events.

  Same name to attributes which are in different tables

What about giving same name to attributes which are in different tables but are not same? For instance, "Description" in both a Course table and a Classroom table.

  Create database management system for bike shop

Your job is to create a database management system for bike shop who ‘buys' and ‘sells' new and second-hand bikes, and also parts of bike. Bike is constructed with parts while part can be fitted to different bikes.

  Selecting opies of book titled the big magic

How many copies of the book titled „The big magic? are owned by the local library whose name is "Newtown" library?

  Draw an er diagram for database scenario

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

  Criteria selecting a life-cycle model for the project

What criteria would you use in selecting a life-cycle model for the project?

  Write set of relational schemas-identify primary-foreign key

Sketch an E-R diagram which reflects the above reuirements. Write a set of relational schemas and identify primary and foreign keys. Try not to include redundant schemas.

  Evaluate a dbms in terms of lock granularity

Suppose you are asked to evaluate a DBMS in terms of lock granularity and the different locking levels. Create a simple database environment in which these features would be important.

  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.

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