Computer 12
Computer 12
1) Acknowledgement
2)Introduction
3)Program Code
4)Output
5)Bibilography
Acknowledgement
PROGRAM CODE
import mysql.connector as ms
cn=ms.connect(host='localhost',user='root',pas
swd='toch',\
database='anime', charset='utf8')
crsr=cn.cursor()
def nstrm():
b=input('Enter the streaming service Name:')
crsr.execute('create table %s(Slno int primary
key,\
animenm varchar(50) not null,\
maincharecter varchar(50) not null,\
ended varchar(50) not null,\
rating int,\
episodes integer)'%(b,))
print('New anime Successfully Created\n')
#Anime streaming service has been taken as YT
for project.
elif c == 2:
q=int(input('Enter the New episodes: '))
crsr.execute('update aot set Qnty = %s where
Slno = %s '%(q,sl))
cn.commit()
print('episodes Successfully Updated\n')
def ser():
s=int(input('Enter the anime serial Number: '))
crsr.execute('select* from aot where Slno=%s'%
(s,))
f=crsr.fetchone()
if f == None:
print('No Such Record Available in the
System\n')
else:
print('Anime Found')
for i in f:
print(i, end='\t')
print()
def allanim():
crsr.execute('select* from aot')
print('All Products in aot: ')
for x in crsr:
print(x)
print()
def allstrm(): #Displaying all the tables
print('All streaming services in the Database:')
crsr.execute('show tables')
for x in crsr:
print(x)
print()
elif ch==7:
allstrm()
elif ch==8:
cn.close()
break
else:
print('Invalid Option')
OUTPUT
in mysql
2nd output screen in python
in mysql
3rd output screen
in mysql
4th output screen python
in mysql