0% found this document useful (0 votes)
25 views

Computer Project

Uploaded by

rancetobitr
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Computer Project

Uploaded by

rancetobitr
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

VIDYA BHARTI CHINMAYA VIDYALAYA

ACADEMIC YEAR : 2024-25

PROJECT REPORT ON :
E COMMERCE WEBSITE DATABASE

NAME: ASHUTOSH ANAND


CLASS: XII A2
ROLL NO: 08
ADMISSION NO: 15969
SUBJECT: COMPUTER SCIENCE
SUBJECT CODE: 083

PROJECT GUIDE : MRS. TUHINA SARKAR


PROJECT GUIDE TEACHER (CS)

VIDYA BHARTI CHINMAYA VIDYALAYA


TELCO COLONY, JAMSHEDPUR
1
Page
VIDYA BHARTI CHINMAYA VIDYALAYA

ACADEMIC YEAR : 2024-25

CERTIFICATE

This is to certify that ASHUTOSH ANAND, Roll no.


__________ has successfully completed the project
work titled E commerce website database
management system in the subject Computer
Science (083) laid down in the regulations of
CBSE for the purpose of practical examination in
class XII held in Vidya Bharati Chinmaya Vidyalaya
on _____________

EXAMINER PROJECT GUIDE


(Mrs. Tuhina Sarkar)
2
Page
First and foremost, I would like to express my sincere
gratitude to my computer science teacher, Madam Tuhina
Sarkar, for her guidance encouragement, and
invaluablefeedback throughout the project.
Her expertise and dedication were instrumental in shaping my
understanding of the subject and motivating me to give my
best.
I would also like to extend my heartfelt thanks to my friends
for their support , insightful discussions, and collaborative
spirit, which made the entire project experience more
enriching and enjoyable.
Lastly , I would like to thank everyone who directly or
indirectly contributed to the successful competition of this
project. Your support has been invaluable, and I am truly
grateful.

3
Page
1. Introduction
2. Proposed System Overview
3. Functions to be Performed
4. Database Integration
5. System Development Life Cycle (SDLC)
6. Flowchart for the System
7. Source Code (Python)
8. Database Table Description
9. Output Screenshots
10.Software Testing Overview
11. Hardware and Software Requirements
12. Bibliography

4
Page
In today’s digital world, the rapid growth of online shopping
has necessitated the development of efficient and robust e-
commerce systems. An e-commerce website database serves
as the backbone of any online shopping platform, allowing
seamless interaction between customers, products, and
orders. The proposed system is a E-commerce Shop
Management System designed to streamline the management
of products, customers, and orders for an online store. This
project aims to provide a comprehensive solution that
simplifies inventory management, customer interactions, and
order processing while ensuring data integrity and security.

Proposed System Overview


The system is designed to manage three primary components
of an e-commerce platform:

1. Product Management – This module handles the addition,


viewing, updating, and deletion of products. It enables the
store admin to maintain the product catalog, ensuring the
information is always up-to-date.
2. Customer Management – This section allows the addition
and viewing of customer details, which helps in tracking
customers' personal and contact information for smooth
order processing and customer support.
3. Order Management – This module allows for the creation
and tracking of customer orders, while also ensuring that
product stock is updated accordingly. The order
management system integrates with both the product and
customer databases, providing a full view of customer
purchases.
5
Page
The system is built using a MySQL database to store
information about products, customers, and orders. The
database is connected to the application through a Python
script, ensuring efficient data retrieval and modification.

The following key functions are incorporated into the system:

1. Main Menu:
o Provides access to the three major functionalities:
Manage Products, Manage Customers, and Manage
Orders.
o
2. Product Management:
o Add Product: Adds new products to the database
with details such as name, price, and stock.
o View Products: Displays all products available in the
store.
o Update Product: Allows for modifications to product
details, such as price and stock.
o Delete Product: Removes a product from the store’s
catalog.
o
3. Customer Management:
o Add Customer: Enables the addition of customer
information, including name and contact details, into
6

the database.
Page
o View Customers: Allows viewing all registered
customers in the system.
o
4. Order Management:
o Add Order: Facilitates the placement of orders by
customers. The system checks the product stock
before confirming the order and updates the product
stock accordingly.
o View Orders: Displays all customer orders, along
with details such as the customer name, product
name, quantity, and order date.

The system uses MySQL for its database management, where


the following tables are maintained:

1. Products – Stores information about products such as


name, price, and stock.
2. Customers – Stores customer information, including
contact details.
3. Orders – Tracks customer orders, including the product
ordered, quantity, and customer details.

The Python script connects to the MySQL database using the


mysql.connector library and allows the user to perform
various CRUD (Create, Read, Update, Delete) operations on the
product, customer, and order records.
7
Page
SYSTEM DEVELOPMENT LIFE
CYCLE (SDLC)
The systems development life cycle (SLDC) is a project
management framework that breaks down complex projects
into smaller, manageable phases, allowing for structured
progress and risk management.
By segmenting projects,managers can verify the successful
completion of each phase before allocating resources to the
next, reducing the risk of errors. The typical SLDC phases
include intiation, planning, design, development, testing,
implementation, and maintainence. However, these phases can
be adapted on the basis of organisation’s needs, with some
projects having additional stages .

Their feedback ensures that system is being developed to


meet the required functionality and user expectations. This
iterative involvement helps in refining the the system, leading
to a final product that aligns both technical and user
8

requirements.
Page
PHASES OF THE SYSTEM
DEVELOPMENT LIFE CYCLE
INTIATION PHASE

The intiation phase is the starting point of the SDLC and begins
when a business sponsor identifies a need or oppoturnity for
improvement. The primary goal of this phase is to definite and
validate the business needs, identifying significant
assumptions, constraints and alternative approaches to
address the identified need. This phase challenges the necessity
of new technology by exploring if a change in the business
process itself could be a viable solution.
The outcome of the Initiation Phase is the development of a
Concept Proposal that documents the business requirements,
project scope, and alignment with the organization's strategic
plan. Executive sponsorship is critical at this stage, with
adesignated Project Manager responsible for leading
theproject. The Concept Proposal serves as the foundation
forthe Project Management Charter, which authorizes the
ProjectManager to begin formal project planning. To
ensurealignment with strategic business objectives, careful
oversight is exercised to guarantee that the project supports
the organization’s goals and integrates seamlessly into the
enterprise architecture.
This phase culminates in a formal business case that outlines
the proposal's purpose, expectedbenefits, alternative solutions,
9

and how the proposed systemaligns with organizational


Page
strategies. A well-prepared business case serves as a
compelling justification for moving forward.

SYSTEM CONCEPT DEVELOPMENT

Phase One: System Concept Development


Once the business need is validated, the System Concept
Development Phase begins. The primary focus of this phase is
to evaluate the feasibility and suitability of different solutions
to meet the business need. Key activities in this phase include
identifying system interfaces, basic functional and data
requirements, system boundaries, and critical success factors.
The goal is to establish clear objectives and performance
measures while evaluating the costs and benefits of various
approaches. These approaches may include using Commercial
Off-The-Shelf (COTS) software, custom development, or a
combination of both. This phase places a strong emphasis on
risk assessment, identifying potential project risks, and
initiating mitigation strategies. Additionally, a high-level
technical architecture, process models, and data models are
developed to outline how the proposed system will integrate
with the existing infrastructure. Prototyping may be used to
assess the feasibility of specific technologies or
functionalities, helping to inform decisions about trade-offs,
such as whether to opt for incremental delivery or a full-scale
deployment.
A System Boundary Document created during this phase is
essential for the Information Technology Project Request
(ITPR) process. The ITPR must be approved by the Chief
10

Information Officer (CIO) before the project can proceed. This


Page

document defines all informational, functional, and network


requirements, ensuring that the system concept aligns with
organizational objectives. CIO approval is required to move
forward to the next stages of the Software Development Life
Cycle (SDLC), ensuring that the project aligns with the
organization’s strategic IT roadmap.

Planning Phase
The Planning Phase is crucial for the success of both
development and maintenance projects. It involves detailed
planning to coordinate activities and efficiently manage risks.
During this phase, project plans are developed to refine the
information gathered during the Initiation Phase, outlining
specific activities, resources, schedules, and user inputs.
A key role of the project manager in this phase is to facilitate
discussions among stakeholders to identify and document all
functional, security, and network requirements. The Project
Management Plan is created during this phase and covers
areas such as acquisition, configuration management, quality
assurance, and system security. This ensures that all
necessary components are accounted for before the project
proceeds.

Required Analysis Phase


The Requirements Analysis Phase focuses on defining detailed
functional and data requirements, building on the high-level
needs identified earlier in the project lifecycle. This phase
involves developing a comprehensive requirements document
that outlines data, system, performance, security, and
maintainability requirements. The objective is to create
11

measurable and testable requirements that align with


Page

business goals. Business process reengineering is conducted


to streamline functions supported by the system, and
evaluation criteria for testing are established for the later
phases of the project.

Design Phase
The Design Phase translates the requirements into detailed
system specifications. This phase involves creating unified
design layouts, employing either a top-down or bottom-up
approach, to define how each component of the system will
interact. Prototyping tools may be used to generate mock-ups
of screens, databases, and system architecture. An iterative
review process is conducted to ensure that the design aligns
with requirements, refining the system specifications before
proceeding to development.

Development Phase
The Development Phase transforms the design into functional
software. During this phase, developers convert detailed
requirements into system components, ensuring that each unit
is tested for usability. This phase also involves preparing for
system integration and testing. Effective collaboration among
developers, testers, and stakeholders is crucial for the
successful completion of the phase. The goal is to ensure that
the system components work as intended and are ready for
integration with other components.

Integration and Testing Phase


The Integration and Testing Phase is when the system
12

undergoes multiple levels of testing. This includes subsystem


Page

integration, system testing, security testing, and user


acceptance testing. Quality assurance personnel and end-
users validate that the system meets all defined requirements.
Additionally, security assessments are conducted to ensure
that the system is secure and ready for deployment. Testing
verifies that all functionalities align with business needs, and
an independent verification and validation (IV&V) process
confirms the system's readiness for deployment.

Implementation Phase
The Implementation Phase begins once the system has passed
testing and is accepted by users. In this phase, the system is
deployed into a production environment, users are trained, and
the system is integrated into daily operations. The system’s
performance is continuously measured against the objectives
set during the planning phase to ensure it meets all user
requirements and operates effectively within the production
environment.

Operations and Maintenance Phase


The Operations and Maintenance Phase is focused on
monitoring the system’s performance and maintaining it to
resolve any issues that arise. The system is regularly
assessed to ensure it continues to meet ongoing business
needs. Enhancements and updates are implemented as
necessary to improve functionality or adapt to new
requirements. If the system becomes outdated or no longer
serves its intended purpose, it may re-enter the planning
phase for modernization, or it may be retired altogether. The
aim is to ensure the system remains functional and adaptable
13

to evolving business demands and technological


advancements.
Page
FLOW CHART FOR THE SYSTEM

14
Page
PYTHON CODE
"""
Name: Ashutosh Anand
Class: 12 A2
Roll No: 08
Admission No: 15969
School: Vidya Bharti Chinmaya Vidyalaya, Jamshedpur,
Jharkhand - 831004
Project: E-commerce Shop Management System
"""

import mysql.connector

database = mysql.connector.connect(
host="localhost",
user="root",
password="",
database="ecommerce"
)

cursor = database.cursor()

def main_menu():
while True:
print("*"*35)
print("=== E-commerce Shop Management ===")
print("1. Manage Products")
print("2. Manage Customers")
print("3. Manage Orders")
print("4. Exit")
print("*"*35)
choice = input("Enter your choice: ")
15

if choice == '1':
Page

manage_products()
elif choice == '2':
manage_customers()
elif choice == '3':
manage_orders()
elif choice == '4':
print("Exiting the system.")
break
else:
print("Invalid choice. Please try again.")

def manage_products():
while True:
print("\n--- Manage Products ---")
print("1. Add Product")
print("2. View Products")
print("3. Update Product")
print("4. Delete Product")
print("5. Back to Main Menu")
choice = input("Enter your choice: ")

if choice == '1':
add_product()
elif choice == '2':
view_products()
elif choice == '3':
update_product()
elif choice == '4':
delete_product()
elif choice == '5':
break
else:
print("Invalid choice. Please try again.")

def add_product():
try:
name = input("Enter product name: ")
price = float(input("Enter product price: "))
stock = int(input("Enter product stock: "))
if price < 0 or stock < 0:
print("Price and stock must be greater than 0.")
16

return
Page
query = "INSERT INTO products (name, price, stock)
VALUES (%s, %s, %s)"
cursor.execute(query, (name, price, stock))
database.commit()
print("Product added successfully.")
except mysql.connector.Error as err:
print(f"Error: {err}")
database.rollback()

def view_products():
query = "SELECT * FROM products"
cursor.execute(query)
for row in cursor.fetchall():
print(row)

def update_product():
try:
product_id = int(input("Enter product ID to update:
"))
name = input("Enter new product name: ")
price = float(input("Enter new product price: "))
stock = int(input("Enter new product stock: "))
if price < 0 or stock < 0:
print("Price and stock must be greater than 0.")
return
query = "UPDATE products SET name=%s, price=%s,
stock=%s WHERE product_id=%s"
cursor.execute(query, (name, price, stock,
product_id))
database.commit()
if cursor.rowcount == 0:
print("Product not found.")
return
print("Product updated successfully.")
except mysql.connector.Error as err:
print(f"Error: {err}")
database.rollback()

def delete_product():
try:
17

product_id = int(input("Enter product ID to delete:


Page

"))
query = "DELETE FROM products WHERE product_id=%s"
cursor.execute(query, (product_id,))
database.commit()
if cursor.rowcount == 0:
print("Product not found.")
return
print("Product deleted successfully.")
except mysql.connector.Error as err:
print(f"Error: {err}")
database.rollback()
# Manage Customers
def manage_customers():
while True:
print("\n--- Manage Customers ---")
print("1. Add Customer")
print("2. View Customers")
print("3. Back to Main Menu")
choice = input("Enter your choice: ")

if choice == '1':
add_customer()
elif choice == '2':
view_customers()
elif choice == '3':
break
else:
print("Invalid choice. Please try again.")

# Manage Customers
def manage_customers():
while True:
print("\n--- Manage Customers ---")
print("1. Add Customer")
print("2. View Customers")
print("3. Back to Main Menu")
choice = input("Enter your choice: ")

if choice == '1':
add_customer()
elif choice == '2':
18

view_customers()
Page

elif choice == '3':


break
else:
print("Invalid choice. Please try again.")
def add_customer():
try:
name = input("Enter customer name: ")
contact_info = input("Enter customer contact info: ")
query = "INSERT INTO customers (name, contact_info)
VALUES (%s, %s)"
cursor.execute(query, (name, contact_info))
database.commit()
print("Customer added successfully.")
except mysql.connector.Error as err:
print(f"Error: {err}")
database.rollback()
def add_customer():
try:
name = input("Enter customer name: ")
contact_info = input("Enter customer contact info: ")
query = "INSERT INTO customers (name, contact_info)
VALUES (%s, %s)"
cursor.execute(query, (name, contact_info))
database.commit()
print("Customer added successfully.")
except mysql.connector.Error as err:
print(f"Error: {err}")
database.rollback()

def view_customers():
query = "SELECT * FROM customers"
cursor.execute(query)
for row in cursor.fetchall():
print(row)

# Manage Orders
def manage_orders():
while True:
print("\n--- Manage Orders ---")
print("1. Add Order")
print("2. View Orders")
19

print("3. Back to Main Menu")


Page

choice = input("Enter your choice: ")


if choice == '1':
add_order()
elif choice == '2':
view_orders()
elif choice == '3':
break
else:
print("Invalid choice. Please try again.")

def add_order():
try:
customer_id = int(input("Enter customer ID: "))
product_id = int(input("Enter product ID: "))
quantity = int(input("Enter quantity: "))

# Check product stock


query = "SELECT stock FROM products WHERE
product_id=%s"
cursor.execute(query, (product_id,))
stock = cursor.fetchone()[0]

if stock >= quantity:


query = "INSERT INTO orders (customer_id,
product_id, quantity) VALUES (%s, %s, %s)"
cursor.execute(query, (customer_id, product_id,
quantity))
query = "UPDATE products SET stock = stock - %s
WHERE product_id = %s"
cursor.execute(query, (quantity, product_id))
database.commit()
print("Order placed successfully.")
elif stock == 0:
print("Product out of stock.")
elif stock < quantity:
print("Insufficient stock.")
elif quantity == 0:
print("Invalid quantity.")
else:
database.rollback()
20

except Exception as e:
Page

print(f"Unexpected error: {e}")


def view_orders():
query = """
SELECT o.order_id, c.name AS customer_name, p.name AS
product_name, o.quantity, o.order_date
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
JOIN products p ON o.product_id = p.product_id
"""
cursor.execute(query)
for row in cursor.fetchall():
print(row)

if __name__ == "__main__":
# Run the program
main_menu()

# Close the database connection


cursor.close()
database.close()

SQL CODE
CREATE DATABASE ecommerce;

USE ecommerce;

CREATE TABLE products (


product_id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
price DECIMAL(10, 2),
stock INT
);

CREATE TABLE customers (


customer_id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
contact_info VARCHAR(100)
21

);
Page
CREATE TABLE orders (
order_id INT AUTO_INCREMENT PRIMARY KEY,
customer_id INT,
product_id INT,
quantity INT,
order_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (customer_id) REFERENCES
customers(customer_id),
FOREIGN KEY (product_id) REFERENCES products(product_id)
);

22
Page
TABLE DESCRIPTION

23
Page
Adding a product to database

Database Output

24
Page
Product quantity and price validation

View Products

25
Page
Update Product

Database Output

26
Page
Product Update Validation

27
Page
Product Removal

Database Output

28
Page
Viewing and Adding Customers

Database Output
29
Page
Placing Orders

Database Output
Order Table
30
Page
Product Table Updatation

Viewing Orders

31
Page
Software Testing Overview
Software Testing is the process of evaluating a software
application to provide stakeholders with insights into its
quality and to identify potential risks associated with its
deployment. Testing ensures that the software meets both
business and technical requirements, functions as expected,
and can be reliably implemented. While testing can be
performed at any stage of development, most testing is done
after the requirements are defined and the coding process is
completed.

Testing Methods
Testing methods are broadly categorized into two types: Black
Box Testing and White Box Testing.
Black Box Testing
Black Box Testing treats the software as a "black box,"
meaning the tester has no knowledge of the internal coding.
The focus is on validating the outputs based on various inputs,
ensuring that the software behaves as expected.
Techniques Include:
 Equivalence Partitioning
 Boundary Value Analysis
 All-pairs Testing
 Model-Based Testing
 Fuzz Testing
32

 Exploratory Testing
Page
 Specification-Based Testing
Pros:
 Unbiased testing from a user perspective.
 Effective at identifying functional issues.
Cons:
 Limited visibility into internal logic.
 Can lead to redundant test cases or missed backend
issues.
White Box Testing
White Box Testing involves testing the internal structures and
logic of the code. The tester has access to the underlying code,
algorithms, and data structures.
Types of White Box Testing:
 API Testing: Verifies both public and private APIs.
 Code Coverage: Ensures all statements or functions are
executed at least once.
 Function Coverage: Reports the number of lines executed.
 Statement Coverage: Deliberately introducing faults to
test error handling.
 Mutation Testing: Analyzes code without executing the
program.
 Static Testing: Analyzes code without execution.
Advantages:
 Provides detailed insights into code quality and coverage.
 Ensures critical paths are thoroughly tested.
33
Page
Hardware and Software
Requirements
Operating System: Windows 7 or above
Processor: Multicore, 2GHz or above
RAM: 2GB or above
Hard Disk Storage: 10GB of available hard disk space
Python Version: 3.11.9 (or above)
MySQL Version: 8.09 (or above)

34
Page
 Computer Science with Python Class XII by Sumitra Arora
 GeeksforGeeks.org
 www.wikipedia.com
 Github.com
 W3Schools.com

35
Page

You might also like