0% found this document useful (0 votes)
7 views34 pages

Database Final Assignment

This document provides an overview of key concepts related to database management including: - It defines what a database is and the purpose of a database management system (DBMS). - It discusses the disadvantages of file-based data storage systems and how databases address these issues. - It introduces concepts like entity-relationship diagrams, normalization, and the different forms of normalization (1NF, 2NF, 3NF). - It provides examples to illustrate the different forms of normalization and how they reduce data redundancy and dependencies in a database.

Uploaded by

budhah282
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views34 pages

Database Final Assignment

This document provides an overview of key concepts related to database management including: - It defines what a database is and the purpose of a database management system (DBMS). - It discusses the disadvantages of file-based data storage systems and how databases address these issues. - It introduces concepts like entity-relationship diagrams, normalization, and the different forms of normalization (1NF, 2NF, 3NF). - It provides examples to illustrate the different forms of normalization and how they reduce data redundancy and dependencies in a database.

Uploaded by

budhah282
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 34

TU Book Store Management

+ INTAKE CODE: NPT1F2309IT


+ Group Members
+ Ayushree Lamichhane NP069661
+ Ashlok Kumar Chaurasiya NP069658
+ Hemraj Budha NP069673
Introduction to
Database
+ A database is a structured collection of
data that is organized and stored in a way
that allows for efficient retrieval,
management, and updating of information.
+ It serves as a central repository for storing
and managing digital information, making
it easier to organize, access, and
manipulate data.
DBMS(Database
Management
System)
+ It is software that provides an
interface for interacting with
databases, allowing users to create,
retrieve, update, and manage data in a
structured and organized manner.
+ The primary purpose of a DBMS is to
facilitate the efficient and secure
storage, retrieval, and manipulation of
data in databases.
Disadvantage of File-
based System
+ Data Redundancy
+ Storage Issue
+ Limited sharing data
+ Security and access control of data
+ An Entity-Relationship Diagram (ERD) shows
ERD(Entity the relationships between entities in a database

Relation Diagram)
graphically.
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.
+ Decrease data redundancy and dependency.
+ One value should be at only one place.
Four Forms of
Normalization

+ UNF( Unnormalized form)


+ 1NF( First Normal Form)
+ 2NF( Second Normal Form)
+ 3NF( Third Normal Form)
UNF ( Unnormalized 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.
Publish Publish Publisher Email Phone
er er Address Manager Mana Manager Phone
Id(PK) ger Address
Id Name Name
P100 Hemraj Lalitpur, hemraj@gm 974570 P100 Prabin Lalitpur, Butwal 9806612801
Bhaktapur ail.com 5226 P101 Ashok Kathmandu, Kailali 9868565007

P101 Ashok Kathmandu, ashok@gam 986856


Butwal il.com 5007

Member Member Member Member Email Phone


Id (PK) First Name Second Address
Name
C120 Ayushree Lamichha Bhaktapur, ayushree@gmail. 9745893412
ne Lalitpur com
C121 Alice Joshi Malaysia, [email protected] 9868233547
France
UNF
Book Title Author Price Quantity Publicatio Delivered
Id (PK) n Status Order Order Quantity
Date Id (PK) Date
B001 Romeo William $ 100 10, 30 19 Jan Delivered 100 22 Feb 14, 12
Juliet Shakespeare 2005 2024
B002 Muna Laxmi Rs 150 20, 40 20 Jan Delivered 101 25 Feb 15
Madan Prasad 2015 2024
Devkota

Invoic Quantit Receip Total


Feedbac Comment Rating e y ts Payment
k Id (PK) Id
Id (PK) 1001 13,12 2001 20000,
F001 Satisfied 8, 5 1000
F002 Neutral, satisfied 5 1002 14 2002 40000
1NF ( First Normal Form)
+ There should be a single cell in each table cell.
+ Each row must be unique.

Publisher Publisher Publisher Email Phone


Id Name Address
P100 Hemraj Lalitpur [email protected] 9745705226

P100 Hemraj Bhaktapur [email protected] 9745705226

P101 Ashok Kathmandu [email protected] 9868565007

P101 Ashok Butwal [email protected] 9868565007


1NF
Member Member Member Member Email Phone
Id (PK) First Second Address
Name Name
C120 Ayushree Lamichhan Bhaktapur [email protected] 9745893412
e om
C120 Ayushree Lamichhan Lalitpur [email protected] 9745893412
e om
C121 Alice Joshi Malaysia [email protected] 9868233547

C121 Alice Joshi France [email protected] 9868233547

Manager Manager Manager Phone


Id(PK) Name Address

P100 Prabin Lalitpur 9806612801

P101 Ashok Kathmandu 9868565007


1NF
Book Title Author Price Quantity Publicatio Delivered
Id (PK) n Status Feedbac Comme Ratin
Date k nt g
B001 Romeo William $ 100 10 19 Jan Delivered Id (PK)
Juliet Shakespeare 2005 F001 Satisfied 8
B001 Romeo William $ 100 30 19 Jan Delivered
F002 Neutral 5
Juliet Shakespeare 2005
B002 Muna Laxmi Rs 150 20 20 Jan Delivered
Madan Prasad 2015
Devkota

Order Order Quantity


Id (PK) Date
100 22 Feb 2024 14
100 22 Feb 2024 12
101 25 Feb 2024 15
2NF( Second Normal Form)

Should be in 1NF.
The primary key is the only functional dependency of all non-key attributes.
All tables are already described in 1NF. So, we will show the only relation tables.

Order Order Quantit Book Publish Feedbac Comment Ratin Book Members
Id (PK) Date y Id (FK) er k g Id Id (FK)
Id (FK) Id (PK) (FK)
100 22 Feb 14 B001 P100 F001 Satisfied 8 B001 C120
2024
101 25 Feb 15 B002 P101 F002 Neutral 5 B002 C121
2024
Receip Total Manag Membe
ts Payme er rs
Id (PK) nt Id (FK) Id (FK)
2001 20000 P100 C120
2002 40000 P101 C121
3NF( Third Normal Form)

Should be in 2NF.
Remove transitive dependencies.
All tables are already described on 1NF and 2NF. We will show only the relation
table.

Feedbac Member Book


Order Membe Book Publish
k s Id (FK)
Id rs Id (FK) er
Id (PK) Id (FK)
(PK) Id (FK) Id (FK)
F001 C120 B001
100 C120 B001 P100
F002 C121 B002
101 C121 B002 P101

Receipts Invoice Member Manager


Id (PK) Id (FK) s Id (FK)
Id (FK)
2001 1001 C120 P100
2002 1002 C121 P101
Database Diagram
Set of Commands/ Instructions.

It is a standard Language that allows


users to create, update, and delete
SQL( Structured tables or databases
Query
It is designed for managing and
Language) manipulating relational databases.

It is widely used in web development


and data analysis.
Two type of SQL

DML(Data DDL ( Data


Manipulation Definition
Language) Language)
DDL ( Data Definition Language)
+ Used to create and modify the structure of the object database.
+ Commands are: Create, Alter, Drop, and Truncate.
+ Create – Create a table in the database.
+ Alter – To modify the structure of the database such as adding,
modifying, and deleting columns.
+ Drop – Delete the table of the database.
+ Truncate – Delete all the records of the table and reset the
serial of the initial value.
DML(Data Manipulation Language)
+ Used to read, store, modify, insert, and delete data in the
database
+ Commands are:
+ Select - Reads data from the table.
+ Insert – Insert data into the table.
+ Update – Update the Existing table into a table.
+ Delete – Delete records from the table.
DDL statement
+ Create publisher table command. Create Customer table command.

+
DDL Statement
Create members tale command. Create Book Store Manager Table
command.
DDL Statement
+ Create Book table Command. Create Order Details command.
DDL Statement
+ Create Cart table command. Create Feedback table
DDL Statement
Create Invoice table Command. Create Receipts Table
DML Question
+ A list of the latest books sent by various publishers based monthly.
DML Question
+ A list of books ordered by store managers from various publishers based on a
monthly basis.
DML Question
+ 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.
DML Question
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.
DML Question
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.
DML Question
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.
DML Question
+ Produce a list of the total number of books for each category of books.
DML Question
+ A list of total books and their total price as added by members in shopping.
DML Question
+ 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.
THANK YOU

You might also like