Grocery Store MGT System Computer Project
Grocery Store MGT System Computer Project
Grocery Store MGT System Computer Project
import mysql.connector
import sys
while True:
print("MENU")
if ch==1:
mycursor=mydb.cursor()
print("DATABASE CREATED")
if ch==2:
mycursor=mydb.cursor()
mycursor.execute("SHOW DATABASES")
for x in mycursor:
print(x)
if ch==3:
mycursor=mydb.cursor()
print("TABLE CREATED")
if ch==4:
mycursor=mydb.cursor()
mycursor.execute("SHOW TABLES")
for x in mycursor:
print(x)
if ch==5:
mycursor=mydb.cursor()
mycursor.execute("DESC SHOP")
for x in mycursor:
print(x)
if ch==6:
mydb=mysql.connector.connect(host="localhost",user="root", passwd="amalanto20",
database="SHOP")
if mydb.is_connected() ==True:
print("connection ok")
else:
mycursor=mydb.cursor()
rs=mycursor.fetchall()
if row[1]==n:
print (row)
if ch==7:
c=conn.cursor()
r=c.fetchone()
print(r)
r=c.fetchone()
if ch==8:
if conn.is_connected==False:
c=conn.cursor()
r=c.fetchall()
count=crowcount
for row in r:
print(row)
if ch==9:
mycursor=mydb.cursor()
n=input("enter name")
m=int(input("enter AMOUNT"))
mydb.commit()
if ch==10:
mycursor=mydb.cursor()
mydb.commit()
print(mycursor.rowcount,"RECORD UPDATED")
if ch==11:
mydb=mysql.connector.connect(host="localhost",user="root",passwd="amalanto20",
database="SHOP")
mycursor=mydb.cursor()
mydb.commit()
if ch==12:
sys.exit()
OUTPUT:
MENU
1-CREATE DATABASE
2-SHOW DATABASE
3-CREATE TABLE
4-SHOW TABLES
5-DESC TABLE
7-SELECT QUERY
8-WHERE CLAUSE
9-INSERT DYNAMICALLY
10-UPDATE RECORDS
11-DELETE RECORDS
12-EXIT
('information_schema',)
('grocery',)
('mysql',)
('performance_schema',)
('shop',)
('shopmanagement',)
('store',)
('supermarket',)
('sys',)
MENU
1-CREATE DATABASE
2-SHOW DATABASE
3-CREATE TABLE
4-SHOW TABLES
5-DESC TABLE
7-SELECT QUERY
8-WHERE CLAUSE
9-INSERT DYNAMICALLY
10-UPDATE RECORDS
11-DELETE RECORDS
12-EXIT
('shop',)
MENU
1-CREATE DATABASE
2-SHOW DATABASE
3-CREATE TABLE
4-SHOW TABLES
5-DESC TABLE
7-SELECT QUERY
8-WHERE CLAUSE
9-INSERT DYNAMICALLY
10-UPDATE RECORDS
11-DELETE RECORDS
12-EXIT
MENU
1-CREATE DATABASE
2-SHOW DATABASE
3-CREATE TABLE
4-SHOW TABLES
5-DESC TABLE
7-SELECT QUERY
8-WHERE CLAUSE
9-INSERT DYNAMICALLY
10-UPDATE RECORDS
11-DELETE RECORDS
12-EXIT
connection ok
MENU
1-CREATE DATABASE
2-SHOW DATABASE
3-CREATE TABLE
4-SHOW TABLES
5-DESC TABLE
6-SEARCH AND DISPLAY
7-SELECT QUERY
8-WHERE CLAUSE
9-INSERT DYNAMICALLY
10-UPDATE RECORDS
11-DELETE RECORDS
12-EXIT
MENU
1-CREATE DATABASE
2-SHOW DATABASE
3-CREATE TABLE
4-SHOW TABLES
5-DESC TABLE
7-SELECT QUERY
8-WHERE CLAUSE
9-INSERT DYNAMICALLY
10-UPDATE RECORDS
11-DELETE RECORDS
12-EXIT
0 RECORD UPDATED
MENU
1-CREATE DATABASE
2-SHOW DATABASE
3-CREATE TABLE
4-SHOW TABLES
5-DESC TABLE
6-SEARCH AND DISPLAY
7-SELECT QUERY
8-WHERE CLAUSE
9-INSERT DYNAMICALLY
10-UPDATE RECORDS
11-DELETE RECORDS
12-EXIT
0 RECORD DELETED
MENU
1-CREATE DATABASE
2-SHOW DATABASE
3-CREATE TABLE
4-SHOW TABLES
5-DESC TABLE
7-SELECT QUERY
8-WHERE CLAUSE
9-INSERT DYNAMICALLY
10-UPDATE RECORDS
11-DELETE RECORDS
12-EXIT
>>>