You are on page 1of 4

ASSIGNMENT A004

Library Database

The librarian of a small towns library wants a database for the library that will help it to keep track of its
collections (e.g. fiction, non-fiction, and journals), the books or items in those collections, the physical location
in the library of these collections, the members of the library and the books they borrow from the various
collections.

The database must keep track of which book or item belongs to which collection, which collection is located
where in the library, and which members borrowed books or items from which collections.

Library members and library staff (users) must be able to login to the database to use it to locate books, and the
database must keep track of user logins/ logouts. In addition, users must have different levels of access, which
will determine their access to different parts of the database.

1. List the entities of the Scenario.

LibraryMember
LibraryStaff
Books
Collection
Location
Borrow
Access

2. Assign attributes to each of the entities listed in part 1 above. State any assumptions
you make regarding the clients needs.

LibraryMember LibraryStaff Books Borrow Collection Access Location


MemberID StaffID BookID BorrowID Collection_ID AccessID LocationID
Fname Fname ISBN BookID Name Position LocName
Lname Lname Title MemberID LocationID
Email Email Author StaffID
Phone Phone Collection_ID IssueDate
Password Password Quantity ReturnedDate
Address1 Address1 StaffID Status(A,I,D,L)
Address2 Address2
City City
State State
Country Country
ZipCode ZipCode
Created_Date Created_Date
Deleted_Date Deleted_Date
Status Status
AccessID
3. For each of the entities listed in part 1 above, identify the primary key and other
keys. State any assumptions you make regarding the clients needs.

Primary Key: It uniquely identifies all table records.

Primary Key Table Name


MemberID LibraryMember
StaffID LibraryStaff
BookID Books
BorrowID Borrow
Collection_ID Collection
AccessID Access
LocationID Location

Foreign Key: a foreign key is a field in one table that uniquely identifies a row of another table or
the same table.

Foreign Key Table Name


AccessID LibraryStaff
Collection_ID Books
StaffID Books
LocationID Collection
BookID Borrow
MemberID Borrow
StaffID Borrow

4. Use the entities discovered in part 1 above to derive all the unary and binary
relationships between all the pairs of entities. State any assumptions you make
regarding the clients needs.
Database Design of Library management showing Assertions for each relationship, Cardinality between entities.

5. Find the Assertions for each relationship.

Many library members can borrow many books i.e M:N relationship
Many Staff members can issue many books i.e M:N relationship
Many books have many collection i.e M:N relationship
Many collection of books have many locations i.e M:N relationship
Many library staff have many level of access i.e M:N relationship
6. Draw a Detailed ERD.

7. References
i) https://erdplus.com/#/edit-diagram/417517
ii) https://app.quickdatabasediagrams.com/#/schema/ToO82V5Bx0qjaA1mLQT6CQ

ANKIT ARORA
Student ID: 1031672
aarora11@nyit.edu

You might also like