You are on page 1of 12

TABLE OF CONTENTS

S.no Contents Page.no

1. Problem Definition
2. Problem Analysis
3. Hardware and Software
used
4. Source code
5. Output
6. Bibliography
Problem Definition
• Now a days every mobile shop manager has to maintain the
inventory details. For this purpose, they need the software
which could easily and conveniently maintain their inventory
details.
• The record of the customers can be stored in a single file. This
software can be used in several mobile shops for keeping the
records of the customer and also can be used to add records of
new items, grams it weighs ,and the price of it .
• This project “Online Mobile Shop (inventory) management
system” includes some facilities of data such as creation, display,
modification, delete etc. This software searches the mobile
shop’s data which is stored in the record.
• The software used for managing the inventory, provides new
and improved services, and identify the number of sales in the
shop.
Problem Analysis:
The aim of project is to provide the online mobile shop services to
the customers at reasonable rate. Through this project provide the
facilities to the customer such as display, modify, delete etc.
● Display:
In Display option, read the all-jewellery information such as, mobile name, model
number and its price.
● Modify:
In modify option, update the particular price of any desired phone name

• Delete:
In delete option, we can delete the record of a particular phone
Hardware and Software used

Software
● Operating system : Windows 10
● Program used : python idle 3.9(64 bit)

Hardware required

● RAM : 4GB
● Processer : 2.6GHz
● Disk space : 40GB

MODULE -I : CREATION OF ONLINE MOBILE SHOP TABLE:


SOURCE CODE:

import mysql.connector
#Connection to MySQL Server
con = mysql.connector.connect(host="localhost", user="root", passwd="wisemensay")
mycursor = con.cursor()
#Creating Management Database
mycursor.execute("DROP DATABASE IF EXISTS Management")
mycursor.execute("CREATE DATABASE Management")
mycursor.execute("USE Management")
#Creating OnlineMobile Table
mycursor.execute("DROP TABLE IF EXISTS OnlineMobile")
mycursor.execute("CREATE TABLE OnlineMobile(MobileName VARCHAR(30), Modelno
INT(5), Price INT(6))")
#Inserting values in to the table
sql = """INSERT INTO OnlineMobile(MobileName, Modelno, Price)
VALUES(%s, %s, %s)"""
rows = [('Iphone',11,50000),('Nokia',6,25000),('Samsung',6,65000),('Oppo',17,35000),
('Vivo',13,20000),('Pixel',5,56000)]
mycursor.executemany(sql, rows)
con.commit()
#To fetch the records and display
sql = "SELECT * FROM OnlineMobile"
mycursor.execute(sql)
result = mycursor.fetchall()
for row in result:
MobileName = row[0]
Modelno = row[1]
Price = row[2]
print("MobileName=%s, Modelno=%d, Price=%d" % (MobileName,Modelno,Price))
con.close()

PYTHON OUTPUT:

MySQL OUTPUT:
MODULE II –
Deleting rows of value of price of the mobile less than or equal to Rs.30000

SOURCE CODE:
import mysql.connector
#Connection to MySQL Server
con = mysql.connector.connect(host="localhost", user="root", passwd="wisemensay")
mycursor = con.cursor()
#Creating Management Database
mycursor.execute("DROP DATABASE IF EXISTS Management")
mycursor.execute("CREATE DATABASE Management")
mycursor.execute("USE Management")
#Creating OnlineMobile Table
mycursor.execute("DROP TABLE IF EXISTS OnlineMobile")
mycursor.execute("CREATE TABLE OnlineMobile(MobileName VARCHAR(30), Modelno
INT(5), Price INT(6))")
#Inserting values in to the table
sql = """INSERT INTO OnlineMobile(MobileName, Modelno, Price)
VALUES(%s, %s, %s)"""
rows = [('Iphone',11,50000),('Nokia',6,25000),('Samsung',6,65000),('Oppo',17,35000),
('Vivo',13,20000),('Pixel',5,56000)]
mycursor.executemany(sql, rows)
con.commit()
#To delete values from the table
sql = "DELETE FROM OnlineMobile WHERE Price<='%d'" %(30000)
mycursor.execute(sql)
#To fetch the records and display
sql = "SELECT * FROM OnlineMobile"
mycursor.execute(sql)
result = mycursor.fetchall()
for row in result:
MobileName = row[0]
Modelno = row[1]
Price = row[2]
print("MobileName=%s, Modelno=%d, Price=%d" % (MobileName,Modelno,Price))
con.close()

OUTPUT-II
PYTHON OUTPUT:

MODULE-III:
To update mobile name to pixel from blackberry

SOURCE CODE:
import mysql.connector
#Connection to MySQL Server
con = mysql.connector.connect(host="localhost", user="root", passwd="wisemensay")
mycursor = con.cursor()
#Creating Management Database
mycursor.execute("DROP DATABASE IF EXISTS Management")
mycursor.execute("CREATE DATABASE Management")
mycursor.execute("USE Management")
#Creating OnlineMobile Table
mycursor.execute("DROP TABLE IF EXISTS OnlineMobile")
mycursor.execute("CREATE TABLE OnlineMobile(MobileName VARCHAR(30), Modelno
INT(5), Price INT(6))")
#Inserting values in to the table
sql = """INSERT INTO OnlineMobile(MobileName, Modelno, Price)
VALUES(%s, %s, %s)"""
rows = [('Iphone',11,50000),('Nokia',6,25000),('Samsung',6,65000),('Oppo',17,35000),
('Vivo',13,20000),('Pixel',5,56000)]
mycursor.executemany(sql, rows)
con.commit()
#To update values into the table
sql = "UPDATE OnlineMobile SET MobileName = 'Blackberyy' WHERE MobileName = 'Pixel'"
mycursor.execute(sql)
#To fetch the records and display
sql = "SELECT * FROM OnlineMobile"
mycursor.execute(sql)
result = mycursor.fetchall()
for row in result:
MobileName = row[0]
Modelno = row[1]
Price = row[2]
print("MobileName=%s, Modelno=%d, Price=%d" % (MobileName,Modelno,Price))
con.close()

PYTHON OUTPUT:
BIBLIOGRAPHY:
● Computer science with Python by Sumita Arora

You might also like