Computer Project
Computer Project
PROJECT REPORT ON :
E COMMERCE WEBSITE DATABASE
CERTIFICATE
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.
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.
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
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.
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.
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.
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
"))
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
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
def add_order():
try:
customer_id = int(input("Enter customer ID: "))
product_id = int(input("Enter product ID: "))
quantity = int(input("Enter quantity: "))
except Exception as e:
Page
if __name__ == "__main__":
# Run the program
main_menu()
SQL CODE
CREATE DATABASE ecommerce;
USE ecommerce;
);
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