Database Group Assignment
Database Group Assignment
Title Page..........................................................................................................................................i
1. Introduction..................................................................................................................................1
3.ERD Diagram...............................................................................................................................4
5.Normalization...............................................................................................................................7
7. Data Dictionary..........................................................................................................................13
9. DDL Statements.........................................................................................................................18
ii
11.3 Individual Components (Hemraj Budha NP069673).........................................................27
12. Conclusion...............................................................................................................................29
13.References.................................................................................................................................30
iii
1. Introduction
Tribhuvan University (TU) has initiated a creative endeavor to improve the accessibility and
availability of reading materials for its large student and staff community, in response to the
changing academic landscape and the increasing demand for a varied range of educational
resources. TU is going to be the first to build an online e-Bookstore System, utilizing
contemporary technology to simplify the acquisition and distribution of books and reading
materials, in recognition of the shortcomings of the current book procurement procedure.
The goal of this system is to smoothly combine the ordering of books, inventory control,
customer registration, and online purchasing operations. TU hopes to establish a setting where
instructors, staff, and students can quickly and conveniently access the newest publications and
resources with a few clicks by utilizing digital technology.
The goal is to transform TU's reading landscape, making educational resources more accessible,
diverse, and tailored to the dynamic needs of its academic community.
iv
2. Database and Database management system
2.1 Disadvantages of file-based system
In the file-based system, there are a few drawbacks. In file, many disadvantages have led to the
development and adoption of more advanced database management systems in today's world.
Here are some disadvantages of file-based systems which are very bad for database management
systems.
1) Data redundancy:
Data redundancy is the major problem of file-based systems. data redundancy is defined as the
repetition of the same data in different files. Data redundancy repeats duplicate data across
multiple files, which causes storage problems.
In file-based systems, there is a high chance of data access and control of data by unknown
persons. It is challenging to implement fine-grained access restrictions, making it easier for
unauthorized persons to access or modify data.
4) Storage issue
As the volume of data increases in file-based systems, we need to struggle to store data
efficiently. While storing data in file-based systems we need to create different file names for the
data type.
Sharing data among different users, organizations, or persons is difficult in a file-based system.
In a file-based system, there are too many files which is very hard to share with others due to the
huge amount of data in a single file.
v
2.2 Advantages of Database.
The database provides us many advantages that contribute to efficient and reliable man of data.
Several benefits help us to maintain our data properly in data management. The following points
are the advantages of a database which plays a good role in data management.
1) Data integrity
It is a good feature of the database in this feature database enforces rules and constraints to
ensure the good accuracy of stored data information. This helps to prevent errors and foster trust
in the data.
2) Data security
In the database, we can get good security features which is very useful in database. In this
feature, databases offer robust security features, including access controls, data encryption, etc.
These measures help to protect sensitive information from unauthorized access of data from
unknown persons.
This is a very important thing in a database. It allows users to access data from anywhere at any
time. It allows multiple users to access it at the same time interval. By using this feature, users
can modify data simultaneously while maintaining data consistency through mechanisms like
transactions.
This feature is the fundamental feature of a database. This feature helps to do regular backups of
data to safeguard against data loss due to accidental errors or deletion of data by hardware
failures or unforeseen events. This feature also helps to use data during a crash of the system.
The database provides a centralized and standardized way of managing data. This feature helps
to manage data in a centralized way. With this feature administration, updates, and maintenance
of data is easy to do.
vi
2.3 Advantages of DBMS
1. It is highly designed to handle large amounts of data in a DBMS system. It is easy to
access and recover data needed from any place in the world.
2. There is no chance of data loss or data crash if our system gets down but, in a file,-based
system, every data is in the file if something happens everything gets lost and cannot be
recovered.
3. It is easier to apply access constraints in database systems so that only authorized users
can access the data. Each user has a different set of access thus data is secured from
issues such as identity theft, data leaks, and misuse of data.
Function of DBMS
To keep data for a long time DBMS provides Data backup and recovery options to keep it
safe for future use. It states that in case of data loss, DBMS helps us to recover it if the
system fails and gets crashed, our database can be recovered.
This is another feature that provides us with DBMS to access data by multiuser while in
need. With these features, more than one user can access data from any place at any time
without any problem. It also follows the ACID property, so the database will be
consistent while multiple users are accessing it concurrently.
3.ERD Diagram
An Entity-Relationship Diagram (ERD) shows the relationships between entities in a database
graphically. It is an essential tool for database design, helping to visualize the logical structure
and connections between the database's different parts. Generally, each entity in the diagram
represents a table in the database, and the connections or associations between these tables are
vii
represented by the lines. Understanding the relationships and organization of data entities within
the database is made easier by this visual representation.
Fig: ER Diagram
Entities:
Entities are used to symbolize concepts or real-world objects for which data is kept in a database
in an Entity-Relationship Diagram (ERD). Each entity is represented by a table in the database
and is typically defined by rectangles.
Attributes:
The properties or traits of these entities are indicated by attributes, which are represented in Oval
Shape. For example, attributes for an entity "Members" might be identifiers like MemberId,
Name, Address, Phone and so on.
Relationship:
It shows how different entities are related to one another. In relationship entity rectangles are
connected by lines to represent these associations. There are many different types of
viii
relationships, including one-to-one, one-to-many, and many-to-many, which indicate the
cardinality of the relationship.
Cardinality:
It shows how many instances of one entity are connected to a single instance of another. One-to-
one, one-to-many, and many-to-many cardinality types are common and provide information
about the database's relational structure.
Only individuals affiliated with TU, such as students and staff members, are eligible to
make purchases from the e-bookstore.
Selection:
The e-bookstore provides a wide range of books and materials spanning different genres
and categories.
Its availability is not restricted by physical limitations, unlike conventional bookstores.
Purchasing:
User Accounts:
User Engagement:
Users can rate and review books and materials and provide valuable feedback that
improves the user experience.
ix
This system prioritizes the security and privacy of your personal and financial
information.
Customer service is available to help resolve issues related to purchases, orders, or
accounts.
Content Management:
The e-bookstore works together with publishers and suppliers to ensure they have a
varied and current collection of books.
The inventory is constantly being refreshed to show the latest arrivals of books and
materials.
5.Normalization
It is a technique for arranging data in a database to minimize redundant information and
dependencies. It breaks the large table into smaller ones. It also creates relationships between
tables using the foreign key.
x
5.1 UNF (Unnormalized Normal Form)
It is a simple form that consists of multiple values in a single cell. It doesn’t establish the relation
and stores data in a table randomly. In the above scenario, we normalize the table up to 3NF
starting from this normal form. Let’s go to the example.
xi
Order Order Quantity
Id (PK) Date
100 22 Feb 2024 14, 12
101 25 Feb 2024 15
Table 1. 5: Unnormalized data in order table
xii
Member Member Member Member Email Phone
Id (PK) First Name Second Address
Name
C120 Ayushree Lamichhane Bhaktapur [email protected] 9745893412
C120 Ayushree Lamichhane Lalitpur [email protected] 9745893412
C121 Alice Joshi Malaysia [email protected] 9868233547
xiii
Order Order Quantity Cart Cart Cart
Id (PK) Date Id (PK) Date Quantity
100 22 Feb 2024 14 1C01 23 Feb 2024 4
xiv
5.4 3NF (Third Normal Form)
Should be in 2NF.
Remove transitive dependencies.
Only the primary key should be the basis for non-key attributes.
All tables are already described on 1NF and 2NF. We will show only the relation table.
xv
6. Database Schema / Diagram
7. Data Dictionary
1) Publisher
Publisher Id Varchar (12) Primary key, not This column will hold the primary
null key of the table.
[Name] Varchar (20) Not null This column will hold the name of
the Publisher.
[Address] Varchar (20) Not null This column will hold the address
of the publisher
Email Varchar (20) Null This column will hold the email of
the publisher.
Phone Varchar (20) Not null The column will hold the contact
number of the publisher.
2) Members
xvi
Members Id Varchar (12) Primary key, not null This column will hold the
primary key of the table.
[First Name] Varchar (20) Not null This column will hold the first
Name of the Member.
[Second Name] Varchar (20) Not null This column will hold the second
name of the member.
[Address] Varchar (20) Null This column will hold the address
of the member.
Phone Varchar (20) Not null This column will hold the contact
number of the member.
3) Book
Book Id Varchar (12) Primary key, not This column will hold the
null primary key of the table.
Title Varchar (20) Not null This column will hold the title of
the Book.
Author Varchar (20) Not null This column will hold the author
of the Book.
Price Decimal Not null This column will hold the price
(18,2) of the Book.
Publication Date Not null This column will hold the contact
Date number of the member.
Publisher Id Varchar (12) Foreign key, not null This column will connect another
table Publisher.
4) Category
Category Id Varchar (12) Primary key, not null This column will hold the
primary key of the table.
Category Name Varchar (20) Not null This column will hold the name
of the category.
Book Id Varchar (20) Foreign Key, not This column will connect another
null table Book.
5) Order Details
6) Cart
Cart Id Varchar (12) Primary key, not null This column will hold the
primary key of the table.
Cart Date Date Not null This column will hold the date of
the cart.
Cart Quantity Int Not null This column will hold the
quantity of the cart.
Book Id Varchar (12) Foreign Key, not null This column will connect the
other table Book.
Members Id Varchar (12) Foreign key, not null This column will also connect
the other table Member.
7) Feedback
Name Data Type Constraints Description
Feedback Id Int Identity Primary Key, not null This column will hold the
(1,1) primary key of the table.
Comment Varchar (20) Null This column will allow members
to comment.
Rating Int Null This column will allow members
to provide ratings.
Book Id Varchar (12) Foreign Key, not null This column will connect
another table Book.
Members Id Varchar (12) Foreign key, not null This column will also connect
the other table Member.
8) Invoice
Invoice Id Int Identity Primary Key, not null This column will hold the
xviii
(500,1) primary key of the table.
Invoice date Date Not null This column will hold the
invoice date.
Quantity Int Not Null This column will hold the
quantity of the invoice.
Book Id Varchar (12) Foreign Key, not null This column will connect
another table Book.
Members Id Varchar (12) Foreign key, not null This column will also connect
the other table Members.
Order Id Int Foreign key, not null This column will also connect
the other table Order Details.
9) Receipts
Receipts Id Int Identity Primary Key, not null This column will hold the
(1000,1) primary key of the table.
Total Payment Decimal Not null This column will hold the
(15,2) Payment of the ordered books.
Invoice Id Int Foreign Key, Not Null This column will connect
another table Invoice.
Publisher Id Varchar (12) Foreign Key, not null This column will connect
another table Publisher.
10) Warehouse
Id Int Identity Primary Key, not null This column will hold the
(800,1) primary key of the table.
Quantity Int Not null This column will hold the
Quantity of the Books.
Location Varchar (30) Not Null This column will hold the
location of the warehouse.
Book Id Varchar (12) Foreign Key, not null This column will connect
another table Book.
Manager Id Varchar (12) Foreign Key, not null This column will connect
another table Manager.
11) Customer
xix
Customer Id Varchar (12) Primary Key, not null This column will hold the
primary key of the table.
Customer Varchar (100) Not null This column will hold the name
Name of the Customer.
Customer Varchar (100) Not null This column will hold the email
Email of the Customer.
Registration date Not null This column will hold the
date registration date of the customer.
Mainly, we used two query languages. They are DDL and DML
xx
3. DELETE – Remove the data from the table and don’t initialize the serial number.
4. SELECT – Reads the data from the table.
9. DDL Statements
Create publisher table command.
xxi
xxii
Create Book table Command.
xxiii
Create Feedback table command.
xxiv
Inserting data into the Customer table.
xxv
Inserting data into Warehouse Table.
xxvi
Inserting data into Invoice Table.
xxvii
11. DML Questions
11.1 Individual components (Ayushree Lamichhane NP069661)
A list of the latest books sent by various publishers based monthly.
xxviii
A list of books ordered by store managers from various publishers based on a monthly basis.
Produce a record of invoices for various publishers. The invoice consists of invoice number,
invoice date, publisher’s names & addresses, and total amount to be paid.
xxix
11.3 Individual Components (Ashlok Kumar Chaurasiya NP069658)
A list of all customer's records who are registered members in the TU E-Bookstore. The
record of each member should show the member’s identification number, first name and
last name, address, and contact number.
A list of purchased books that have been delivered to members. The list should show
member identification number, first name and last name, address, contact number, book
serial number, book title, quantity, date.
List of books based on specific categories (e.g. Science Fiction, Romantic, History,
Horror, etc.). The list should show type of book category, book serial number, book title
and quantity.
xxx
11.3 Individual Components (Hemraj Budha NP069673)
Produce a list of the total number of books for each category of books.
xxxi
A list of total books and their total price as added by members in shopping.
Produce a list of books with the number of various feedback for books based on scores
(1-10 which is 0= terrible, 10= masterpiece) rated by members.
xxxii
12. Conclusion
To sum up, Tribhuvan University (TU) has created an e-Bookstore System to address the lack of
reading materials by offering a contemporary platform for books and educational resources
purchases. Purchases made by customers, feedback requests, and book procurement are all
streamlined by this system. Clients are able to add products to their cart, securely process
payments, become members, and access a multitude of resources. The system allows for user
feedback while simultaneously maintaining comprehensive records on books, inventory,
customers, and orders. Through effective administration and better resource access, it is expected
to significantly improve TU's staff and students' educational experience overall.
xxxiii
13.References
Adler, T. (n.d.). Data Dictionary. Retrieved from Scribd:
https://www.scribd.com/document/663109111/Data-Dictionary
Grauer, A. (n.d.). chapter9 database 9629 .pptx . Retrieved from Course Hero:
https://www.coursehero.com/file/41947348/chapter9-database-9629pptx/?cv=1
xxxiv