A library database

The problem

Design and build the database for a small library: members, books, copies, loans and fines, with the queries the librarians need every day.

Requirements

Technologies

Step by step

  1. List the entities and their attributes, and draw the ER model with cardinalities.
  2. Turn the model into CREATE TABLE statements with keys and constraints.
  3. Check each table against 1NF, 2NF and 3NF, and fix any problem.
  4. Insert realistic sample data, including a member with no loans and a book with no copies out.
  5. Write the everyday queries, checking each result by hand on the sample data.
  6. Create the view, and write the return-and-fine transaction.
  7. Add indexes for the searches that are run most often, and check the query plans.

Expected result

A working library database with its design, sample data and the queries the librarians need.

How it is evaluated

Ways to improve it