0% found this document useful (0 votes)
45 views22 pages

DBMS Report

DBMS_REPORT[3][1]

Uploaded by

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

DBMS Report

DBMS_REPORT[3][1]

Uploaded by

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

SCHOOL OF ENGINEERING AND TECHNOLOGY

Project Work Report


On
“Online E – Commerce Website ”
(4CSGC2021 – Database Management System)
B.Tech In Computer Science and Engineering

Submitted By
Karthik Prabhu SR (22BBTCS135)
Khushali Varu (22BBTCS143)

Under the guidance of


Dr Gourish Goudar
Professor,Dept of-DBMS
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CMR University
(Lakeside Campus)

Off Hennur - Bagalur Main Road, Near Kempegowda International Airport,


Chagalahatti, Bengaluru, Karnataka-562149
Academic Year 2023-2024

1
SCHOOL OF ENGINEERING AND TECHNOLOGY
Chagalahatti, Bengaluru, Karnataka-562149
Department of Computer Science and Engineering

CERTIFICATE
Certified that the Project Work entitled “ Online E – commerce Website ”
carried out by Karthik Prabhu SR (22BBTCS135) and Khushali Varu (22BBTCS143)
bonafide students of SCHOOL OF ENGINEERING AND TECHNOLOGY, in
partial fulfillment for the award of BACHELOR OF TECHNOLOGY in Computer
Science and Engineering of CMR UNIVERSITY, Bengaluru for 4CSGC2021 – Database
Management System during the academic year 2023 - 2024. It is certified that all
corrections/suggestions indicated for the Internal Assessment have been incorporated in the
report. The project has been approved as it satisfies the academic requirements in respect of
project work prescribed for the said degree.

Signature of Course In-charge Signature of HOD

…………………… ……………………
Dept. of CSE Dept. of CSE
SoET, CMRU, Bangalore SoET, CMRU, Bangalore

Name of the Examiners: Signature with Date:

1…………………… …...…………………..
2.…………………... ………………………..

2
DECLARATION

We, Karthik Prabhu SR bearing USN 22BBTCS135 and Khushali Varu bearing USN
22BBTCS143 students of Bachelor of Technology, Computer Science and Engineering,
CMR University, Bengaluru, hereby declare that the Project Work entitled “ Online E-
commerce Website” submitted by us, for the award of the Bachelor’s degree in Computer
Science and Engineering to CMR University is a record of bonafide work carried out
independently by us under the supervision and guidance of Dr.Gourish Goudar Professor,
Dept of CSE. CMR University. We further declare that the work reported in this mini
project work has not been submitted and will not be submitted, either in part or in full, for
the award of any other degree in this university or any other institute or University.

Place: Bengaluru Karthik Prabhu SR (22BBTCS135)


date:06/05/2024 Khushali Varu (22BBTCS143)

3
TABLE OF CONTENTS

SR.NO TITLE PAGE


NO.
1. P Problem Statement 5

2. Entity – 6-8
Relationship Model

3. Conversion of er – 9 - 14
diagram to
relational tables

4. Normalization 10 - 15

5. Implementation of 16 - 22
DBMS database in
SQL

4
PROBLEM STATEMENT

For the Database Management System Project we need to design


a database management system for an e – commerce website using
both front – end and backend.
The aim of this project is to design the database for the following
functionalities :

1) User Management – Users can create account and add


various details like name , address , phone no. , password ,
email id , connect their payment card info, etc.

2) Product Management – Customers can view the product


name , product id , price of the product , it’s description
stock availability , etc. They can add or remove products
from the cart and also view the shipment details of the
selected product.

3) Order Management – Customers can view their order details


like the order id’s , the date of order , the quantity for the
order , it’s product id and also the total price for the order.

4) Cart Management – Customers can add or remove items


from the cart as their requirements. It denotes the cart id and
also the quantities selected for the particular order.

5) Transaction Management – Customers can add the payment


method for the transaction during checkout. It contains the
order id , the payment method selected , the date of payment
and the total amount to be paid for the order – items selected.

5
ENTITY RELATIONSHIP MODEL

6
COMPONENTS OF ENTITY RELATIONSHIP MODEL

a. Entity – These are the objects represented in the database depicted


by rectangles. It consists of attributes. The entities in the er
diagram are – customer , shipment , order , order item , product ,
payment , cart , category.
b. Attributes – Attributes determine the characteristics or properties
of the entities represented by an eclipse.
c. Relationships – It represents how different entities are related to
each other denoted by diamond.
d. Cardinality – It is the maximum number of instances of which one
entity is related to the other.
e. Primary key – It is the key that uniquely defines each record in an
entity.
f. Foreign key – It is an attribute or a set of attributes that is related
to the primary key of other table.
g. Weak entity – An entity that cannot be uniquely defined by it’s
attribute alone. Denoted by double rectangle.
h. Composite attribute – An attribute which consists of sub attributes
related to each other.
i. Derived attribute – An attribute whose value is derived from some
other attribute. It is represented by dashed oval.

ENTITIES IN THE E – COMMERCE ER DIAGRAM


➢ Entity : Customer
Arttributes : Address , Phone_no , customer_name , customer_id
, paymentcard_info , email_id , password
Primary key : customer_id
Composite attribute : Address (Street , city , state , pincode)
Multivalued attribute : Phone_no

7
➢ Entity : Cart
Attributes : Cart_id , quantity
Primary key : Cart_id

➢ Entity : Shipment
Attributes : Shipment_id , date , address
Primary key : Shipment_id
Composite attribute : Address (pincode , street , city , state)

➢ Entity : Order
Attributes : Order_id , order_date , total_price
Primary key : Order_id

➢ Entity : Order_item
Attributes : Order_item_id , quantity , price , order_id ,
product_id
Primary key : Order_id
Foreign key : Order_id , Product_id
➢ Entity : Product
Attributes : Category_id , product_id , Product_name ,
description , price , stock
Primary key : Product_id
Foreign key : Category_id

➢ Entity : Cart
Attributes : Cart_id , quantity
Primary key : Cart_id

➢ Entity : Payment
Attributes : Payment_id , Payment_date , Payment_method ,
Amount , Order_id
Primary key : Payment_id
8
CONVERSION OF ER DIAGRAM TO
RELATIONAL TABLES

1) Customer (
Customer_id (primary key) , Customer_name , password , address ,
paymentcard_info , email , phone_no)

2) Cart (
Cart_id (primary key) , quantity)

3) Shipment (
Shipment_id (primary key) , date , address)

4) Category (
Category_id (primary key) , name)

5) OrderTable (
Order_id (primary key) , Order_date , Total_price)

6) Product (
Product_id (primary key) , description , price , stock , Category_id ,
(foreign key))

7) Order_item (
Order_item_id (Primary key) , Quantity , Price , Order_id(foreign
key) , Product_id (foreign key))

8) Payment (
Payment_id (primary key) , Payment_date , payment_method ,
amount , order_id(foreign key))

9
NORMALIZATION
I NF (First Normal Form) : It ensures that each attribute in the relation contains atomic values
i.e. no repeating values.
II NF (Second Normal Form) : The relation must be in 1NF and should not contain any partial
dependencies.
III NF (Third Normal Form) : The relation must be in 2NF and should not contain any transitive
dependencies.
BCNF (Boyce – codd Normal Form) : The table must be in 3NF and every determinant should
be a super key.
IV and V NF : These normal forms deal with multivalued dependencies and join dependencies
respectively.

CUSTOMER TABLE
Functional dependencies :
• Customer_id → Customer_name, Password, Address, Paymentcard_info, Email,
Phone_no
• Address → City, State, Pincode (derived)
• Paymentcard_info → Card_type, Card_number (derived)
1 NF - The table is already in 1NF where each cell contains a single values and there
are no repeating values.
2 NF – Here , we are creating the following separate tables –
CUSTOMER TABLE

ADDRESS TABLE

PAYMENT INFO TABLE

3 NF – Here , we are removing the transitive dependencies and we obtain the following
table :
CITIES TABLE

10
STATES TABLE

PINCODES TABLE

PRODUCT TABLE
Functional dependencies :
• Product_id → Description, Price, Stock, Category_id
• Category_id → Category_name (assumed)
• Description → Product_id, Price, Stock, Category_id
• Price, Stock → Product_id
1 NF – The table is already in 1NF where each cell contains a single values and there
are no repeating values.
2 NF – Here , we will separate the data into two tables :
PRODUCT TABLE

STOCK TABLE

11
3 NF – Here , we are removing transitive dependencies and we are creating a table
Categories

CATEGORY TABLE
Functional dependencies :
• Category_id → Name
1 NF - The table is already in 1NF where each cell contains a single values and
there are no repeating values.
2 NF – The table is in 2 NF as there is only one non – prime attribute and one
candidate key.
3 NF – Here , we will remove transitive dependencies and obtain the following
table :

ORDER TABLE
Functional dependencies :
• Order_id → Order_date, Total_price
• Order_date → Year, Month, Day (derived)

1 NF - The table is already in 1NF where each cell contains a single values and
there are no repeating values.
2 NF – Following is the table in 2 NF :

12
3 NF – There is no transitive dependencies. Hence , the table remains in 3 NF.

ORDER ITEM TABLE


Functional dependencies :
• Order_item_id → Quantity, Price, Order_id, Product_id
• Order_id → Order_date, Total_price
• Product_id → Description, Price, Category_id

1 NF - The table is already in 1NF where each cell contains a single values and there
are no repeating values.
2 NF – Following tables are separated in 2 NF :
ORDER_ITEM TABLE

ORDERS TABLE

PRODUCT TABLE

13
3 NF - There is no transitive dependencies. Hence , the table remains in 3 NF.

CART TABLE
The cart table is in it’s simplest form containing two columns with no dependencies. Hence ,
the given table is in 1 NF , 2 NF and 3 NF.

PAYMENT TABLE
Functional dependencies :
• Payment_id → Payment_date, Payment_method, Amount, Order_id

1 NF - The table is already in 1NF where each cell contains a single values and there are no
repeating values.
2 NF – The separate table created are as follows :

3 NF - There is no transitive dependencies. Hence , the table remains in 3 NF.

SHIPMENT TABLE
Functional dependencies :

14
• Shipment_id → Date, Address
• Address → Street_address, City, State, Pincode

1 NF - The table is already in 1NF where each cell contains a single values and there are no
repeating values.
2 NF – We obtain the following tables in 2 NF

3 NF – We obtain the following table after removing transitive dependencies :


CITIES TABLE

STATES TABLE

PINCODES TABLE

15
IMPLEMENTATION OF DATABASE IN SQL
Creation of database e_commerce ->

Creation of table Customer ->

Creation of table Cart ->

Creation of table Category ->

16
Creation of table Shipment ->

Creation of table ordertable ->

Creation of table Product ->

Creation of table Order_item ->

17
Creation of table Payment ->

INSERTING VALUES INTO TABLES


Inserting value into Customer table ->

Inserting value into Cart table ->

18
Inserting values into Category table ->

Inserting values into Shipment table ->

Inserting values into ordertable ->

19
Inserting values into Product table ->

20
Inserting values into Order_item table ->

21
Inserting values into Payment table ->

22

You might also like