Database Management Systems: J - Component Review-2
Database Management Systems: J - Component Review-2
Database Management Systems: J - Component Review-2
J –COMPONENT
REVIEW-2
DATABASE MANAGEMENT
SYSTEMS
Online Library Management
System
GROUP MEMBERS
Vinit Shahdeo
Shreya Deep Anand
Introduction
Features
• Searching of books
• Issuing and returning books
• Paying fine(if any) online
• Librarian can read information about any member
• Librarian can track the books issued by a particular student
Functional Requirements
● The system must only allow user with valid id and
password to enter the system.
● The user must be able to logout after they finished using
system.
● System must be able to not allow two books having same
book id.
● System must be able to search if book is available or not
before issuing books.
● Admin can be able to see availability of the particular book,
they can also be able to see the each user data (ie. Which
book is issued to which user and the fine amount of the
user)
Data requirements
Entity types
1. BOOK
Strong entity set- book_code is used to identify each entity
uniquely
Book_code,book_name, Author, date_of_purchase, price,
subject_code, rack_no, no_of_books
2. STAFF
Strong entity set- staff_id is used to identify each entity
uniquely
Staff_id, staff_name, dob, address, designation, salary,
date_of_joining,
3. STUDENT
Strong entity type- student_id is used to identify each entity
uniquely
Student_id, name, branch, fine, address, phone_no, issue_date,
expiry_date
4. FACULTY
Strong entity type- f_id is used to identify each entity
uniquely
F_id, name, address, phone_no, department
5. LIBRARIAN
Strong entity type- admin_login is used to identify each
entity uniquely
Admin_login,admin_password
6. AUTHOR
Strong entity type- author_id is used to identify each entity
uniquely
Author_id,author_name, dob, address, experience
7. PERIODICALS
Strong entity type- pr_id is used to identify each entity
uniquely
pr_id, pr_name, month_of_release, publisher_name
Relationships
1. BOOK – STUDENT relationship
It’s a one to many relationship as one book can be issued by
only one student.
This participation is partial from both the side because all the
book cannot be issued and it is also not necessary that all
the students of the library is issuing the book.
2. BOOK – FACULTY relationship
It’s a one to many relationship as one book can be issued by
only one faculty.
This participation is partial from both the side because all the
book cannot be issued and it is also not necessary that all
the faculty is issuing the book.
3. All other relationship is managed by the librarian ie.
managing the other entity types of the library
Entity Relationship (ER) Diagram
Schema
All the entity set used in this entity relationship diagram is
strong so it can be directly reduced into relation schema as
shown in the schema below.
For binary 1: N relationship, relation representing the
participating entity type at N-side of relationship type is
identified. In this relation we include as foreign key the
primary key of relation that represents the other entity
type.
Relation schema
Functional Dependencies: -
{book_code}→{date_of_purchase,book_name,price,rack_no,no_of
_boo ks, subject_code}
{author_id}→{author_name, dob, address, experience}
{staff_id}→{staff_name, DOB, date_of_joining, address, salary,
designation}
{Member_id}→{name, type, address, issue_date, expiry_date,
phone_no, fine}
{faculty}→{name, address, phone_no, department}
{author_id}→{author_name, dob, address, experience}
{book_code,member_id}→{issue_date, return_date}
{book_code,f_id}→{issue_date, return_date}
Normalization: -
ent_id e ess ne_no _date y_date
We have reduced the student table from ER diagram, the given
table is already in the First Normal Form since all the
attributes is single valued. All the attributes of the student
table are atomic.
Since the above table is already in the first normal form and
there is no chance of partial dependency on the key
attribute because it has only one key attribute so above
table is in second normal form
Closure of the attribute set
F={student_id→ name, student_id→ type, student_id→ address,
student_id→ fine, student_id→ phone_number, student_id→
issue_date, student_id→ expiry_date}
Student_id+ ={name, type, address, fine, phone_number,
issue_date, expiry_date}
Transitive Dependency
A transitive dependency can occur only in a relation that has
three
or more attributes. Let A, B, and C designate three distinct
attributes
(or distinct collections of attributes) in the relation.
● No non-prime attribute is transitively dependent on prime
key
attribute.
● For any non-trivial functional dependency, X → A, then
either −
● X is a superkey or,
● A is prime attribute.
Since there is no transitive dependency, the table is already in
Third
Normal Form
Boyde - Codd Normal Form
Since there is only one key attribute and key attribute is not
dependent on the non key attribute thus we can say that
the above table is in BCNF
2. Faculty (f_id,name, p
hone no, department, address)
The table is in BCNF. Due to the reason that f_id is the only
candidate
key and all others are non-key attributes thus table is in 2NF. No
non-key dependencies, hence in 3NF. One candidate key,
so in BCNF
3. BOOK (book_code, book_name, subject_code, no_of_books,
rack_no, price, Date_of_purchase)
The table is in BCNF. Due to the reason that book_code is the
only candidate key and all others are non-key attributes
thus table is in 2NF. No non-key dependencies, hence in
3NF. One candidate key, so in BCNF
4. STAFF (staff_id, staff_name, staff_name, address,
date_of_joining, salary, designation)
The table is in BCNF. Due to the reason that staff_id is the only
candidate key and all others are non-key attributes thus
table is in 2NF. No non-key dependencies, hence in 3NF.
One candidate key, so in BCNF
5. PERIODICALS (pr_id, pr_name, month_of_release,
publisher_name)
The table is in BCNF. Due to the reason that pr_id is the only
candidate key and all others are non-key attributes thus
table is in 2NF. No non-key dependencies, hence in 3NF.
One candidate key, so in BCNF
6. LIBRARIAN (admin_login, admin_password)
The table is in BCNF. Due to the reason that pr_id is the only
candidate key and all others are non-key attributes thus
table is in 2NF. No non-key dependencies, hence in 3NF.
One candidate key, so in BCNF
7. AUTHOR (author_id, author_name, dob, address,
experience)
The table is in BCNF. Due to the reason that author_id is the
only candidate key and all others are non-key attributes
thus table is in 2NF. No non-key dependencies, hence in
3NF. One candidate key, so in BCNF
8. issued_by_stu (student_id, book_code, issue_date,
return_date)
The table is in BCNF. Due to the reason each attribute is atomic.
Issue_date and return_date is dependent on the
student_id and book_code and no partial dependency
exists so the table is in second normal form. No transitive
dependency exists in this table so it is in third normal form.
And none of the non- key attribute is dependent on the
key attribute so the above table is in BCNF.
9. issued_by_fac (f_id, book_code, issue_date, return_date)
The table is in BCNF. Due to the reason each attribute is atomic.
Issue_date and return_date is dependent on the f_id and
book_code and no partial dependency exists so the table is
in second normal form. No transitive dependency exists in
this table so it is in third normal form. And none of the non-
key attribute is dependent on the key attribute so the
above table is in BCNF.