Databasefinal
Databasefinal
Table of Contents
1.0 Database and Database Management System.........................................................................3
2.1 Normalization.......................................................................................................................6
2NF..............................................................................................................................................6
3NF..............................................................................................................................................6
7.0 Conclusion..............................................................................................................................22
9.0 References...............................................................................................................................24
2|Page
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
Everyone at Tribhuvan University (TU) has a problem with the library despite having a large
collection of books and accessing the e-book library is so harsh in this condition. Students are
limited with their small campus library, causing limited resources, and students are being forced
to search for books in shops near the area but now TU is planning to create an e-bookstore to
solve these problems. The e-bookstore will solve the problem of students buying books and other
course materials from many genres, improving the learning and research outcomes of students
and Teachers. To books is choosing a database. A database is a collection of logically connected
information arranged so that it may be readily accessed, maintained, and updated. (Taylor, n.d.) .
There are two types of Databases they are,
1. File-based system.
2. Database Management System (DBMS)
File-based system.
A file system is a program that facilitates the retrieval and maintains small size of data. It is
found in an operating system and is responsible for saving and manipulating information that is
in the memory of the computer, such as a Solid-state drive or flash drive. File systems function
as electronic forms of hardcopy filing systems that handle a wider variety of file types. (Norton,
2021).
File-based systems have So many advantages and it is very famous for storing information, but
they also have disadvantages. The various disadvantages of the file-based system are:
1. Data redundancy refers to the duplication of data. For example, if we are handling data
for a library and a student and student is borrowing two or more books then his record
3|Page
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
will be stored individually, and it will take higher storage need and cause inconsistency
of data.
2. Data inconsistency: Data redundancy makes data inconsistency. For example, if the
availability status of a bookstore in different file locations and not updated daily, it will
lead to inconsistent information about the book and whether it is available for borrowing
or not.
3. Data Isolation: Data spread in different, and files can be in different formats, so making
new application programs to find the proper data will be tough.
4. Atomicity problem: Atomicity refers to the operation where either all operations must be
successful or none. For example, if a student wants to borrow two books either two books
should be borrowed or neither of them.
5. Data Security is crucial in the library to keep student details and transaction history.
(SINGH, n.d.)
DBMS can manipulate large amounts of data. It has many features such as Security to prevent
breaches and threats, it can backup data in case data gets lost which is not possible in file file-
based system but it is very difficult to operate and requires skilled manpower to manipulate data
which becomes expensive. (Norton, 2021)
Advantages of DBMS
Database management systems (DBMS) have many advantages over file-based systems. DBMS
enhances data handling by storing it in a centralized location, making it easy for users to access
and manipulate data. So, it minimizes data access issues by improving efficiency and reducing
the time taken to access data. DBMS provides a user-friendly and secure environment for storing
and manipulating information. This enhances security by implementing privacy and security
policies to prevent unauthorized access and information abuse. Security is a top priority for
companies, leading them to invest significantly in safeguarding their data. DBMS consolidates a
wide range of data into a single set, providing insights into business operations and offering a
comprehensive view of the overall business process, including relationships and outcomes across
different sections. DBMS improves decision-making by offering accurate, comprehensive, and
easily accessible data. DBMS provides tools for analysis and reporting, empowering users to
make informed decisions, thereby enhancing business decision-making processes and increasing
profitability. Database management systems (DBMS) enable efficient data retrieval, search, and
manipulation, simplify database maintenance, and use, and provide instant access to stock
4|Page
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
availability information. DBMS enhances end-user productivity by transforming raw data into
usable information, enabling swift and educated decision-making. Adopting a DBMS allows for
efficient data access and analysis, leading to higher productivity and enhanced decision-making
skills in the competitive global market. DBMS delivers a straightforward logical representation
of data. Tasks such as inserting, deleting, or creating files or data are easily done in a DBMS.
Databases are meant to give a simple and clear picture of data to consumers, covering the inner
mechanics of data administration. Developers use advanced methods to improve database
efficiency, whereas users access data through simpler interfaces. (Advantages of Database
Management System, n.d.)
5|Page
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
2.1 Normalization
BookCategoryID BookID
1 1001
2 1002
3 1003
The above-given table is of the Book category. The table is in Unnormalized and also is in 1NF
it is in 1NF because all the values are automatic and there is no repetition of the data.
2NF
1 1001 101
2 1002 102
3 1003 101
The above-given table is in 2NF cause there is the implementation of 1NF and there is transitive
functional dependency
3NF
BookCategoryID BookID
1 1001
2 1002
3 1003
6|Page
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
In the above-given table, it is about 3NF for 3NF there should be 2NF implemented and all non-
prime attributes are non-transitively dependent on the primary key.
BookID CategoryID
1001 101
1002 102
1003 101
In the above-given table, it is about 3NF for 3NF there should be 2NF implemented and all non-
prime attributes are non-transitively dependent on the primary key.
A publisher can publish many books, but a book is published by only one publisher.
A customer can become a member, but a member is associated with only one customer.
A customer can buy many books, and a book can be bought by many customers.
A member manages their shopping cart.
A member provides feedback for one or multiple books.
A book can be included in many orders, but each order consists of only one book.
An order generates one invoice, but an invoice can be generated from multiple orders.
A book can belong to many categories, but each category can contain many books.
7|Page
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
• Entities
• Attributes
• Relationships
• One to One
• One to Many
• Many to Many
8|Page
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
9|Page
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
publishers
Book table
Order table
10 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
Customers Table
Members table
11 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
Invoices table
Feedback table
Categories table
12 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
13 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
14 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
15 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
16 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
17 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
18 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
Question 1
The query chooses only defined columns of the Books database (book ID, title, author, genre,
price, quantity available) and combines them with the Publisher’s dataset to add the publisher
name.
Question 2
This SQL query is to alter the `PublisherID` column of the `Books` table when `BookID` equals
1001 by setting it to 9. The inclusion of a `WHERE` clause makes sure that just that one record
is altered, thereby assuring that other entries in the table will not be unintentionally affected.
Question 3
The “PublisherName” field from the Publishers dataset and the “Title” column from the Books
table are obtained by this SQL query. A match on the PublisherID field between two tables is
what it relies on. All rows of the Publishers table and only matching rows of the Books table are
included since it employs a RIGHT JOIN. For the Title column, if there is no match in the Books
database then null values will be returned
19 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
Question 4
This query pairs material from the 'Books' and 'Publishers' columns using a FULL JOIN on the
'PublisherID' column. It obtains the title of each book and the name of its publisher, presenting
all books and publishers, even if there are no matches.
20 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
Question 5
This obtains the `Title` from the `Books` and `OrderID` from the `Orders`. It joins them using a
`LEFT JOIN`. This displays all `Books` and just matches `Orders` based on `BookID`. If a book
has no matching orders, `OrderID` displays NULL.
21 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
7.0 Conclusion
In conclusion, the introduction of an e-bookstore at Tribhuvan University (TU) could reduce the
present limitations and obstacles experienced by students and staff in terms of access to various
books and learning materials. The e-bookstore will enable quick purchasing of books as well as
feedback about them while comparing various items; therefore, increasing the learning and
research experience at TU. The database system will guarantee that information regarding books,
stock levels, customer details, and orders is handled properly to optimize bookshop operations
which in turn increases customers’ pleasure. Moreover, customer feedback coupled with ratings
would make the bookshop more interactive, consequently offering a nice purchasing experience
to every consumer. Overall, the establishment of an e-bookshop should be a win-win scenario for
the TU community hence creating a way for dynamic and productive venues for study.
22 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
23 | P a g e
CT042-3-1-IDB Introduction to Databases NPT1F2309IT
9.0 References
Norton, K. (2021, may 24). File-Based Data Management System. From Webopedia:
https://www.webopedia.com/definitions/file-management-system/#:~:text=A%20file%2Dbased
%20data%20management%20system%20(also%20called%20a%20file,hard%20disk%20or
%20flash%20drive.
SINGH, C. (n.d.). Advantages and Disadvantages of DBMS: DBMS vs file System. From beginnersbook:
https://beginnersbook.com/2015/04/dbms-vs-file-system/
24 | P a g e