The document describes the development of an integrated library system using both SQL and NoSQL databases. Key aspects include:
- Creating an ORM diagram and generating SQL code to implement relational tables in MSSQL for entities like Library, Books, Authors etc. and inserting sample data.
- Developing the NoSQL component using Couchbase, creating buckets for Library and Librarian, indexing, inserting data and creating a dataset.
- Performing joins on nested documents by linking the library address field across tables.
The system allows tracking borrower and book details to manage library operations using both SQL and NoSQL for comparative analysis.
Advanced Database Management System for Integrated Library System
1. IFT 530 – Advanced Database Management System
INTEGRATED LIBRARY SYSTEM
Kurada Sai Bhuvana
1224272946
Professor: Robert Rucker
Due Date: 4th
December 2022
2. SECTION 0:
Summary:
As an idea for the project, I chose the Integrated Library System. It makes it easy to enter book
inventory and get information about books available in the library, book transactions, and book
owners.
This system allows borrowers to see the number of books and books in the library. Borrowers who
are members are given a unique identifiable ID. The Integrated Library System has the following
main features: author and publisher.
• Create user records containing member and non-member information along with data about
librarians. The entities in the model are Libraries, Librarians, Books, Borrowers, Authors, and
Publishers.
The ORM model:
3. SECTION 1:
1. Introduction:
A library is a place where all kinds of books are available in paperback or digital form. Today, an
institution's library is not only responsible for maintaining a database of books, but must also
maintain a database of all students, and faculty and non-faculty members of the institution. When
did you borrow the book and when should you return it?
In the past, all these records and databases were maintained manually, so an integrated library
system was chosen as the project idea. The biggest problem with manual record keeping is that it
is unreliable and takes a lot of time and effort to keep track of the books. Nor was it possible to
keep track of all published and returned books and make them available centrally.
Digital Integrated Library Systems ensure no data redundancy and minimize the level of error that
exists in manually maintained database systems.
The integrated library system which I am developing will enable a complete digital library service
by ensuring that only authorized users can access the system. This makes it easier to enter your
book inventory and get information about library availability, book transactions, and book owners.
This system allows borrowers to check out the number of books they have in the library. This
system provides separate views for librarians and borrowers. A borrower with a membership is
given a unique identifiable ID.
The importance of LMS is that it will help the public and university libraries to easily maintain the
records for the borrowers/students as well as the books. This will also help track a book which is
been already issued. Also, for instance, as ASU has multiple libraries this will help maintain a
centralized record which will be helpful for students as well to check which library has the desired
book.
4. Integrated Library System has the following major functions:
• Add or remove books from your book inventory
• Track and calculate book loan and return dates
• Include information such as quantity of books, information about books, by book type, and where
books are located and Maintain an inventory of each book
• Marinate transaction records for published books.
• Create a user record that includes information for both member users and guest users.
A model (blueprint) is created to specify how data is stored, arranged, and manipulated in the
database. This design considers where the data is stored, how the data is categorized, and how the
data in the various tables in the database interact.
2. Context:
A library is a collection of information sources. These related materials have created a distinct
community of readers, students, and others who can more easily access and borrow books.
Find books and access journals quickly with the Library Database Management System. Library
automation systems automate standard library procedures to reduce the workload of library staff.
Ensures consistency and high quality of recordings. The information industry has grown as
individuals have come to appreciate information more, and technology has changed the
expectations of library users. It offers libraries both opportunities and responsibilities.
The Integrated Library System is used to manage more complex tasks, allowing librarians to
manage library resources more efficiently, saving time and effort.
An integrated library system helps librarians and library users work more efficiently. It also makes
it easier for librarians to catalog books and track published, reissued, and unreturned books.
By adopting a library management system, you can quickly reduce the number of personnel and
employees without using paper and store various manual files. It also reduces the number of
manual files by allowing a large amount of data to be stored on one system.
5. The entities recognized in the Consolidated Integrated Library System project are:
• Librarian: The Librarian entity has the basic employer details
• Name and Staff ID. It shares a many-to-one relationship with the library - a
library can have many librarians, but a librarian can only work with one library.
• Second library: The library unit has a reference name and the address of the
library.
• Borrowers: Borrower entities come in two types, members and non-members,
and have references such as name and ID, which are the basic details that must
be entered to publish a book. . It has a many-to-many relationship with the
library. Many borrowers can borrow from many libraries, and many libraries
can be visited by many borrowers.
• Book: The Book entity has Author Name, Book Name, and Publisher Name,
and is divided into two subtypes:
Fiction and Non-Fiction. It shares many-to-many relationships with the library.
Many libraries can have many books, and many books can belong to many
libraries.
• Publisher: The Publisher entity has attributes such as Publisher ID and
Publisher Name. There is a one-to-many relationship with books. For each book
he can only have one publisher, but one publisher can publish many books.
• Author: The Author entity has two attributes of him, such as author name. There
are male and female authors. There is a many-to-many relationship with books.
Many authors can publish many books and vice versa.
Databases implemented in the project:
• LMS is implemented using SQL and NoSQL databases (MSSQL and Couchbase respectively).
• MSSQL is a relational database developed by Microsoft and created for its primary ability to
store and retrieve data in a table-based structure.
• Couchbase is a document-oriented, distributed NoSQL database that uses JSON documents in a
key-value structure to store and retrieve data.
6. • The SQL implementation creates a table for the above entity and runs multiple queries using SQL
on the inserted data and adds constraints to retrieve the stored data.
• NoSQL implementation extends the same entity to create a bucket and insert data in JSON
format. Queries are written in SQL++ (N1QL for Couchbase) to retrieve, insert, and update data.
• Also analyze the functional differences between SQL databases and his NoSQL databases to
understand the advantages of each.
3. Queries which SQL database is answering:
7.
8.
9. • To show the values of the Books table where book name is Harry Potter –
Select * from Schema1.Books
where booksName='Harry Potter'
14. publisherId nvarchar(max) NOT NULL,
CONSTRAINT Publisher_PK PRIMARY KEY(publisherName),
CONSTRAINT Publisher_UC UNIQUE(publisherId)
)
GO
CREATE TABLE Schema1.BorrowerReturnsBooksOnDate
(
booksName nvarchar(max) NOT NULL,
borrowerId int NOT NULL,
“date” nvarchar(max) NOT NULL,
17. authorName nvarchar(max) NOT NULL,
booksName nvarchar(max) NOT NULL,
CONSTRAINT BooksIsAuthoredByAuthor_PK PRIMARY KEY(booksName,
authorName)
)
GO
CREATE TABLE Schema1.”LibraryLendsTo/VisitsBorrower”
(
borrowerId int NOT NULL,
libraryName nvarchar(max) NOT NULL,
CONSTRAINT “LibraryLendsTo/VisitsBorrower_PK” PRIMARY KEY(borrowerId,
libraryName)
)
GO
18. ALTER TABLE Schema1.BorrowerBorrowsBooksOnDate ADD CONSTRAINT
BorrowerBorrowsBooksOnDate_FK1 FOREIGN KEY (borrowerId) REFERENCES
Schema1.Borrower (borrowerId) ON DELETE NO ACTION ON UPDATE NO ACTION
GO
19. GO
ALTER TABLE Schema1.FemaleAuthor ADD CONSTRAINT FemaleAuthor_FK FOREIGN
KEY (femaleAuthorName) REFERENCES Schema1.Author (authorName) ON DELETE NO
ACTION ON UPDATE NO ACTION
GO
20. ALTER TABLE Schema1.NonMember ADD CONSTRAINT NonMember_FK FOREIGN KEY
(nonMemberId) REFERENCES Schema1.Borrower (borrowerId) ON DELETE NO ACTION ON
UPDATE NO ACTION
GO
ALTER TABLE Schema1.BooksIsAuthoredByAuthor ADD CONSTRAINT
BooksIsAuthoredByAuthor_FK1 FOREIGN KEY (booksName) REFERENCES Schema1.Books
(booksName) ON DELETE NO ACTION ON UPDATE NO ACTION
GO
21. GO
ALTER TABLE Schema1.LibraryHasBooks ADD CONSTRAINT LibraryHasBooks_FK2
FOREIGN KEY (booksName) REFERENCES Schema1.Books (booksName) ON DELETE NO
ACTION ON UPDATE NO ACTION
GO
GO
23. Adding table and column constraints –
I used UNIQUE and NOT NULL constraints to satisfy the table and column constraints
respectively, as implemented in the following query.
24. Adding Foreign key constraints –
I have created two foreign key constraints that meet my requirements as implemented in the query
below.
25. Using DML commands, inserting at least 5 values in the table –
• Values inserted in Author table
• Values entered in Books table
26. • Values entered in Borrower table,
• Values entered in Publisher table
27. • Values entered in Library table
• Values entered in Librarian table
28. • Showing the books table whose book name is Harry Potter
Using DML commands, showing values in the table inserted
• BOOKS TABLE
37. SECTION 5.1
Queries executed while developing the Integrated Library System :--
1. Create table
2. Alter table and add constraint
3. Insert values in table
40. SECTION 6:
COUCHBASE(NOSQL) configuration
I have configured the couchbase server and its quick for use.
Recorddatabases, graphdatabases, keyvalue pairs, and large column stores are all instances of
NoSQL or non-relational databases. A NoSQL database does not require a specific schema. So
you have more freedom to work with "unstructured data".
NoSQL databases are designed to manage the more complex and unstructured data (text, social
media posts, images, videos, emails, etc.) that make up part of today's data. N1QL organizes data
into keyspaces. This is a huge collection of free-form text. By embedding statement attributes in
the intended result object structure, N1QL enables data transformation.
NoSQL database systems are a compilation of database systems that can store up structured, semi-
structured, unstructured, and polymorphic data.
There are two main options for access.
1. REST API:This refers to sending requests to endpoints connected to a specific function.
2. Vendor Specific Language CRUD (Create, Read, Update, Delete):
41. With Mongo DB you will find that there is a special way to query.
The Couchbase structures are as follows:
• Cluster
• Bucket
• Scope
• Collection
• Document (JSON)
Compared to relational databases, scaling NoSQL databases is much more cost-effective as
capacity can be added horizontally via inexpensive off-the-shelf servers.
42. SECTION 6.1
Entities that extend by nesting are libraries (address fields) and library tables. Connect both entities
to the Library Name field.
53. A. OUTER JOIN on NESTED documents –
The library bucket contains the field “address” consisting of the nested key-value
pairs of city, street and zipcode.
FROM library AS l
LEFT OUTER JOIN librarian AS c ON l.LibraryName = c.LibraryName
SELECT l.address
ORDER BY l.LibraryName
54. SECTION 7:
Summary:
For this project, I followed a conceptual schema design process to create an object role modeling
diagram, from which I derived a relational model view. Then I generated the SQL code and
implemented it in MS SQL using SQL Server Management Studio. I have now created the database
master, Schema Schema1, table Library, Librarian, Author, Books, Publisher, and Borrower and
inserted data into them. Then I added the necessary constraints. Use constraints to impose specific
protocols on your database. Then I implemented a trigger to perform a predefined action after a
certain event occurred. And further also implemented stored procedures to make our SQL code
more reusable.
Next, I developed a NoSQL database using Couchbase and created two buckets:
Library and Librarian. After indexing and inserting data into the query service, I created a dataset
for the bucket and linked the data from the query service to the analytics service.
You ran a SQL++ query against the Analytics service that included creating a JOIN against a
nested document.
In this way, the question posed in the original proposal could be successfully answered by tracking
borrower details and maintaining books with author and publisher details in libraries served by
librarians.
55. Conclusion:
To run this project, I implemented MSSQL and Couchbase to develop SQL and NoSQL databases.
In doing so, I deduced the difference in behavior between SQL and NoSQL.
It turns out that SQL DB’s get table-based data structures with precisely predefined schemas. A
NoSQL database does not involve a specific schema. So you have additional independence to work
with "unstructured data". Running an SQL query returns a set of rows. Each row contains one or
more columns, and each row has the same columns. N1QL, on the other hand, organizes data into
key-value pairs. This is a huge collection of free-form text. By embedding statement attributes in
the intended result object structure, N1QL enables data transformation. SQL uses CRUD
operations in many relational database engines such as MySQL, PostgreSQL, and Microsoft SQL
Server. As for access, queries are written in CRUD syntax, as they are usually raw SQL. NoSQL
uses REST APIs and CRUD operations to access data. NoSQL is horizontally scalable and
RDBMS is vertically scalable.
This can be further extended to her GUI-based application that provides portals to users based on
their access rights.
56. References:
• Wang, Y., & Dawes, T. A. (2012). The next generation integrated library system: a promise
fulfilled?. Information technology and libraries, 31(3), 76-84.
• Yeh, S. T., & Walter, Z. (2016). Critical success factors for integrated library system
implementation in academic libraries: A qualitative study. Information Technology and
libraries, 35(3), 27-42.
• Brown, M. C. (2013). Developing with Couchbase Server: Building Scalable, Flexible
Database-Based Applications. " O'Reilly Media, Inc.".