Computer Science Project
Computer Science Project
NURSERY
Signature Signature
(Internal Examiner) (External Examiner)
ACKNOWLEDGEMENT
Hardware Required :
RAM- 4GB or above
Processor-CoreTM i5 or
above
Hard Disk-5GB or above
SOFTWARE REQUIRED :
Operating System-Windows 7
or 10
Python-Version (3.7.9)
SQL- Version (8.0.21)
ABOUT THE PROJECT
This project is a comprehensive nursery management system that caters
to two types of users: customers and employees. The system is designed
to streamline the purchase and management of plants, offering a user-
friendly interface for both roles.
1. Customer Mode :
In the customer mode, the user can browse through a list of plants
available for purchase. The interface displays key details for each
plant, including:
• Serial Number (SRNO): A unique identifier for each plant.
• Name of the Plant: The common or scientific name of the plant.
• Price: The cost of each plant.
• Quantity: The available stock for each plant.
Customers can then select the plants they wish to purchase and add
them to their cart. After finalizing their selections, they proceed to
the final billing, where the system calculates the total cost and
generates a bill.
2. Employee Mode :
In the employee mode, the system provides advanced management
features to maintain and update the nursery’s inventory. Employees
can:
• Modify: Update existing plant details, such as price, quantity,
or name.
• Delete: Remove plants from the inventory if they are no longer
available.
• Add: Introduce new plants to the system by entering their
details.
This dual-mode system ensures that customers have a seamless
shopping experience while employees can efficiently manage the
nursery's inventory.
SQL PROGRAMMING
1.Create database project;
2. CREATE TABLE Plants (
sno INT,
plantname CHAR(50),
PlantType CHAR(50),
Price INT(25),
Quantity INT(25);
PYTHON PROGRAMMING
import mysql.connector
def display_plants():
c.execute("select * from plants")
print("All Plants:")
for i in c:
print(i)
def delete_plant(sno):
c.execute("delete from plants where sno={}".format(sno))
con.commit()
print("Plant deleted successfully.")
def search_item(itemname):
c.execute("select * from items where itemname='{}'".format(itemname))
found = False
for i in c:
print(i)
found = True
if not found:
print("Item not found.")
def display_items():
c.execute("select * from items")
print("All Items:")
for i in c:
print(i)
def delete_item(sno):
c.execute("delete from items where sno={}".format(sno))
con.commit()
print("Item deleted successfully.")
def generate_bill():
total_bill = 0
print("Bill:")
for item in cart:
name, price, quantity, total = item
print("Item: {}, Quantity: {}, Total: {}".format(name, quantity, total))
total_bill += total
print("Total Bill: {}".format(total_bill))
print("--------------------------------------------------")
print("Welcome to My Shop")
print("--------------------------------------------------")
while True:
user_type = input("Are you an Employee or Customer? (Type 'Employee' or
'Customer'): ").strip().lower()
if user_type == 'employee':
print("--------------------------------------------------")
print("Employee Menu")
print("1. Manage Plants")
print("2. Manage Items")
print("3. Exit")
print("--------------------------------------------------")
if table_choice == 1:
while True:
print("--------------------------------------------------")
print("Plants Management")
print("1. Add Plant")
print("2. Search Plant")
print("3. Display All Plants")
print("4. Delete Plant")
print("5. Modify Plant")
print("6. Back to Main Menu")
print("--------------------------------------------------")
if choice == 1:
sno = int(input("Enter SNo: "))
pname = input("Enter plant name: ").lower()
ptype = input("Enter plant type: ").lower()
price = int(input("Enter price: "))
quantity = int(input("Enter quantity: "))
add_plant(sno, pname, ptype, price, quantity)
elif choice == 2:
pname = input("Enter plant name for search: ").lower()
search_plant(pname)
elif choice == 3:
display_plants()
elif choice == 4:
sno = int(input("Enter SNo for deletion: "))
delete_plant(sno)
elif choice == 5:
sno = int(input("Enter plant SNo for modification: "))
pname = input("Enter new plant name: ").lower()
ptype = input("Enter new plant type: ").lower()
price = int(input("Enter new price: "))
quantity = int(input("Enter new quantity: "))
modify_plant(sno, pname, ptype, price, quantity)
display_plants()
elif choice == 6:
break
else:
print("Invalid choice. Please try again.")
elif table_choice == 2:
while True:
print("--------------------------------------------------")
print("Items Management")
print("1. Add Item")
print("2. Search Item")
print("3. Display All Items")
print("4. Delete Item")
print("5. Modify Item")
print("6. Back to Main Menu")
print("--------------------------------------------------")
if choice == 1:
sno = int(input("Enter SNo: "))
itemname = input("Enter item name: ").lower()
itemtype = input("Enter item type: ").lower()
price = int(input("Enter price: "))
quantity = int(input("Enter quantity: "))
add_item(sno, itemname, itemtype, price, quantity)
elif choice == 2:
itemname = input("Enter item name for search: ").lower()
search_item(itemname)
elif choice == 3:
display_items()
elif choice == 4:
sno = int(input("Enter SNo for deletion: "))
delete_item(sno)
elif choice == 5:
sno = int(input("Enter item SNo for modification: "))
itemname = input("Enter new item name: ").lower()
itemtype = input("Enter new item type: ").lower()
price = int(input("Enter new price: "))
quantity = int(input("Enter new quantity: "))
modify_item(sno, itemname, itemtype, price, quantity)
display_items()
elif choice == 6:
break
else:
print("Invalid choice. Please try again.")
elif table_choice == 3:
print("Exiting...")
break
else:
print("Invalid choice. Please try again.")
cart = []
while True:
choice = int(input("Enter your choice: "))
if choice == 1:
display_plants()
elif choice == 2:
display_items()
elif choice == 3:
while True:
table = input("Enter table (plants or items): ").strip().lower()
sno = int(input("Enter serial number of the item: "))
quantity = int(input("Enter quantity: "))
add_to_cart(table, sno, quantity)
elif choice == 4:
generate_bill()
elif choice == 5:
print("Thank you for visiting!")
break
else:
print("Invalid choice. Please try again.")
break
else:
print("Invalid input. Please enter 'Employee' or 'Customer'.")
OUTPUT
• Employee: -
--------------------------------------------------
Welcome to My Shop
--------------------------------------------------
Are you an Employee or Customer? (Type 'Employee' or 'Customer'): Employee
--------------------------------------------------
Employee Menu
1. Manage Plants
2. Manage Items
3. Exit
--------------------------------------------------
Enter your choice: 1
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant
3. Display All Plants
4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 1
Enter SNo: 16
Enter plant name: Tulsi
Enter plant type: Herb
Enter price: 250
Enter quantity: 28
3. Display All Plants Plant added successfully.
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant
3. Display All Plants
4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 2
Enter plant name for search: Rose
(3, 'Rose', 'Flower', 220, 52)
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant
4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 3
All Plants:
(1, 'Tulip', 'Flower', 180, 45)
(2, 'Spider Plant', 'Houseplant', 300, 45)
(3, 'Rose', 'Flower', 220, 52)
(4, 'Cactus', 'Succulent', 150, 30)
(5, 'Peace Lily', 'Houseplant', 150, 31)
(6, 'Fern', 'Fern', 100, 25)
(7, 'Dracaena', 'Houseplant', 300, 25)
(8, 'Daisy', 'Flower', 170, 70)
(9, 'Aloe Vera', 'Succulent', 250, 30)
(10, 'Bamboo Palm', 'Houseplant', 250, 30)
(11, 'Lily', 'Flower', 210, 40)
(12, 'Snake Plant', 'Houseplant', 200, 20)
(13, 'Orchid', 'Flower', 250, 30)
(14, 'Rubber Plant', 'Houseplant', 200, 10)
(15, 'Basil', 'Herb', 200, 100)
(16, 'tulsi', 'herb', 250, 28)
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant
3. Display All Plants
4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 4
Enter SNo for deletion: 16
Plant deleted successfully.
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant
3. Display All Plants
4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 5
Enter plant SNo for modification: 6
Enter new plant name: Tulsi
Enter new plant type: Herb
Enter new price: 300
Enter new quantity: 50
Plant modified successfully.
All Plants:
(1, 'Tulip', 'Flower', 180, 45)
(2, 'Spider Plant', 'Houseplant', 300, 45)
(3, 'Rose', 'Flower', 220, 52)
(4, 'Cactus', 'Succulent', 150, 30)
(5, 'Peace Lily', 'Houseplant', 150, 31)
(6, 'tulsi', 'herb', 300, 50)
(7, 'Dracaena', 'Houseplant', 300, 25)
(8, 'Daisy', 'Flower', 170, 70)
(9, 'Aloe Vera', 'Succulent', 250, 30)
(10, 'Bamboo Palm', 'Houseplant', 250, 30)
(11, 'Lily', 'Flower', 210, 40)
(12, 'Snake Plant', 'Houseplant', 200, 20)
(13, 'Orchid', 'Flower', 250, 30)
(14, 'Rubber Plant', 'Houseplant', 200, 10)
(15, 'Basil', 'Herb', 200, 100)
--------------------------------------------------
Plants Management
1. Add Plant
2. Search Plant
3. Display All Plants
4. Delete Plant
5. Modify Plant
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 6
Are you an Employee or Customer? (Type 'Employee' or 'Customer'): Employee
--------------------------------------------------
Employee Menu
1. Manage Plants
2. Manage Items
3. Exit
--------------------------------------------------
Enter your choice: 2
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 3
All Items:
(1, 'Clay Pot', 'Pot', 525, 100)
(2, 'Plastic Stand', 'Stand', 650, 50)
(3, 'Organic Fertilizer', 'Fertilizer', 512, 200)
(4, 'Potting Soil', 'Soil', 510, 147)
(5, 'Watering Can', 'Accessory', 580, 58)
(6, 'Plant Label', 'Accessory', 520, 300)
(7, 'Garden Trowel', 'Tool', 560, 40)
(8, 'Compost', 'Soil', 530, 80)
(9, 'Hanging Basket', 'Pot', 600, 25)
(10, 'Plant Support', 'Stand', 550, 60)
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 1
Enter SNo: 11
Enter item name: Plant Cutter
Enter item type: Tool
Enter price: 600
Enter quantity: 5
Item added successfully.
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 2
Enter item name for search: Compost
(8, 'Compost', 'Soil', 530, 80)
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 3
All Items:
(1, 'Clay Pot', 'Pot', 525, 100)
(2, 'Plastic Stand', 'Stand', 650, 50)
(3, 'Organic Fertilizer', 'Fertilizer', 512, 200)
(4, 'Potting Soil', 'Soil', 510, 147)
(5, 'Watering Can', 'Accessory', 580, 58)
(6, 'Plant Label', 'Accessory', 520, 300)
(7, 'Garden Trowel', 'Tool', 560, 40)
(8, 'Compost', 'Soil', 530, 80)
(9, 'Hanging Basket', 'Pot', 600, 25)
(10, 'Plant Support', 'Stand', 550, 60)
(11, 'plant cutter', 'tool', 600, 5)
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 4
Enter SNo for deletion: 11
Item deleted successfully.
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 5
Enter item SNo for modification: 2
Enter new item name: Plant Cutter
Enter new item type: Tool
Enter new price: 900
Enter new quantity: 6
Item modified successfully.
All Items:
(1, 'Clay Pot', 'Pot', 525, 100)
(2, 'plant cutter', 'tool', 900, 6)
(3, 'Organic Fertilizer', 'Fertilizer', 512, 200)
(4, 'Potting Soil', 'Soil', 510, 147)
(5, 'Watering Can', 'Accessory', 580, 58)
(6, 'Plant Label', 'Accessory', 520, 300)
(7, 'Garden Trowel', 'Tool', 560, 40)
(8, 'Compost', 'Soil', 530, 80)
(9, 'Hanging Basket', 'Pot', 600, 25)
(10, 'Plant Support', 'Stand', 550, 60)
--------------------------------------------------
Items Management
1. Add Item
2. Search Item
3. Display All Items
4. Delete Item
5. Modify Item
6. Back to Main Menu
--------------------------------------------------
Enter your choice: 6
Are you an Employee or Customer? (Type 'Employee' or 'Customer'): Employee
--------------------------------------------------
Employee Menu
1. Manage Plants
2. Manage Items
3. Exit
--------------------------------------------------
Enter your choice: 3
Exiting...
• Customer: -
--------------------------------------------------
Welcome to My Shop
--------------------------------------------------
Are you an Employee or Customer? (Type 'Employee' or 'Customer'): Customer
--------------------------------------------------
Customer Menu
1. Display Plants
2. Display Items
3. Add to Cart
4. Generate Bill
5. Exit
--------------------------------------------------
Enter your choice: 1
All Plants:
(1, 'Tulip', 'Flower', 180, 45)
(2, 'Spider Plant', 'Houseplant', 300, 45)
(3, 'Rose', 'Flower', 220, 52)
(4, 'Cactus', 'Succulent', 150, 30)
(5, 'Peace Lily', 'Houseplant', 150, 31)
(6, 'tulsi', 'herb', 300, 50)
(7, 'Dracaena', 'Houseplant', 300, 25)
(8, 'Daisy', 'Flower', 170, 70)
(9, 'Aloe Vera', 'Succulent', 250, 30)
(10, 'Bamboo Palm', 'Houseplant', 250, 30)
(11, 'Lily', 'Flower', 210, 40)
(12, 'Snake Plant', 'Houseplant', 200, 20)
(13, 'Orchid', 'Flower', 250, 30)
(14, 'Rubber Plant', 'Houseplant', 200, 10)
(15, 'Basil', 'Herb', 200, 100)
Enter your choice: 2
All Items:
(1, 'Clay Pot', 'Pot', 525, 100)
(2, 'plant cutter', 'tool', 900, 6)
(3, 'Organic Fertilizer', 'Fertilizer', 512, 200)
(4, 'Potting Soil', 'Soil', 510, 147)
(5, 'Watering Can', 'Accessory', 580, 58)
(6, 'Plant Label', 'Accessory', 520, 300)
(7, 'Garden Trowel', 'Tool', 560, 40)
(8, 'Compost', 'Soil', 530, 80)
(9, 'Hanging Basket', 'Pot', 600, 25)
(10, 'Plant Support', 'Stand', 550, 60)
Enter your choice: 3
Enter table (plants or items): Plants
Enter serial number of the item: 5
Enter quantity: 12
Added to cart:
Item: Peace Lily
Quantity: 12
Total: 1800
Do you want to add another item to the cart? (yes/no): yes
Enter table (plants or items): items
Enter serial number of the item: 6
Enter quantity: 2
Added to cart:
Item: Plant Label
Quantity: 2
Total: 1040
Do you want to add another item to the cart? (yes/no): no
Enter your choice: 4
Bill:
Item: Peace Lily, Quantity: 12, Total: 1800
Item: Plant Label, Quantity: 2, Total: 1040
Total Bill: 2840
Enter your choice: 5
Thank you for visiting!